Package org.biojava.nbio.structure.io
Class FileConvert
- java.lang.Object
- 
- org.biojava.nbio.structure.io.FileConvert
 
- 
 public class FileConvert extends Object Methods to convert a structure object into different file formats.- Since:
- 1.4
- Author:
- Andreas Prlic
 
- 
- 
Field SummaryFields Modifier and Type Field Description static DecimalFormatd2static DecimalFormatd3
 - 
Constructor SummaryConstructors Constructor Description FileConvert(Structure struc)Constructs a FileConvert object.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoPrintConnections()Returns if the Connections should be added default is true;voidsetPrintConnections(boolean printConnections)enable/disable printing of connections connections are sometimes buggy in PDB files so there are some cases where one might turn this off.voidtoDASStructure(XMLWriter xw)Convert a protein Structure to a DAS Structure XML response .StringtoMMCIF()Convert this structure to its CIF representation.static StringtoMMCIF(Chain chain)Convert a chain to its CIF representation.StringtoPDB()Convert a structure into a PDB file.static StringtoPDB(Atom a)Prints the content of an Atom object as a PDB formatted line.static StringtoPDB(Atom a, String chainId)static voidtoPDB(Atom a, StringBuffer str)static voidtoPDB(Atom a, StringBuffer str, String chainID)Print ATOM record in the following syntaxstatic StringtoPDB(Chain chain)Convert a Chain object to PDB representationstatic StringtoPDB(Group g)Convert a Group object to PDB representation
 
- 
- 
- 
Field Detail- 
d3public static DecimalFormat d3 
 - 
d2public static DecimalFormat d2 
 
- 
 - 
Constructor Detail- 
FileConvertpublic FileConvert(Structure struc) Constructs a FileConvert object.- Parameters:
- struc- a Structure object
 
 
- 
 - 
Method Detail- 
doPrintConnectionspublic boolean doPrintConnections() Returns if the Connections should be added default is true;- Returns:
- if the printConnections flag is set
 
 - 
setPrintConnectionspublic void setPrintConnections(boolean printConnections) enable/disable printing of connections connections are sometimes buggy in PDB files so there are some cases where one might turn this off.- Parameters:
- printConnections-
 
 - 
toPDBpublic String toPDB() Convert a structure into a PDB file.- Returns:
- a String representing a PDB file.
 
 - 
toPDBpublic static String toPDB(Atom a) Prints the content of an Atom object as a PDB formatted line.- Parameters:
- a-
- Returns:
 
 - 
toPDBpublic static String toPDB(Chain chain) Convert a Chain object to PDB representation- Parameters:
- chain-
- Returns:
 
 - 
toPDBpublic static String toPDB(Group g) Convert a Group object to PDB representation- Parameters:
- g-
- Returns:
 
 - 
toPDBpublic static void toPDB(Atom a, StringBuffer str, String chainID) Print ATOM record in the following syntaxATOM 1 N ASP A 15 110.964 24.941 59.191 1.00 83.44 N COLUMNS DATA TYPE FIELD DEFINITION --------------------------------------------------------------------------------- 1 - 6 Record name "ATOM " 7 - 11 Integer serial Atom serial number. 13 - 16 Atom name Atom name. 17 Character altLoc Alternate location indicator. 18 - 20 Residue name resName Residue name. 22 Character chainID Chain identifier. 23 - 26 Integer resSeq Residue sequence number. 27 AChar iCode Code for insertion of residues. 31 - 38 Real(8.3) x Orthogonal coordinates for X in Angstroms. 39 - 46 Real(8.3) y Orthogonal coordinates for Y in Angstroms. 47 - 54 Real(8.3) z Orthogonal coordinates for Z in Angstroms. 55 - 60 Real(6.2) occupancy Occupancy. 61 - 66 Real(6.2) tempFactor Temperature factor. 73 - 76 LString(4) segID Segment identifier, left-justified. 77 - 78 LString(2) element Element symbol, right-justified. 79 - 80 LString(2) charge Charge on the atom. - Parameters:
- a-
- str-
- chainID- the chain ID that the Atom will have in the output string
 
 - 
toPDBpublic static void toPDB(Atom a, StringBuffer str) 
 - 
toDASStructurepublic void toDASStructure(XMLWriter xw) throws IOException Convert a protein Structure to a DAS Structure XML response . Since 5.0, bond (CONECT records) information is not supported anymore.- Parameters:
- xw- a XMLWriter object
- Throws:
- IOException- ...
 
 - 
toMMCIFpublic String toMMCIF() Convert this structure to its CIF representation.- Returns:
- a String representing this structure as CIF
 
 
- 
 
-