Skip to content

Commit 8e42b9b

Browse files
committed
Change format of Ontology in MSP_RIKEN
1 parent a3ebd24 commit 8e42b9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MassBank-Project/MassBank-lib/src/main/java/massbank/export/RecordToRIKEN_MSP.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ public static String convert(massbank.Record record) {
8383
sb.append("PRECURSORTYPE: ").append((MS_FOCUSED_ION.getOrDefault("PRECURSOR_TYPE", "NA"))).append(System.lineSeparator());
8484
sb.append("FORMULA: ").append(record.CH_FORMULA()).append(System.lineSeparator());
8585
if (record.CH_LINK().containsKey("ChemOnt")) {
86-
sb.append("Ontology: ").append(record.CH_LINK().get("ChemOnt")).append(System.lineSeparator());
86+
String chemOntValue = record.CH_LINK().get("ChemOnt");
87+
String lastTerm = chemOntValue.substring(chemOntValue.lastIndexOf(";") + 1).trim();
88+
sb.append("Ontology: ").append(lastTerm).append(System.lineSeparator());
8789
}
8890
sb.append("INCHIKEY: ").append(record.CH_LINK().getOrDefault("INCHIKEY", "N/A")).append(System.lineSeparator());
8991
sb.append("INCHI: ").append(record.CH_IUPAC()).append(System.lineSeparator());

0 commit comments

Comments
 (0)