Exemple #1
0
    if not args.files or not args.initial:
        print("No input files! Nothing to do, so exit.")
        quit()

    if not args.ligand:
        print("No residue name specified, so exit.")
        quit()

    # Read in PDB files
    if len(args.files) == 1:
        pdbfiles = simulationobjects.PDBSet()
        pdbfiles.read(args.files[0], resname=args.ligand)
    else:
        pdbfiles = simulationobjects.PDBSet()
        for filename in args.files:
            pdb = simulationobjects.PDBFile(filename=filename)
            pdbfiles.pdbs.append(pdb)

    # Read in initial structure
    initpdb = simulationobjects.PDBFile(filename=args.initial)

    # Calculate RMSD
    rmsd = calc_rmsd(initpdb, pdbfiles, args.ligand, args.atom)
    if args.atom is None:
        print("The RMSD of the ligand centre is %0.3f A" % rmsd)
    else:
        print("The RMSD of the atom %s is %0.3f A" % (args.atom.lower(), rmsd))

    # Calculate force constant from equipartition theorem
    k = 3.0 * 1.987 * args.temperature / 1000.0 / (rmsd * rmsd)
    print("\nThis corresponds to a spring constant of %.3f kcal/mol/A2" % k)
Exemple #2
0
        default=None)
    parser.add_argument(
        '--setupseed',
        help="optional random number seed for generation of water coordinates",
        default=None,
        type=int)
    return parser


#
# -------------------------------------
# If this is run from the command-line
# -------------------------------------
#

if __name__ == "__main__":
    args = get_arg_parser().parse_args()

    # Setup the logger
    logger = simulationobjects.setup_logger("convertwater_py.log")
    if args.setupseed is not None:
        logger.debug("Setup seed = %d" % args.setupseed)
    np.random.seed(args.setupseed)

    pdb_in = simulationobjects.PDBFile(filename=args.pdb)
    pdb_out = convertwater(pdb_in,
                           args.model,
                           ignorH=args.ignoreh,
                           watresname=args.resname)
    pdb_out.write(args.out)
    # Setup a parser of the command-line arguments
    parser = argparse.ArgumentParser(
        description="Program convert atom names in a protein pdb-file to"
        " ProtoMS style")
    parser.add_argument('-p', '--protein', help="the protein PDB-file")
    parser.add_argument('-o',
                        '--out',
                        help="the output PDB-file",
                        default="protein_pms.pdb")
    parser.add_argument('-s',
                        '--style',
                        help="the style of the input PDB-file",
                        default="amber")
    parser.add_argument('-c',
                        '--conversionfile',
                        help="the name of the file with conversion rules",
                        default="atomnamesmap.dat")
    return parser


if __name__ == "__main__":

    args = get_arg_parser().parse_args()

    # Setup the logger
    logger = simulationobjects.setup_logger("convertatomnames_py.log")

    protein = simulationobjects.PDBFile(filename=args.protein)
    protein_out = pdb2pms(protein, args.style, args.conversionfile)
    protein_out.write(args.out)
Exemple #4
0
        quit()

    # Fix negative values of skip and max
    if args.max < 0:
        args.max = 99999
    if args.skip <= 0:
        args.skip = -1

    # Read in PDB files
    if len(args.files) == 1:
        pdbfiles = simulationobjects.PDBSet()
        pdbfiles.read(args.files[0], skip=args.skip, readmax=args.max)
    else:
        pdbfiles = simulationobjects.PDBSet()
        for filename in args.files[args.skip:args.max + 1]:
            pdb = simulationobjects.PDBFile(filename=filename)
            pdbfiles.pdbs.append(pdb)

    nextracted, grid, prop = calc_density(pdbfiles,
                                          args.residue.lower(),
                                          args.atom.lower(),
                                          padding=args.padding,
                                          extent=args.extent,
                                          spacing=args.spacing,
                                          norm=args.norm,
                                          smoothing=args.type)

    print("Extracted atoms in each PDB: %s" % ", ".join("%d" % i
                                                        for i in nextracted))
    print("Extracted %.3f on average" % nextracted.mean())
Exemple #5
0
        "isn't, twice the 'padding' will be the lengths of a cubic box.",
        default=None)
    return parser


if __name__ == "__main__":
    args = get_arg_parser().parse_args()

    # Setup the logger
    logger = simulationobjects.setup_logger("make_gcmcbox_py.log")

    if args.solute is None and args.box is None:
        print("Nothing to do! Exiting.")

    if args.box is None:
        pdbobj = simulationobjects.PDBFile()
        pdbobj.read(args.solute)
        box = make_gcmcbox(pdbobj, args.out, args.padding)
    elif len(args.box) == 3:
        box = {
            "center":
            np.array(
                [float(args.box[0]),
                 float(args.box[1]),
                 float(args.box[2])]),
            "len":
            np.array([args.padding * 2] * 3)
        }
    elif len(args.box) == 6:
        box = {
            "center":