Esempio n. 1
0
def mergeProteinAndMembranePdb(file,fileToMerge):
    '''
    Merges all amino acid lines in file with non protein atoms in filetoMerge
    the box size of fileToMerge is kept and the boxsize of file is discarded
    '''
    boxSize = pdb_util.findPDBBoxSize(fileToMerge)
    lines = pdb_util.findAllNonProtein(fileToMerge)
    toMerge = pdb_util.findAllAminoAcidLines(file)


    #backup the file
    versionFile(file)
    # #write new file
    with open(file,"w") as f:
        str = boxSize.strip() +'\n' + toMerge.strip() +'\n'+ lines.strip()
        f.write(str)

    logCommand("Merged the non Amino acid lines of %s with all the atoms in %s"%(file,fileToMerge))
Esempio n. 2
0
    with open(confFile,"w") as f:
        f.write(proteinString)

    # if args.mutatations:
    #     #TODO set correct filenames
    #     args = ['Scwrl4','-i',confFile,'-o','confs/test.pdb']
    #     md_tools.executeCommand(args)
    #     args = ['Scwrl4','-i','confs/test.pdb','-o',confFile,'-s',scrwl_sequence_file]
    #     md_tools.executeCommand(args)
    #     index = index+1

    md_tools.pdb2gmx(confFile,"-ff amber99sb-ildn -vsite hydrogens -water tip3p -ignh -o %s"%confFile)


    #TODO grep the last line to get charge imbalances
    boxSize= pdb_util.findPDBBoxSize(frame)
    nonProteinString = pdb_util.findAllNonProtein(frame)
    proteinString = pdb_util.findAllAminoAcidLines(confFile)

    with open(confFile,"w") as f:
        f.write(boxSize)
        f.write("\n")
        f.write(proteinString)
        f.write(nonProteinString)

membrane.injectLinesIntoTop("topol.top")
md_tools.updateMembraneCount("POPC",confFile,"topol.top",fileType="pdb")
md_tools.updateWaterAndIonCount(confFile,"topol.top")

md_tools.cleanupBackups()