| title | BioJava:CookBook3:ModFinder |
|---|---|
| permalink | wiki/BioJava%3ACookBook3%3AModFinder |
BioJava provide a module biojava3-modfinder for identification of protein pre-, co-, and post-translational modifications from structures. A list of protein modifications has been pre-loaded. It is possible to identify all pre-loaded modifications or part of them.
Set<ModifiedCompound> identifyAllModfications(Structure struc) {
聽聽聽ProteinModificationIdentifier聽parser聽=聽new聽ProteinModificationIdentifier();
聽聽聽parser.identify(struc);
聽聽聽Set`<ModifiedCompound> mcs聽=聽parser.getIdentifiedModifiedCompound();
聽聽聽return聽mcs;
} 聽聽List`<ResidueNumber> phosphosites聽=聽new聽ArrayList`<ResidueNumber>`();
聽聽ProteinModificationIdentifier聽parser聽=聽new聽ProteinModificationIdentifier();
聽聽parser.identify(struc,聽ProteinModificationRegistry.getByKeyword("phosphoprotein"));
聽聽Set`<ModifiedCompound> mcs聽=聽parser.getIdentifiedModifiedCompound();
聽聽for聽(ModifiedCompound聽mc聽:聽mcs)聽{`
聽聽聽聽聽聽Set`<StructureGroup> groups聽=聽mc.getGroups(true);
聽聽聽聽聽聽for聽(StructureGroup聽group聽:聽groups)聽{`
聽聽聽聽聽聽聽聽聽聽phosphosites.add(group.getPDBResidueNumber());
聽聽聽聽聽聽}`
聽聽}`
聽聽return聽phosphosites;
} ```
Demo code to run the above methods
----------------------------------
```java import org.biojava.nbio.structure.ResidueNumber; import
org.biojava.nbio.structure.Structure; import
org.biojava.nbio.structure.io.PDBFileReader; import
org.biojava.nbio.protmod.structure.ProteinModificationIdentifier;
public static void main(String[] args) {
聽聽try聽{`
聽聽聽聽聽聽PDBFileReader聽reader聽=聽new聽PDBFileReader();
聽聽聽聽聽聽reader.setAutoFetch(true);
聽聽聽聽聽聽//聽identify聽all聽modificaitons聽from聽PDB:1CAD聽and聽print聽them`
聽聽聽聽聽聽String聽pdbId聽=聽"1CAD";
聽聽聽聽聽聽Structure聽struc聽=聽reader.getStructureById(pdbId);
聽聽聽聽聽聽Set`<ModifiedCompound> mcs聽=聽identifyAllModfications(struc);
聽聽聽聽聽聽for聽(ModifiedCompound聽mc聽:聽mcs)聽{`
聽聽聽聽聽聽聽聽聽聽System.out.println(mc.toString());
聽聽聽聽聽聽}`
聽聽聽聽聽聽//聽identify聽all聽phosphosites聽from聽PDB:3MVJ聽and聽print聽them`
聽聽聽聽聽聽pdbId聽=聽"3MVJ";
聽聽聽聽聽聽struc聽=聽reader.getStructureById(pdbId);
聽聽聽聽聽聽List`<ResidueNumber> psites聽=聽identifyPhosphosites(struc);
聽聽聽聽聽聽for聽(ResidueNumber聽psite聽:聽psites)聽{`
聽聽聽聽聽聽聽聽聽聽System.out.println(psite.toString());
聽聽聽聽聽聽}`
聽聽}聽catch(Exception聽e)聽{`
聽聽聽聽聽聽e.printStackTrace();
聽聽}`
} ```
See also
--------
<div style="-moz-column-count:3; column-count:3;">
- [How can I get the list of supported protein
modifications?](/wiki/BioJava:CookBook3:SupportedProtMod "wikilink")
- [How can I define a new protein
modification?](/wiki/BioJava:CookBook3:AddProtMod "wikilink")
</div>