use of gov.nih.nci.ctd2.dashboard.model.Organism in project nci-ctd2-dashboard by CBIIT.
the class UniProtDataReader method findOrganism.
private Organism findOrganism() {
Organism toReturn = null;
if (taxonomyId.length() > 0) {
toReturn = organismsCache.get(taxonomyId);
if (toReturn == null) {
List<Organism> organisms = dashboardDao.findOrganismByTaxonomyId(taxonomyId);
if (organisms.size() == 1) {
toReturn = organisms.get(0);
organismsCache.put(taxonomyId, toReturn);
}
}
}
return toReturn;
}
use of gov.nih.nci.ctd2.dashboard.model.Organism in project nci-ctd2-dashboard by CBIIT.
the class GeneDataFieldSetMapper method mapFieldSet.
public Gene mapFieldSet(FieldSet fieldSet) throws BindException {
Gene gene = dashboardFactory.create(Gene.class);
String entrezGeneId = fieldSet.readString(1);
gene.setEntrezGeneId(entrezGeneId);
gene.setDisplayName(fieldSet.readString(2));
// create synonym back to self
Synonym synonym = dashboardFactory.create(Synonym.class);
synonym.setDisplayName(fieldSet.readString(2));
gene.getSynonyms().add(synonym);
// create xref back to ncbi
Xref xref = dashboardFactory.create(Xref.class);
xref.setDatabaseId(entrezGeneId);
xref.setDatabaseName(NCBI_GENE_DATABASE);
gene.getXrefs().add(xref);
for (String synonymName : fieldSet.readString(4).split("\\|")) {
synonym = dashboardFactory.create(Synonym.class);
synonym.setDisplayName(synonymName);
gene.getSynonyms().add(synonym);
}
for (String synonymName : fieldSet.readString(13).split("\\|")) {
synonym = dashboardFactory.create(Synonym.class);
synonym.setDisplayName(synonymName);
gene.getSynonyms().add(synonym);
}
// hgnc parsing
for (String dbXrefs : fieldSet.readString(5).split("\\|")) {
String[] parts = dbXrefs.split("\\:");
if (parts[0].equals("HGNC")) {
gene.setHGNCId(parts[1]);
break;
}
}
// set organism
String taxonomyId = fieldSet.readString(0);
Organism organism = organismMap.get(taxonomyId);
if (organism == null) {
List<Organism> organisms = dashboardDao.findOrganismByTaxonomyId(taxonomyId);
if (organisms.size() == 1)
organism = organisms.get(0);
organismMap.put(taxonomyId, organism);
}
if (organism != null)
gene.setOrganism(organism);
String map_location = fieldSet.readString(7);
gene.setMapLocation(map_location);
String description = fieldSet.readString(8);
gene.setFullName(description);
String type_of_gene = fieldSet.readString(9);
GeneType geneType = geneTypeMap.get(type_of_gene);
if (geneType == null) {
geneType = dashboardFactory.create(GeneType.class);
geneType.setDisplayName(type_of_gene);
geneTypeMap.put(type_of_gene, geneType);
dashboardDao.save(geneType);
}
gene.setGeneType(geneType);
return gene;
}
use of gov.nih.nci.ctd2.dashboard.model.Organism in project nci-ctd2-dashboard by CBIIT.
the class CellLineSampleFieldSetMapper method getOrganism.
private Organism getOrganism(String taxonomyId) {
Organism toReturn = null;
toReturn = organismsCache.get(taxonomyId);
if (toReturn == null) {
List<Organism> organisms = dashboardDao.findOrganismByTaxonomyId(taxonomyId);
if (organisms.size() == 1) {
toReturn = organisms.get(0);
organismsCache.put(taxonomyId, toReturn);
}
}
return toReturn;
}
use of gov.nih.nci.ctd2.dashboard.model.Organism in project nci-ctd2-dashboard by CBIIT.
the class CellLineSampleFieldSetMapper method mapFieldSet.
public CellSample mapFieldSet(FieldSet fieldSet) throws BindException {
String cellSampleId = fieldSet.readString(CELL_SAMPLE_ID);
String taxonomyId = fieldSet.readString(TAXONOMY_ID);
String gender = fieldSet.readString(GENDER);
CellSample cellSample = dashboardFactory.create(CellSample.class);
// display name will be set in next step
Organism organism = getOrganism(taxonomyId);
if (organism != null)
cellSample.setOrganism(organism);
if (gender != null && gender.length() > 0)
cellSample.setGender(gender);
if (cellLineAnnotationSampleMap.containsKey(cellSampleId)) {
cellSample.setAnnotations(cellLineAnnotationSampleMap.get(cellSampleId));
} else {
cellSample.setAnnotations(new HashSet<Annotation>());
}
// optimization - avoid persisting CellSamples
// - place in map and pass to cellLineNameStep
cellSampleMap.put(cellSampleId, cellSample);
return cellSample;
}
use of gov.nih.nci.ctd2.dashboard.model.Organism in project nci-ctd2-dashboard by CBIIT.
the class siRNADataFieldSetMapper method mapFieldSet.
public ShRna mapFieldSet(FieldSet fieldSet) throws BindException {
ShRna shRNA = dashboardFactory.create(ShRna.class);
shRNA.setType("sirna");
shRNA.setDisplayName(fieldSet.readString(REAGENT_NAME_COL_INDEX));
shRNA.setReagentName(shRNA.getDisplayName());
// create synonym back to self
Synonym synonym = dashboardFactory.create(Synonym.class);
synonym.setDisplayName(fieldSet.readString(REAGENT_NAME_COL_INDEX));
shRNA.getSynonyms().add(synonym);
// set target seq
shRNA.setTargetSequence(fieldSet.readString(TARGET_SEQ_COL_INDEX));
// set organism
if (fieldSet.readString(ORGANISM_COL_INDEX).equals("Homo sapiens")) {
Organism organism = organismMap.get("9606");
if (organism == null) {
List<Organism> organisms = dashboardDao.findOrganismByTaxonomyId("9606");
if (organisms.size() == 1)
organism = organisms.get(0);
organismMap.put("9606", organism);
}
if (organism != null)
shRNA.setOrganism(organism);
}
// set transcript
Transcript transcript = getTranscript(fieldSet.readString(TARGET_GENE_COL_INDEX), fieldSet.readString(TRANSCRIPT_ID_COL_INDEX));
if (transcript != null)
shRNA.setTranscript(transcript);
return shRNA;
}
Aggregations