use of org.nextprot.api.core.domain.EntryReport in project nextprot-api by calipho-sib.
the class ChromosomeReportTXTWriterTest method writeChromosomeReport.
@Test
public void writeChromosomeReport() throws Exception {
ChromosomeReport report = new ChromosomeReport();
report.setDataRelease("2017-01-23");
ChromosomeReport.Summary summary = new ChromosomeReport.Summary();
summary.setChromosome("Y");
summary.setEntryReportCount(58);
summary.setEntryCount(48);
report.setSummary(summary);
EntryReport entryReport1 = newEntryReport("SRY", "NX_Q05066", "Yp11.2", "2786855", "2787699", ProteinExistence.PROTEIN_LEVEL, false, true, true, true, 1, 47, 1, "Sex-determining region Y protein");
EntryReport entryReport2 = newEntryReport("RBMY1C", "NX_P0DJD4", "Yq11.23", "-", "-", ProteinExistence.PROTEIN_LEVEL, false, true, false, false, 1, 0, 0, "RNA-binding motif protein, Y chromosome, family 1 member C");
EntryReport entryReport3 = newEntryReport("MFSD14A", "NX_Q96MC6", "1p21.2", "100038097", "100083377", ProteinExistence.PROTEIN_LEVEL, false, false, false, false, 1, 141, 3, "Hippocampus abundant transcript 1 protein");
report.setEntryReports(Arrays.asList(entryReport1, entryReport2, entryReport3));
StringOutputStream sos = new StringOutputStream();
ChromosomeReportWriter writer = new ChromosomeReportTXTWriter(sos);
writer.write(report);
String[] observedLines = sos.toString().split("\\n");
Assert.assertEquals(28, observedLines.length);
Assert.assertEquals("Gene neXtProt Chromosomal Start Stop Coding Protein Prote- Anti- 3D Dise- Iso- Vari- PTMs Description", observedLines[16]);
Assert.assertEquals("name AC location position position strand existence omics body ase forms ants ", observedLines[17]);
Assert.assertEquals("SRY NX_Q05066 Yp11.2 2786855 2787699 reverse protein level no yes yes yes 1 47 1 Sex-determining region Y protein", observedLines[19]);
Assert.assertEquals("RBMY1C NX_P0DJD4 Yq11.23 - - reverse protein level no yes no no 1 0 0 RNA-binding motif protein, Y chromosome, family 1 member C", observedLines[20]);
Assert.assertEquals("MFSD14A NX_Q96MC6 1p21.2 100038097 100083377 reverse protein level no no no no 1 141 3 Hippocampus abundant transcript 1 protein", observedLines[21]);
}
use of org.nextprot.api.core.domain.EntryReport in project nextprot-api by calipho-sib.
the class HPPChromosomeReportTSVWriterTest method writeChromosomeReport.
@Test
public void writeChromosomeReport() throws Exception {
ChromosomeReport report = new ChromosomeReport();
report.setDataRelease("2017-01-23");
ChromosomeReport.Summary summary = new ChromosomeReport.Summary();
summary.setChromosome("Y");
summary.setEntryReportCount(58);
summary.setEntryCount(48);
report.setSummary(summary);
EntryReport entryReport1 = newEntryReport("SRY", "NX_Q05066", "Yp11.2", "2786855", "2787699", ProteinExistence.UNCERTAIN, false, true, true, true, 1, 47, 1, "Sex-determining region Y protein");
EntryReport entryReport2 = newEntryReport("RBMY1C", "NX_P0DJD4", "Yq11.23", "-", "-", ProteinExistence.PROTEIN_LEVEL, false, true, false, false, 1, 0, 0, "RNA-binding motif protein, Y chromosome, family 1 member C");
EntryReport entryReport3 = newEntryReport("MFSD14A", "NX_Q96MC6", "1p21.2", "100038097", "100083377", ProteinExistence.PROTEIN_LEVEL, false, false, false, false, 1, 141, 3, "Hippocampus abundant transcript 1 protein");
EntryReport entryReport4 = newEntryReport("VCY", "NX_O14598", "Yq11.221", "13985772", "13986513", ProteinExistence.PROTEIN_LEVEL, true, true, false, false, 1, 4, 0, "Testis-specific basic protein Y 1");
EntryReport entryReport5 = newEntryReport("VCY", "NX_O14598", "Yq11.221", "14056217", "14056958", ProteinExistence.PROTEIN_LEVEL, true, true, false, false, 1, 4, 0, "Testis-specific basic protein Y 1");
report.setEntryReports(Arrays.asList(entryReport1, entryReport2, entryReport3, entryReport4, entryReport5));
StringOutputStream sos = new StringOutputStream();
HPPChromosomeReportWriter writer = new HPPChromosomeReportTSVWriter(sos, overviewService);
writer.write(report);
String[] observedLines = sos.toString().split("\\n");
Assert.assertEquals(5, observedLines.length);
Assert.assertEquals("neXtProt AC\tGene name(s)\tProtein existence\tProteomics\tAntibody", observedLines[0]);
Assert.assertEquals("NX_O14598\tVCY;VCY1B\tEvidence at protein level\tyes\tyes", observedLines[1]);
Assert.assertEquals("NX_P0DJD4\tRBMY1C\tEvidence at protein level\tno\tyes", observedLines[2]);
Assert.assertEquals("NX_Q05066\tSRY\tUncertain\tno\tyes", observedLines[3]);
Assert.assertEquals("NX_Q96MC6\tMFSD14A\tEvidence at protein level\tno\tno", observedLines[4]);
}
use of org.nextprot.api.core.domain.EntryReport in project nextprot-api by calipho-sib.
the class EntryGeneReportServiceImpl method reportEntry.
@Cacheable("entry-reports")
@Override
public List<EntryReport> reportEntry(String entryAccession) {
EntryReportStats ers = entryReportStatsService.reportEntryStats(entryAccession);
EntryReport report = new EntryReport();
report.setAccession(entryAccession);
report.setDescription(ers.getDescription());
report.setProteinExistence(ers.getProteinExistence());
report.setPropertyTest(EntryReport.IS_PROTEOMICS, ers.isProteomics());
report.setPropertyTest(EntryReport.IS_ANTIBODY, ers.isAntibody());
report.setPropertyTest(EntryReport.IS_3D, ers.is3D());
report.setPropertyTest(EntryReport.IS_DISEASE, ers.isDisease());
report.setPropertyCount(EntryReport.ISOFORM_COUNT, ers.countIsoforms());
report.setPropertyCount(EntryReport.VARIANT_COUNT, ers.countVariants());
report.setPropertyCount(EntryReport.PTM_COUNT, ers.countPTMs());
report.setPropertyCount(EntryReport.CURATED_PUBLICATION_COUNT, ers.countCuratedPublications());
report.setPropertyCount(EntryReport.ADDITIONAL_PUBLICATION_COUNT, ers.countAdditionalPublications());
report.setPropertyCount(EntryReport.PATENT_COUNT, ers.countPatents());
report.setPropertyCount(EntryReport.SUBMISSION_COUNT, ers.countSubmissions());
report.setPropertyCount(EntryReport.WEB_RESOURCE_COUNT, ers.countWebResources());
return duplicateReportForEachGene(entryAccession, report);
}
use of org.nextprot.api.core.domain.EntryReport in project nextprot-api by calipho-sib.
the class EntryReportTest method newEntryReport.
public static EntryReport newEntryReport(String geneName, String ac, String chromosalPosition, String startPos, String stopPos, ProteinExistence protExistence, boolean isProteomics, boolean isAntibody, boolean is3D, boolean isDisease, int isoformCount, int variantCount, int ptmCount, String description) throws ParseException {
EntryReport entryReport = new EntryReport();
ChromosomalLocation cl = ChromosomalLocation.fromString(chromosalPosition);
cl.setRecommendedName(geneName);
cl.setFirstPosition((startPos.equals("-")) ? 0 : Integer.parseInt(startPos));
cl.setLastPosition((stopPos.equals("-")) ? 0 : Integer.parseInt(stopPos));
entryReport.setAccession(ac);
entryReport.setChromosomalLocation(cl);
entryReport.setProteinExistence(protExistence);
entryReport.setPropertyTest(EntryReport.IS_PROTEOMICS, isProteomics);
entryReport.setPropertyTest(EntryReport.IS_ANTIBODY, isAntibody);
entryReport.setPropertyTest(EntryReport.IS_3D, is3D);
entryReport.setPropertyTest(EntryReport.IS_DISEASE, isDisease);
entryReport.setPropertyCount(EntryReport.ISOFORM_COUNT, isoformCount);
entryReport.setPropertyCount(EntryReport.VARIANT_COUNT, variantCount);
entryReport.setPropertyCount(EntryReport.PTM_COUNT, ptmCount);
entryReport.setDescription(description);
return entryReport;
}
use of org.nextprot.api.core.domain.EntryReport in project nextprot-api by calipho-sib.
the class ChromosomeReportTSVWriter method writeChromosomeReport.
@Override
protected void writeChromosomeReport(ChromosomeReport report) throws IOException {
writer.write(extractHeaders().stream().collect(Collectors.joining("\t")));
writer.write("\n");
for (EntryReport er : report.getEntryReports()) {
writeEntryReport(extractValues(er));
}
}
Aggregations