Skip to content

Commit

Permalink
Release 1.0.1. Fix #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
khituras committed Nov 20, 2022
1 parent 9024cf7 commit a3ae317
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>de.julielab</groupId>
<artifactId>julielab-gnormplus</artifactId>
<packaging>jar</packaging>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.1</version>
<name>JULIE Lab GNormPlus</name>
<url>https://www.ncbi.nlm.nih.gov/research/bionlp/Tools/gnormplus/</url>

Expand Down
5 changes: 1 addition & 4 deletions src/GNormPluslib/BioCDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public void BioC2PubTator(String input, String output) throws IOException, XMLSt
}
}
} else {
Annoid = annotation.getInfon("Identifier").get();
Annoid = annotation.getInfon("Identifier").orElse(null);
}
} else if (Annotype.equals("Species") || Annotype.equals("Genus") || Annotype.equals("Strain")) {
if (annotation.getInfons().containsKey("NCBI Taxonomy")) {
Expand Down Expand Up @@ -563,7 +563,6 @@ public void BioCReader(String input) throws IOException, XMLStreamException {
PassageOffsets.add(PassageOffset);
Annotations.add(AnnotationInPMID);
}
System.out.println("[BioCReader] PMCIDs.size(): " + PMIDs.size() + ", " + PMIDs);
}

public void BioCReaderWithAnnotation(String input) throws IOException, XMLStreamException {
Expand Down Expand Up @@ -678,8 +677,6 @@ public void BioCReaderWithAnnotation(String input) throws IOException, XMLStream
PassageOffsets.add(PassageOffset);
Annotations.add(AnnotationInPMID);
}
System.out.println("[BioCReaderWithAnnotation] PMCIDs.size(): " + PMIDs.size()+ ", " + PMIDs + "; Annotations: " + Annotations.size());

}

public void BioCOutput(String input, String output, ArrayList<ArrayList<ArrayList<String>>> Annotations, boolean Final, boolean RemovePreviousAnno) throws IOException, XMLStreamException {
Expand Down
18 changes: 1 addition & 17 deletions src/GNormPluslib/GN.java
Original file line number Diff line number Diff line change
Expand Up @@ -912,23 +912,7 @@ public void GeneIDRecognition(String Filename, String FilenameBioC) throws IOExc
String mention = anno[2].toLowerCase();
mention = mention.replaceAll("[\\W\\-\\_]+", "");
if (GNormPlus.GeneIDs_hash.containsKey(mention)) {
try {
data.getBioCDocobj().Annotations.get(i).get(j).add(locations.get(k) + "\tGeneID:" + GNormPlus.GeneIDs_hash.get(mention)); //paragraph
} catch (Exception e) {
System.out.println("i: " + i);
System.out.println("j: " + j);
System.out.println("Number of PMIDs: " + data.getBioCDocobj().PMIDs.size());
System.out.println("Number of annotation lists: " + data.getBioCDocobj().Annotations.size());
// final String pmid = i < data.getBioCDocobj().PMIDs.size() ? data.getBioCDocobj().PMIDs.get(i) : "i too large: i=" + i + ", data.getBioCDocobj().PMIDs.size()=" + data.getBioCDocobj().PMIDs.size();
// System.out.println("PMID: " + pmid);
// System.out.println("data.getBioCDocobj().Annotations.size(): " + data.getBioCDocobj().Annotations.size());
// if (i < data.getBioCDocobj().Annotations.size()) {
// System.out.println("data.getBioCDocobj().Annotations.get(i).size(): " + data.getBioCDocobj().Annotations.get(i).size());
// } else {
// System.out.println("i too large: i=" + i + ", data.getBioCDocobj().Annotations.size()=" + data.getBioCDocobj().Annotations.size());
// }
System.out.println("[GNormPlus:GN#GeneIDRecognition] Warning: Skipping GeneIDMatch for document number " + i + " with ID " + data.getBioCDocobj().PMIDs.get(i) + " because of an internal consistency issue");
}
data.getBioCDocobj().Annotations.get(i).get(j).add(locations.get(k) + "\tGeneID:" + GNormPlus.GeneIDs_hash.get(mention)); //paragraph
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/GNormPluslib/SR.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ public void SpeciesAssignment(String Filename,String FilenameBioC) throws IOExce
// When we only reset the annotations, GN#GeneIDRecognition fails because the PMIDs are added anyway
// and then there are more PMIDs than annotations.
// data.getBioCDocobj().Annotations = new ArrayList();
// data.getBioCDocobj().PMIDs = new ArrayList();
data.resetBioCDocobj();
data.getBioCDocobj().BioCReaderWithAnnotation(Filename);

Expand Down

0 comments on commit a3ae317

Please sign in to comment.