Last active
February 22, 2020 19:36
-
-
Save codekaust/c62e011936b155d5808b673d313c7622 to your computer and use it in GitHub Desktop.
Do not delete.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String getGeneProductBiGGIdFromUriList(List<String> list_Uri) { | |
String biggId = null; | |
for(String uri : list_Uri){ | |
String dataSource, synonym_id, currentBiGGId; //currentBiGGId is id calculated in current iteration | |
synonym_id = uri.substring(uri.lastIndexOf('/')+1); | |
uri = uri.substring(0,uri.lastIndexOf('/')); | |
dataSource = uri.substring(uri.lastIndexOf('/')+1); | |
//updating the dataSource and synonym_id to match bigg database | |
switch (dataSource){ | |
case "ncbigi": | |
synonym_id = synonym_id.substring(3); | |
break; | |
case "ncbigene" : break; | |
case "goa" : break; | |
case "interpro" : break; | |
case "asap" : break; | |
case "ecogene" : break; | |
case "uniprot" : break; | |
default: | |
return null; //the dataSource must belong one of above | |
} | |
currentBiGGId = bigg.getBiggIdFromSynonym(dataSource,synonym_id,BiGGDB.TYPE_GENE_PRODUCT); | |
if(biggId==null){ | |
biggId = currentBiGGId; | |
}else { | |
//we must get same biggId from each synonym | |
if(!currentBiGGId.equals(biggId)) | |
return null; | |
} | |
} | |
return biggId == null ? null : "G_"+biggId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment