-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more efficient indexation added beginning of extended annotation of molecules
- Loading branch information
Showing
21 changed files
with
1,154 additions
and
54 deletions.
There are no files selected for viewing
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
95 changes: 95 additions & 0 deletions
95
src/main/java/de/unijena/cheminf/npopensourcecollector/misc/DatabaseTypeChecker.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package de.unijena.cheminf.npopensourcecollector.misc; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
|
||
|
||
@Service | ||
public class DatabaseTypeChecker { | ||
|
||
|
||
|
||
|
||
private final String[] africa = {"afrodb", "afrocancer", "afromalariadb", "afrotryp", "conmednp", "etm", "mitishamba", "nanpdb", "p-anapl", "sancdb"}; | ||
private final String[] china = {"him", "hit", "tcmdb_taiwan", "tcmid", "tipdb"}; | ||
private final String[] india = {"imppat", "inpacdb"}; | ||
private final String[] europe = {"tppt"}; | ||
private final String[] america = {"nubbedb", "uefs", "biofacquim"}; | ||
|
||
private final HashSet<String> continentAfrica = new HashSet<String>(Arrays.asList(africa)); | ||
private final HashSet<String> continentIndia = new HashSet<String>(Arrays.asList(india)); | ||
private final HashSet<String> continentChina = new HashSet<String>(Arrays.asList(china)); | ||
private final HashSet<String> continentEurope = new HashSet<String>(Arrays.asList(europe)); | ||
private final HashSet<String> continentAmerica = new HashSet<String>(Arrays.asList(america)); | ||
|
||
|
||
|
||
private final String[] plants = {"uefs","tppt","tmdb","tipdb","tcmid", "tcmdb_taiwan","spektraris","sancdb", | ||
"respect","p-anapl", "npact","nanpdb","mitishamba","inpacdb","imppat", "hit","him","etm","conmednp", | ||
"afrotryp", "afromalariadb","afrocancer","afrodb"}; | ||
private final String[] bacteria = {"streptomedb"}; | ||
private final String[] fungi = {"lichendatabase"}; | ||
private final String[] animals = {}; | ||
private final String[] marine = {}; | ||
private final String[] mixed = {"nubbedb","npcare","npatlas","npass","analyticon_all_np", "biofacquim"}; | ||
|
||
private final HashSet<String> taxPlants = new HashSet<String>(Arrays.asList(plants)); | ||
private final HashSet<String> taxBacteria = new HashSet<String>(Arrays.asList(bacteria)); | ||
private final HashSet<String> taxFungi = new HashSet<String>(Arrays.asList(fungi)); | ||
private final HashSet<String> taxAnimals = new HashSet<String>(Arrays.asList(animals)); | ||
private final HashSet<String> taxMarine = new HashSet<String>(Arrays.asList(marine)); | ||
private final HashSet<String> taxMixed = new HashSet<String>(Arrays.asList(mixed)); | ||
|
||
|
||
public String checkContinent(String sourceDB){ | ||
|
||
if(continentAfrica.contains(sourceDB)){ | ||
return "africa"; | ||
} | ||
else if(continentChina.contains(sourceDB)){ | ||
return "china"; | ||
} | ||
else if(continentIndia.contains(sourceDB)){ | ||
return "india"; | ||
} | ||
else if(continentEurope.contains(sourceDB)){ | ||
return "europe"; | ||
} | ||
else if(continentAmerica.contains(sourceDB)){ | ||
return "southamerica"; | ||
} | ||
else { | ||
return "nogeo"; | ||
} | ||
} | ||
|
||
|
||
public String checkKingdom(String sourceDB){ | ||
if(taxPlants.contains(sourceDB)){ | ||
return "plants"; | ||
} | ||
else if(taxBacteria.contains(sourceDB)){ | ||
return "bacteria"; | ||
} | ||
else if(taxAnimals.contains(sourceDB)){ | ||
return "animals"; | ||
} | ||
else if(taxFungi.contains(sourceDB)){ | ||
return "fungi"; | ||
} | ||
else if(taxMarine.contains(sourceDB)){ | ||
return "marine"; | ||
} | ||
else if(taxMixed.contains(sourceDB)){ | ||
return "mixed"; | ||
} | ||
else{ | ||
return "notax"; | ||
} | ||
|
||
} | ||
|
||
|
||
} |
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
66 changes: 66 additions & 0 deletions
66
src/main/java/de/unijena/cheminf/npopensourcecollector/mongocollections/NPDatabase.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package de.unijena.cheminf.npopensourcecollector.mongocollections; | ||
|
||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
@Document | ||
public class NPDatabase { | ||
|
||
@Id | ||
public String id; | ||
|
||
String name; | ||
|
||
String localFileName; | ||
|
||
String url; | ||
|
||
String comments; | ||
|
||
Integer nb_unique_molecules; | ||
|
||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public String getComments() { | ||
return comments; | ||
} | ||
|
||
public void setComments(String comments) { | ||
this.comments = comments; | ||
} | ||
|
||
public Integer getNb_unique_molecules() { | ||
return nb_unique_molecules; | ||
} | ||
|
||
public void setNb_unique_molecules(Integer nb_unique_molecules) { | ||
this.nb_unique_molecules = nb_unique_molecules; | ||
} | ||
|
||
public String getLocalFileName() { | ||
return localFileName; | ||
} | ||
|
||
public void setLocalFileName(String localFileName) { | ||
this.localFileName = localFileName; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
.../java/de/unijena/cheminf/npopensourcecollector/mongocollections/NPDatabaseRepository.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package de.unijena.cheminf.npopensourcecollector.mongocollections; | ||
|
||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
|
||
public interface NPDatabaseRepository extends MongoRepository<NPDatabase, String> { | ||
} |
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
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
Oops, something went wrong.