diff --git a/meta-data-action-1.1.2-jar-with-dependencies.jar b/meta-data-action-1.1.2-jar-with-dependencies.jar index 4459819..c13d3ef 100644 Binary files a/meta-data-action-1.1.2-jar-with-dependencies.jar and b/meta-data-action-1.1.2-jar-with-dependencies.jar differ diff --git a/meta-data-action-1.1.2.jar b/meta-data-action-1.1.2.jar index 4353473..f2b2e58 100644 Binary files a/meta-data-action-1.1.2.jar and b/meta-data-action-1.1.2.jar differ diff --git a/meta.data.action/src/main/java/meta/data/action/MetaDataExtractor.java b/meta.data.action/src/main/java/meta/data/action/MetaDataExtractor.java index 1464ac1..0d30920 100644 --- a/meta.data.action/src/main/java/meta/data/action/MetaDataExtractor.java +++ b/meta.data.action/src/main/java/meta/data/action/MetaDataExtractor.java @@ -175,7 +175,7 @@ private static void printPathwayInfo(String pId, String revision, List a private static void printNodeList(String pId, PathwayModel p) throws IOException, ClassNotFoundException, IDMapperException { File file = new File(folder, pId + "-datanodes.tsv"); BufferedWriter w = new BufferedWriter(new FileWriter(file)); - w.write("Label\tType\tIdentifier\tComment\tEnsembl\tNCBI gene\tHGNC\tUniProt\tWikidata\tChEBI\tInChI\n"); + w.write("Label\tType\tIdentifier\tComment\tEnsembl\tNCBI gene\tHGNC\tUniProt\tWikidata\tChEBI\tInChI\tPubChem\tChemSpider\tHMDB\tKEGG\tLipidMapd\n"); ArrayList elementTypes = new ArrayList(Arrays.asList("Metabolite", "GeneProduct", "Protein")); // create idmapper stack using gdb.config file @@ -213,12 +213,14 @@ private static void printNodeList(String pId, PathwayModel p) throws IOException private static String getIDMappingsString(DataNode e, String pId, PathwayModel p, IDMapperStack idmpStack) throws ClassNotFoundException, IOException, IDMapperException { // perform ID Mapping for Ensembl, NCBI gene, HGNC, UniProt, Wikidata, ChEBI, InChI //DataSourceTxt.init(); - ArrayList dataSourceList = new ArrayList(Arrays.asList("En", "L", "H", "S", "Wd", "Ce","Ik")); + ArrayList dataSourceList = new ArrayList(Arrays.asList("En", "L", "H", "S", "Wd", "Ce","Ik", "Cpc", "Cs", "Ch", "Ck", "Lm")); String result = ""; // For each data source in the header, mapID and append the result to the string. for (String sysCode : dataSourceList) { - Set stackResult = idmpStack.mapID(e.getXref(), DataSource.getExistingBySystemCode(sysCode)); + Set stackResult = cleaner( + idmpStack.mapID(e.getXref(), DataSource.getExistingBySystemCode(sysCode)) + ); // Check if more than one Xref was returned. If yes, then append them using semicolon. String stackStr = ""; for (Xref ref : stackResult) { @@ -242,6 +244,16 @@ private static String getIDMappingsString(DataNode e, String pId, PathwayModel p return result; } + private static Set cleaner(Set stackResult) { + Set cleaner = new HashSet<>(); + for (Xref ref : stackResult) { + String id = ref.getId(); + if (id.startsWith("CHEBI:")) id = id.replace("CHEBI:", ""); + cleaner.add(new Xref(id, ref.getDataSource())); + } + return cleaner; + } + private static void printRefList(String pId, PathwayModel p) throws IOException { File file = new File(folder, pId + "-refs.tsv"); BufferedWriter w = new BufferedWriter(new FileWriter(file));