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
|
import java.io.File;
import java.util.Map;
import org.biojava.bio.structure.AminoAcid;
import org.biojava.bio.structure.Chain;
import org.biojava.bio.structure.Group;
import org.biojava.bio.structure.GroupIterator;
import org.biojava.bio.structure.Structure;
import org.biojava.bio.structure.io.PDBFileReader;
public class Pdbvieux {
public static void main (String[] args){
//fonctionne egalement avec les fichiers
// compresses par zip
File filename = new File ("/home/chemin/vers/1PW4.pdb");
String sequence = "";
PDBFileReader pdbreader = new PDBFileReader();
// optionel: le lecteur peut aussi lire les structure secondaires
// tel que decrites dans l'en-tet du fichier PDB pour les ajouter
// aux acides amines
pdbreader.setParseSecStruc(true);
try{
Structure struc = pdbreader.getStructure(filename);
System.out.println(struc);
GroupIterator gi = new GroupIterator(struc);
while (gi.hasNext()){
Group g = (Group) gi.next();
if ( g instanceof AminoAcid ){
AminoAcid aa = (AminoAcid)g;
Map sec = aa.getSecStruc();
Chain c = g.getParent();
//System.out.println(c.getName() + " " + g + " " + sec);
// LE PROBLÉME SE SITUE ICI
char acideamine=aa.getAminoType();
String result = String.valueOf(acideamine);
System.out.print(result);
sequence.concat(result);
}
System.out.println(sequence);
}
} catch (Exception e) {
e.printStackTrace();
}
}
} |
Partager