use of org.nextprot.api.core.domain.PeptideUnicity in project nextprot-api by calipho-sib.
the class PeptideMappingServiceImpl method attachPeptidePropertiesToAnnotations.
static void attachPeptidePropertiesToAnnotations(List<Annotation> annotations, Map<String, PeptideUnicity> pepNamePuMap) {
for (Annotation annot : annotations) {
String pepName = getMappingAnnotationPeptideName(annot);
PeptideUnicity pu = pepNamePuMap.get(pepName);
String proteotypicValue = pu.getValue().equals(PeptideUnicity.Value.NOT_UNIQUE) ? "N" : "Y";
String unicityValue = pu.getValue().name();
annot.addProperty(createAnnotationProperty(annot.getAnnotationId(), pepName, PropertyApiModel.NAME_PEPTIDE_PROTEOTYPICITY, proteotypicValue));
annot.addProperty(createAnnotationProperty(annot.getAnnotationId(), pepName, PropertyApiModel.NAME_PEPTIDE_UNICITY, unicityValue));
}
}
use of org.nextprot.api.core.domain.PeptideUnicity in project nextprot-api by calipho-sib.
the class PepXServiceImpl method updateAnnotationsWithPeptideProperties.
private void updateAnnotationsWithPeptideProperties(List<Entry> entries) {
// peptide unicity over wildtype isoforms
Map<String, PeptideUnicity> puMap = computePeptideUnicityStatus(entries, false);
// peptide unicity over variant isoforms
Map<String, PeptideUnicity> puVarMap = computePeptideUnicityStatus(entries, true);
entries.forEach(e -> {
e.getAnnotations().forEach(a -> {
String pep = a.getCvTermName();
PeptideUnicity pu = puMap.get(pep);
if (pu != null) {
// store peptide proteotypicity (Y/N) & unicity (UNIQUE,PSEUDO_UNIQUE,NON_UNIQUE) over wildtype isoforms
String proteotypicValue = pu.getValue().equals(PeptideUnicity.Value.NOT_UNIQUE) ? "N" : "Y";
a.addProperty(buildAnnotationProperty(PropertyApiModel.NAME_PEPTIDE_PROTEOTYPICITY, proteotypicValue));
a.addProperty(buildAnnotationProperty(PropertyApiModel.NAME_PEPTIDE_UNICITY, pu.getValue().name()));
// store the set of equivalent isoforms (if any) matched by the peptide
if (pu.getEquivalentIsoforms() != null && pu.getEquivalentIsoforms().size() > 0) {
a.setSynonyms(new ArrayList<String>(pu.getEquivalentIsoforms()));
}
}
PeptideUnicity puVar = puVarMap.get(pep);
if (puVar != null) {
// store peptide unicity over variant isoforms
a.addProperty(buildAnnotationProperty(PropertyApiModel.NAME_PEPTIDE_UNICITY_WITH_VARIANTS, puVar.getValue().name()));
}
});
});
}
Aggregations