Search in sources :

Example 1 with Transcript

use of gov.nih.nci.ctd2.dashboard.model.Transcript in project nci-ctd2-dashboard by CBIIT.

the class TRCshRNADataProcessor method process.

@Override
public ShRna process(ShRna shRNA) throws Exception {
    if (shRNA == null)
        return null;
    if (shRNA.getOrganism() == null)
        return null;
    // allow null transcript relationship
    // if (shRNA.getTranscript() == null) return null;
    String stableURL = new StableURL().createURLWithPrefix("rna", shRNA.getTargetSequence());
    shRNA.setStableURL(stableURL);
    return shRNA;
}
Also used : StableURL(gov.nih.nci.ctd2.dashboard.util.StableURL)

Example 2 with Transcript

use of gov.nih.nci.ctd2.dashboard.model.Transcript in project nci-ctd2-dashboard by CBIIT.

the class UniProtDataReader method read.

public ProteinData read() throws Exception {
    recordFinished = false;
    while (!recordFinished) {
        process(fieldSetReader.read());
    }
    // this would happen on eof
    if (protein == null)
        return null;
    Protein proteinToReturn = protein;
    protein = null;
    return new ProteinData(proteinToReturn, new HashSet<Transcript>(transcriptsToReturn));
}
Also used : Transcript(gov.nih.nci.ctd2.dashboard.model.Transcript) Protein(gov.nih.nci.ctd2.dashboard.model.Protein)

Example 3 with Transcript

use of gov.nih.nci.ctd2.dashboard.model.Transcript 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)

Example 4 with Transcript

use of gov.nih.nci.ctd2.dashboard.model.Transcript in project nci-ctd2-dashboard by CBIIT.

the class TRCshRNADataFieldSetMapper method mapFieldSet.

public ShRna mapFieldSet(FieldSet fieldSet) throws BindException {
    ShRna shRNA = dashboardFactory.create(ShRna.class);
    shRNA.setType("shrna");
    // sanity check
    String cloneId = fieldSet.readString(CLONE_ID_COL_INDEX);
    if (cloneId.equalsIgnoreCase(MISSING_ENTRY))
        return shRNA;
    // only process records that exist in our map
    if (!tRCshRNAFilterMap.isEmpty() && !tRCshRNAFilterMap.containsKey(cloneId))
        return shRNA;
    shRNA.setDisplayName(fieldSet.readString(TARGET_SEQ_COL_INDEX));
    shRNA.setReagentName(cloneId);
    // create synonym back to self
    Synonym synonym = dashboardFactory.create(Synonym.class);
    synonym.setDisplayName(fieldSet.readString(CLONE_NAME_COL_INDEX));
    shRNA.getSynonyms().add(synonym);
    // create xref back to broad
    Xref xref = dashboardFactory.create(Xref.class);
    xref.setDatabaseId(cloneId);
    xref.setDatabaseName(BROAD_SHRNA_DATABASE);
    shRNA.getXrefs().add(xref);
    // set target seq
    shRNA.setTargetSequence(fieldSet.readString(TARGET_SEQ_COL_INDEX));
    // set organism
    String taxonomyId = fieldSet.readString(TAX_ID_COL_INDEX);
    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)
        shRNA.setOrganism(organism);
    // set transcript
    Transcript transcript = getTranscript(fieldSet.readString(TRANSCRIPT_ID_COL_INDEX));
    if (transcript != null) {
        shRNA.setTranscript(transcript);
    } else {
        transcript = getTranscript(fieldSet.readString(ALT_TRANSCRIPT_ID_COL_INDEX));
        if (transcript != null)
            shRNA.setTranscript(transcript);
        else {
            missingTranscriptCount++;
            log.debug("null transcript " + missingTranscriptCount + ": " + fieldSet.readString(TARGET_SEQ_COL_INDEX) + " [" + fieldSet.readString(TRANSCRIPT_ID_COL_INDEX) + "][" + fieldSet.readString(ALT_TRANSCRIPT_ID_COL_INDEX) + "]");
        }
    }
    return shRNA;
}
Also used : Transcript(gov.nih.nci.ctd2.dashboard.model.Transcript) ShRna(gov.nih.nci.ctd2.dashboard.model.ShRna) Xref(gov.nih.nci.ctd2.dashboard.model.Xref) Organism(gov.nih.nci.ctd2.dashboard.model.Organism) Synonym(gov.nih.nci.ctd2.dashboard.model.Synonym)

Example 5 with Transcript

use of gov.nih.nci.ctd2.dashboard.model.Transcript in project nci-ctd2-dashboard by CBIIT.

the class DashboardDaoImpl method findProteinByGene.

@Cacheable(value = "uniprotCache")
@Override
public List<Protein> findProteinByGene(Gene gene) {
    Set<Protein> proteins = new HashSet<Protein>();
    List<Transcript> transcriptList = queryWithClass("from TranscriptImpl where gene = :gene", "gene", gene);
    for (Transcript t : transcriptList) {
        List<Protein> list = queryWithClass("from ProteinImpl as p where :transcript member of p.transcripts", "transcript", t);
        for (Protein p : list) {
            proteins.add(p);
        }
    }
    return (new ArrayList<Protein>(proteins));
}
Also used : Transcript(gov.nih.nci.ctd2.dashboard.model.Transcript) Protein(gov.nih.nci.ctd2.dashboard.model.Protein) HashSet(java.util.HashSet) Cacheable(org.springframework.cache.annotation.Cacheable)

Aggregations

Transcript (gov.nih.nci.ctd2.dashboard.model.Transcript)9 Organism (gov.nih.nci.ctd2.dashboard.model.Organism)3 Protein (gov.nih.nci.ctd2.dashboard.model.Protein)3 ShRna (gov.nih.nci.ctd2.dashboard.model.ShRna)3 Gene (gov.nih.nci.ctd2.dashboard.model.Gene)2 Synonym (gov.nih.nci.ctd2.dashboard.model.Synonym)2 Xref (gov.nih.nci.ctd2.dashboard.model.Xref)2 NaturalOrderComparator (gov.nih.nci.ctd2.dashboard.util.NaturalOrderComparator)2 StableURL (gov.nih.nci.ctd2.dashboard.util.StableURL)2 DashboardDao (gov.nih.nci.ctd2.dashboard.dao.DashboardDao)1 AnimalModel (gov.nih.nci.ctd2.dashboard.model.AnimalModel)1 Annotation (gov.nih.nci.ctd2.dashboard.model.Annotation)1 CellSample (gov.nih.nci.ctd2.dashboard.model.CellSample)1 Compound (gov.nih.nci.ctd2.dashboard.model.Compound)1 DashboardEntity (gov.nih.nci.ctd2.dashboard.model.DashboardEntity)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 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1