-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathBioJava:CookBook3:ModFinder.html
More file actions
86 lines (66 loc) · 3.56 KB
/
BioJava:CookBook3:ModFinder.html
File metadata and controls
86 lines (66 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<h2 id="how-can-i-identify-protein-modifications-in-a-structure">How can I identify protein modifications in a structure?</h2>
<p>BioJava provide a module <em>biojava3-modfinder</em> for identification of
protein pre-, co-, and post-translational modifications from structures.
<a href="BioJava:CookBook3:SupportedProtMod" title="wikilink">A list of protein
modifications</a> has been
pre-loaded. It is possible to identify all pre-loaded modifications or
part of them.</p>
<h2 id="example-identify-and-print-all-preloaded-modifications-from-a-structure">Example: identify and print all preloaded modifications from a structure</h2>
<java> Set<modifiedcompound> identifyAllModfications(Structure struc) {
` ProteinModificationIdentifier parser = new ProteinModificationIdentifier();`
` parser.identify(struc);`
` Set`<modifiedcompound>` mcs = parser.getIdentifiedModifiedCompound();`
` return mcs;`
}
Example: identify phosphorylation sites in a structure
------------------------------------------------------
<java> List<residuenumber> identifyPhosphosites(Structure struc) {
` 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?](BioJava:CookBook3:SupportedProtMod "wikilink")
- [How can I define a new protein
modification?](BioJava:CookBook3:AddProtMod "wikilink")
</div>
</residuenumber></modifiedcompound></java></structuregroup></modifiedcompound></residuenumber></residuenumber></residuenumber></java></modifiedcompound></modifiedcompound></java>