Ejemplo n.º 1
0
def main():
    usage = """
    ./pdb_rmsd.py pdb_file1 pdb_file2

    Extract the largest RNA chain from each file and calculate the rmsd between
    all the matching atoms. Matching atoms are those that share a position and name.

    I.e. residue 1, atom C1'
    """
    num_args= 2
    parser = OptionParser(usage=usage)

    #parser.add_option('-o', '--options', dest='some_option', default='yo', help="Place holder for a real option", type='str')
    #parser.add_option('-u', '--useless', dest='uselesss', default=False, action='store_true', help='Another useless option')

    (options, args) = parser.parse_args()

    if len(args) < num_args:
        parser.print_help()
        sys.exit(1)

    chain1 = cup.load_structure(args[0])
    chain2 = cup.load_structure(args[1])

    print cup.pdb_rmsd(chain1, chain2)[:2]
Ejemplo n.º 2
0
def main():
    usage = """
    ./pdb_rmsd.py pdb_file1 pdb_file2

    Extract the largest RNA chain from each file and calculate the rmsd between
    all the matching atoms. Matching atoms are those that share a position and name.

    I.e. residue 1, atom C1'
    """
    num_args = 2
    parser = OptionParser(usage=usage)

    #parser.add_option('-o', '--options', dest='some_option', default='yo', help="Place holder for a real option", type='str')
    #parser.add_option('-u', '--useless', dest='uselesss', default=False, action='store_true', help='Another useless option')

    (options, args) = parser.parse_args()

    if len(args) < num_args:
        parser.print_help()
        sys.exit(1)

    chain1 = cup.load_structure(args[0])
    chain2 = cup.load_structure(args[1])

    print cup.pdb_rmsd(chain1, chain2)[:2]
Ejemplo n.º 3
0
def main():
    usage = """
    python burial.py pdb_file

    Calculate how buried each nucleotide is in this PDB file.
    """
    num_args= 1
    parser = OptionParser(usage=usage)

    parser.add_option('-r', '--radius', dest='radius', default=5, help="The radius of the search ball", type='float')
    parser.add_option('-s', '--step-size', dest='step_size', default=1, help="The size of each step in the depth search", type='float')
    #parser.add_option('-u', '--useless', dest='uselesss', default=False, action='store_true', help='Another useless option')

    (options, args) = parser.parse_args()

    if len(args) < num_args:
        parser.print_help()
        sys.exit(1)

    all_directions = np.array(ftuv.GetPointsEquiAngularlyDistancedOnSphere(numberOfPoints = 45))

    chain = ftup.load_structure(args[0])
    atoms = bpdb.Selection.unfold_entities(chain, 'A')
    atom_coords = np.array([a.get_coord() for a in atoms])

    kd = bkd.KDTree(3)
    kd.set_coords(atom_coords)

    for i,r in enumerate(chain.get_list()):
        distance = calculate_burial(kd, r["C1'"].get_coord(), 
                                    all_directions, radius=options.radius,
                                   step_size = options.step_size)

        print "{}:{}".format(i+1, distance)
        pass
Ejemplo n.º 4
0
def main():
    usage = """
    python burial.py pdb_file

    Calculate how buried each nucleotide is in this PDB file.
    """
    num_args = 1
    parser = OptionParser(usage=usage)

    parser.add_option('-r',
                      '--radius',
                      dest='radius',
                      default=5,
                      help="The radius of the search ball",
                      type='float')
    parser.add_option('-s',
                      '--step-size',
                      dest='step_size',
                      default=1,
                      help="The size of each step in the depth search",
                      type='float')
    #parser.add_option('-u', '--useless', dest='uselesss', default=False, action='store_true', help='Another useless option')

    (options, args) = parser.parse_args()

    if len(args) < num_args:
        parser.print_help()
        sys.exit(1)

    all_directions = np.array(
        ftuv.GetPointsEquiAngularlyDistancedOnSphere(numberOfPoints=45))

    chain = ftup.load_structure(args[0])
    atoms = bpdb.Selection.unfold_entities(chain, 'A')
    atom_coords = np.array([a.get_coord() for a in atoms])

    kd = bkd.KDTree(3)
    kd.set_coords(atom_coords)

    for i, r in enumerate(chain.get_list()):
        distance = calculate_burial(kd,
                                    r["C1'"].get_coord(),
                                    all_directions,
                                    radius=options.radius,
                                    step_size=options.step_size)

        print "{}:{}".format(i + 1, distance)
        pass