use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class StatementTranformerServiceImpl method getIsoAccession.
private String getIsoAccession(String featureName, String entryAccession) {
SequenceVariant sv;
try {
sv = new SequenceVariant(featureName);
} catch (ParseException e) {
throw new NextProtException(e);
}
List<Isoform> isoforms = isoformService.findIsoformsByEntryName(entryAccession);
Isoform isoSpecific = IsoformUtils.getIsoformByName(isoforms, sv.getIsoformName());
return isoSpecific.getIsoformAccession();
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class PeptideMappingServiceIntegrationTest method shouldComputeHTML4Highlight.
@Ignore
@Test
public void shouldComputeHTML4Highlight() throws FileNotFoundException {
// List<String>entryNames = Arrays.asList(new String[]{"NX_Q8IYL9", "NX_Q66K66", "NX_P01308"});
// List<String>entryNames = miService.findUniqueNamesOfChromosome("Y");
// liste Monique
List<String> entryNames = Arrays.asList(new String[] { "NX_Q6UWW9", "NX_Q04118", "NX_P48165", "NX_P01308", "NX_Q13557" });
StringBuilder sb = new StringBuilder();
sb.append("<html><body>\n");
sb.append("<ul>");
// sb.append("<span style=\"color:" + chunk.code + "\">");
sb.append("<li style=\"color:" + COLOR_NOT_COVERED + "\">" + COLOR_NOT_COVERED + ": no peptide</li>");
sb.append("<li style=\"color:" + COLOR_PEP_COVERED + "\">" + COLOR_PEP_COVERED + ": peptide</li>");
sb.append("<li style=\"color:" + COLOR_1_TYPIC_COVERED + "\">" + COLOR_1_TYPIC_COVERED + ": single proteotypic</li>");
sb.append("<li style=\"color:" + COLOR_N_TYPIC_COVERED + "\">" + COLOR_N_TYPIC_COVERED + ": multiple proteotypic</li>");
sb.append("</ul>");
for (String entryName : entryNames) {
List<Annotation> annotations = this.pmService.findNaturalPeptideMappingAnnotationsByMasterUniqueName(entryName);
List<Isoform> isoforms = isoService.findIsoformsByEntryName(entryName);
for (Isoform iso : isoforms) {
String cpep = computeCoverage(iso, annotations, false, false);
String ctyp = computeCoverage(iso, annotations, true, false);
String html = getHighlightHTML(iso, annotations, cpep, ctyp);
sb.append(html);
}
}
sb.append("</body></html>\n");
String filename = "./highlight-coverage-peptide-chromosome-y.html";
PrintWriter out = new PrintWriter(filename);
out.print(sb.toString());
out.close();
System.out.println("Wrote result in file " + filename);
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class ByIsoformPositionComparatorTest method mockIsoform.
private static Isoform mockIsoform(boolean isCanonical) {
Isoform isoform = Mockito.mock(Isoform.class);
when(isoform.isCanonicalIsoform()).thenReturn(isCanonical);
return isoform;
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class DbXrefServiceImpl method newAnnotationIsoformSpecificityList.
// build isoform specificity from isoforms and annotations and link them to annotations
private List<AnnotationIsoformSpecificity> newAnnotationIsoformSpecificityList(List<Isoform> isoforms, Annotation xrefAnnotation) {
List<AnnotationIsoformSpecificity> isospecs = new ArrayList<>();
for (Isoform iso : isoforms) {
AnnotationIsoformSpecificity isospec = new AnnotationIsoformSpecificity();
isospec.setAnnotationId(xrefAnnotation.getAnnotationId());
// According to PAM on Tuesday th 16th in the presence of Pascale and Frederic Nikitin
isospec.setFirstPosition(null);
isospec.setLastPosition(null);
isospec.setIsoformAccession(iso.getIsoformAccession());
isospec.setSpecificity("UNKNOWN");
isospecs.add(isospec);
}
return isospecs;
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class DbXrefServiceImpl method convertXrefsIntoAnnotations.
private List<Annotation> convertXrefsIntoAnnotations(List<DbXref> xrefs, String entryName) {
List<Isoform> isoforms = isoService.findIsoformsByEntryName(entryName);
List<Annotation> xrefAnnotations = new ArrayList<>();
for (DbXref xref : xrefs) {
xrefAnnotations.add(convertXrefIntoAnnotation(xref, entryName, isoforms));
}
return xrefAnnotations;
}
Aggregations