Search in sources :

Example 1 with Organism

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;
}
Also used : Organism(gov.nih.nci.ctd2.dashboard.model.Organism)

Example 2 with Organism

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;
}
Also used : Xref(gov.nih.nci.ctd2.dashboard.model.Xref) Organism(gov.nih.nci.ctd2.dashboard.model.Organism) Gene(gov.nih.nci.ctd2.dashboard.model.Gene) Synonym(gov.nih.nci.ctd2.dashboard.model.Synonym) GeneType(gov.nih.nci.ctd2.dashboard.model.GeneType)

Example 3 with Organism

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;
}
Also used : Organism(gov.nih.nci.ctd2.dashboard.model.Organism)

Example 4 with Organism

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;
}
Also used : Organism(gov.nih.nci.ctd2.dashboard.model.Organism) CellSample(gov.nih.nci.ctd2.dashboard.model.CellSample) Annotation(gov.nih.nci.ctd2.dashboard.model.Annotation)

Example 5 with Organism

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;
}
Also used : Transcript(gov.nih.nci.ctd2.dashboard.model.Transcript) ShRna(gov.nih.nci.ctd2.dashboard.model.ShRna) Organism(gov.nih.nci.ctd2.dashboard.model.Organism) Synonym(gov.nih.nci.ctd2.dashboard.model.Synonym)

Aggregations

Organism (gov.nih.nci.ctd2.dashboard.model.Organism)9 Synonym (gov.nih.nci.ctd2.dashboard.model.Synonym)4 Transcript (gov.nih.nci.ctd2.dashboard.model.Transcript)4 Xref (gov.nih.nci.ctd2.dashboard.model.Xref)4 Gene (gov.nih.nci.ctd2.dashboard.model.Gene)3 ShRna (gov.nih.nci.ctd2.dashboard.model.ShRna)3 Annotation (gov.nih.nci.ctd2.dashboard.model.Annotation)2 CellSample (gov.nih.nci.ctd2.dashboard.model.CellSample)2 Protein (gov.nih.nci.ctd2.dashboard.model.Protein)2 DashboardDao (gov.nih.nci.ctd2.dashboard.dao.DashboardDao)1 SampleImporter (gov.nih.nci.ctd2.dashboard.importer.internal.SampleImporter)1 AnimalModel (gov.nih.nci.ctd2.dashboard.model.AnimalModel)1 Compound (gov.nih.nci.ctd2.dashboard.model.Compound)1 GeneType (gov.nih.nci.ctd2.dashboard.model.GeneType)1 ObservationTemplate (gov.nih.nci.ctd2.dashboard.model.ObservationTemplate)1 Subject (gov.nih.nci.ctd2.dashboard.model.Subject)1 TissueSample (gov.nih.nci.ctd2.dashboard.model.TissueSample)1 APIDataBuilder (gov.nih.nci.ctd2.dashboard.util.APIDataBuilder)1 OverallSummary (gov.nih.nci.ctd2.dashboard.util.OverallSummary)1 SubjectScorer (gov.nih.nci.ctd2.dashboard.util.SubjectScorer)1