/** * Create an instance of {@link Specificity } */ public Specificity createSpecificity() { return new Specificity(); }
public boolean isSpecificity(String specificity) { for (Specificity aSpecificity : this.specificity) { if (aSpecificity.getPosition().compareToIgnoreCase(specificity) == 0) return true; } return false; }
/** * Init the Map of the PTMs * @param unimodObject */ private void initPTMMap(Unimod unimodObject) { ptmMap = new HashMap<Comparable, PTM>(unimodObject.getModifications().getMod().size()); for(UnimodModification unimodMod: unimodObject.getModifications().getMod()){ /** * We will add the UNIMOD to the id in order to have the same style than PSI-MOD and * the mzIdentML files */ String accession = "UNIMOD:" + (unimodMod.getRecordId()).intValue(); String name = unimodMod.getTitle(); String description = unimodMod.getFullName(); String formula = (unimodMod.getDelta()!=null)?unimodMod.getDelta().getComposition():null; Double avgMass = (unimodMod.getDelta()!=null)? (unimodMod.getDelta().getAvgeMass()).doubleValue():null; Double monoMass = (unimodMod.getDelta()!=null)? (unimodMod.getDelta().getMonoMass()).doubleValue():null; List<uk.ac.ebi.pridemod.model.Specificity> specificityList = null; if(unimodMod.getSpecificity() != null && unimodMod.getSpecificity().size() > 0){ specificityList = new ArrayList<uk.ac.ebi.pridemod.model.Specificity>(unimodMod.getSpecificity().size()); for(Specificity oldSpecificty: unimodMod.getSpecificity()){ uk.ac.ebi.pridemod.model.Specificity specificity = new uk.ac.ebi.pridemod.model.Specificity(oldSpecificty.getSite(), oldSpecificty.getPosition()); specificityList.add(specificity); } } PTM uniModPTM = new UniModPTM(accession, name,description,monoMass,avgMass,specificityList,formula); ptmMap.put(accession,uniModPTM); } }
/** * Init the Map of the PTMs * @param unimodObject */ private void initPTMMap(Unimod unimodObject) { ptmMap = new HashMap<Comparable, PTM>(unimodObject.getModifications().getMod().size()); for(UnimodModification unimodMod: unimodObject.getModifications().getMod()){ /** * We will add the UNIMOD to the id in order to have the same style than PSI-MOD and * the mzIdentML files */ String accession = "UNIMOD:" + (unimodMod.getRecordId()).intValue(); String name = unimodMod.getTitle(); String description = unimodMod.getFullName(); String formula = (unimodMod.getDelta()!=null)?unimodMod.getDelta().getComposition():null; Double avgMass = (unimodMod.getDelta()!=null)? (unimodMod.getDelta().getAvgeMass()).doubleValue():null; Double monoMass = (unimodMod.getDelta()!=null)? (unimodMod.getDelta().getMonoMass()).doubleValue():null; List<uk.ac.ebi.pridemod.model.Specificity> specificityList = null; if(unimodMod.getSpecificity() != null && unimodMod.getSpecificity().size() > 0){ specificityList = new ArrayList<uk.ac.ebi.pridemod.model.Specificity>(unimodMod.getSpecificity().size()); for(Specificity oldSpecificty: unimodMod.getSpecificity()){ uk.ac.ebi.pridemod.model.Specificity specificity = new uk.ac.ebi.pridemod.model.Specificity(oldSpecificty.getSite(), oldSpecificty.getPosition()); specificityList.add(specificity); } } PTM uniModPTM = new UniModPTM(accession, name,description,monoMass,avgMass,specificityList,formula); ptmMap.put(accession,uniModPTM); } }
/** * Create an instance of {@link Specificity } */ public Specificity createSpecificity() { return new Specificity(); }
public boolean isSpecificity(String specificity) { for (Specificity aSpecificity : this.specificity) { if (aSpecificity.getPosition().compareToIgnoreCase(specificity) == 0) return true; } return false; }