def saveFile(self, fileName, conteudo): f = FcfrpFile(self._pathOut, fileName) f.getAsFile("w") f.write(conteudo) f.close()
def save(self,structure,dir,fileName): filePDB = FcfrpFile(dir, fileName) filePDB.getAsFile("w") #Create Remark Section self._saveRemark(structure, filePDB) #Create SEQRES Section self._saveSeqRes(structure, filePDB) #Create SSBOND Section self._saveSSBonds(structure, filePDB) #Create ATOM Section iModels = 0 #index for Models iAtom = 0 #index for atom iRes = 0 #index for Residue for model in structure: #Will write Model, if there are more than 1 models. if self._amountModels > 1: iModels += 1 filePDB.write(self._MODEL % str(iModels)) iAtom = 0 iRes = 0 for chain in model: for residue in chain: iRes += 1 for atom in residue: #Atoms iAtom += 1 self._saveAtom(iAtom,atom,residue,chain,iRes,filePDB, int(residue.id[1])) filePDB.write(self._TER) filePDB.write(self._ENDMDL) filePDB.close()