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;
}
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));
}
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;
}
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;
}
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));
}
Aggregations