/** * Writes a the shortest paths of a list of virtual cross-links into a PDB formated file. * * @param pathFileName - String object holding the path to the PDB file to be written. * @param crossLinkList - List of cross-link objects holding each the the shortest path */ public final void writeSASDpdbFile(final String pathFileName, final CrossLinkList crossLinkList) { StringBuffer content = new StringBuffer(); for (CrossLink crossLink : crossLinkList) { if (crossLink.getPath() != null) { Atom atom1 = crossLink.getPreAtom(); Atom atom2 = crossLink.getPostAtom(); String distName = crossLink.getIndex() + "_" + this.decFormat.format(crossLink.getSolventPathDistance()) + "_" + atom1.getResidueName().trim() + "" + atom1.getResidueNumber() + "" + atom1.getChainId() + "-" + atom2.getResidueName().trim() + "" + atom2.getResidueNumber() + "" + atom2.getChainId() + "_solventPath"; content.append("HEADER " + distName + Constants.LINE_SEPERATOR); content.append(crossLink.getPath().toString(crossLink.getIndex())); content.append("END" + Constants.LINE_SEPERATOR); } } WriteFile file = new WriteFile(); file.setFile(pathFileName); file.write(content.toString()); }