Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/org/reactome/release/updateDOIs/Verifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public class Verifier {
@Parameter(names ={"--output", "--o"})
private String outputFolder = ".";

private final String REACTOME_DOI_PREFIX = "10.3180";

public static void main(String[] args) throws Exception {
Verifier verifier = new Verifier();
JCommander.newBuilder()
Expand Down Expand Up @@ -176,14 +178,12 @@ private boolean hasExpectedDOI(GKInstance pathway, String expectedDOI) throws Ex
}

private String getCorrectDOI(GKInstance pathway) {
final String reactomeDOIPrefix = "10.3180/";

try {
GKInstance pathwayStableIdInstance = (GKInstance)
pathway.getAttributeValue(ReactomeJavaConstants.stableIdentifier);
String pathwayStableId = pathwayStableIdInstance.getDisplayName();

return reactomeDOIPrefix + pathwayStableId;
return REACTOME_DOI_PREFIX + "/" + pathwayStableId;
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand All @@ -196,7 +196,7 @@ private boolean needsDOI(GKInstance pathway) {
} catch (Exception e) {
throw new RuntimeException("Unable to get doi value from pathway " + pathway, e);
}
return doiValue != null && doiValue.equals("needs DOI");
return doiValue != null && !doiValue.startsWith(REACTOME_DOI_PREFIX);
}

private List<String> getExpectedDOIs() throws IOException {
Expand Down
Loading