Beispiel #1
0
def test_angles_4():
    
    resi = ["RG_69_0","RU_37_0"]
    angles = ["gamma","alpha"]
    
    angles_b,rr = bb.backbone_angles(fname1,topology=fname,residues=resi,angles=angles)
    stri = ""
    for p in range(angles_b.shape[0]):
        for k in range(angles_b.shape[2]):
            stri += " %10.4f %10.4f " % (angles_b[p,0,k],angles_b[p,1,k])
        stri += "\n"
        
    fh = open("%s/angles_04.test.dat" % outdir,'w')
    fh.write(stri)
    fh.close()
    comp("%s/angles_04.test.dat" % refdir)
Beispiel #2
0
def test_angles_1():
    
    angles_b,rr = bb.backbone_angles(fname)

    fh = open("%s/angles_01.test.dat" % outdir,'w')
    stri = "%20s " % "#"
    for pp in dd.bb_angles:
        stri += " %10s " % pp
    stri += "\n"
    
    for e in range(angles_b.shape[1]):
        stri += "%20s " % (rr[e])
        for k in range(angles_b.shape[2]):
            stri += " %10.4f " % angles_b[0,e,k]
        stri += "\n"
    fh.write(stri)
    fh.close()
    comp("%s/angles_01.test.dat" % refdir)
Beispiel #3
0
def test_angles_1():

    angles_b, rr = bb.backbone_angles(fname)

    fh = open("%s/angles_01.test.dat" % outdir, 'w')
    stri = "%20s " % "#"
    for pp in dd.bb_angles:
        stri += " %10s " % pp
    stri += "\n"

    for e in range(angles_b.shape[1]):
        stri += "%20s " % (rr[e])
        for k in range(angles_b.shape[2]):
            stri += " %10.4f " % angles_b[0, e, k]
        stri += "\n"
    fh.write(stri)
    fh.close()
    comp("%s/angles_01.test.dat" % refdir)
Beispiel #4
0
def test_angles_4():

    resi = ["RG_69_0", "RU_37_0"]
    angles = ["gamma", "alpha"]

    angles_b, rr = bb.backbone_angles(fname1,
                                      topology=fname,
                                      residues=resi,
                                      angles=angles)
    stri = ""
    for p in range(angles_b.shape[0]):
        for k in range(angles_b.shape[2]):
            stri += " %10.4f %10.4f " % (angles_b[p, 0, k], angles_b[p, 1, k])
        stri += "\n"

    fh = open("%s/angles_04.test.dat" % outdir, 'w')
    fh.write(stri)
    fh.close()
    comp("%s/angles_04.test.dat" % refdir)
Beispiel #5
0
def test_angles_3():
    
    resi = ["RG_69_0","RU_37_0"]
    angles = ["gamma","alpha"]
    
    angles_b,rr = bb.backbone_angles(fname,residues=resi,angles=angles)
    stri = "%20s " % "#"
    for pp in angles:
        stri += " %10s " % pp
    stri += "\n"

    for e in range(angles_b.shape[1]):
        stri += "%20s " % (rr[e])
        for k in range(angles_b.shape[2]):
            stri += " %10.4f " % angles_b[0,e,k]
        stri += "\n"

    fh = open("%s/angles_03.test.dat" % outdir,'w')
    fh.write(stri)
    fh.close()
    comp("%s/angles_03.test.dat" % refdir)
Beispiel #6
0
def test_angles_3():

    resi = ["RG_69_0", "RU_37_0"]
    angles = ["gamma", "alpha"]

    angles_b, rr = bb.backbone_angles(fname, residues=resi, angles=angles)
    stri = "%20s " % "#"
    for pp in angles:
        stri += " %10s " % pp
    stri += "\n"

    for e in range(angles_b.shape[1]):
        stri += "%20s " % (rr[e])
        for k in range(angles_b.shape[2]):
            stri += " %10.4f " % angles_b[0, e, k]
        stri += "\n"

    fh = open("%s/angles_03.test.dat" % outdir, 'w')
    fh.write(stri)
    fh.close()
    comp("%s/angles_03.test.dat" % refdir)
Beispiel #7
0
def torsion(args):
    
    assert args.backbone or args.sugar or args.pucker, "# ERROR. choose --backbone/sugar/pucker"
    
    if(args.backbone):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s %11s %11s %11s %11s %11s\n" % ("RESIDUE","alpha","beta","gamma","delta","eps","zeta","chi")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.backbone_angles(args.pdbs[i],residues=args.res)
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.backbone_angles(args.trj,topology=args.top,residues=args.res)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
            
            
        fh = open(args.name + ".backbone.out",'w')
        fh.write(stri_b)
        fh.close()

    if(args.sugar):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s %11s %11s %11s \n" % ("RESIDUE","nu0","nu1","nu2","nu3","nu4")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.sugar_angles(args.pdbs[i],residues=args.res)
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.sugar_angles(args.trj,topology=args.top,residues=args.res)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
            
            
        fh = open(args.name + ".sugar.out",'w')
        fh.write(stri_b)
        fh.close()

    if(args.pucker):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s \n" % ("RESIDUE","Phase","Amplitude")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.pucker_angles(args.pdbs[i],residues=args.res,altona=args.altona)
                stri_b += "".join(["%-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.pucker_angles(args.trj,topology=args.top,residues=args.res,altona=args.altona)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join(["%-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
                        
        fh = open(args.name + ".pucker.out",'w')
        fh.write(stri_b)
        fh.close()
Beispiel #8
0
def torsion(args):
    
    assert args.backbone or args.sugar or args.pucker, "# ERROR. choose --backbone/sugar/pucker"
    
    if(args.backbone):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s %11s %11s %11s %11s %11s\n" % ("RESIDUE","alpha","beta","gamma","delta","eps","zeta","chi")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.backbone_angles(args.pdbs[i],residues=args.res)
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.backbone_angles(args.trj,topology=args.top,residues=args.res)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
            
            
        fh = open(args.name + ".backbone.out",'w')
        fh.write(stri_b)
        fh.close()

    if(args.sugar):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s %11s %11s %11s \n" % ("RESIDUE","nu0","nu1","nu2","nu3","nu4")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.sugar_angles(args.pdbs[i],residues=args.res)
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.sugar_angles(args.trj,topology=args.top,residues=args.res)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join([" %-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
            
            
        fh = open(args.name + ".sugar.out",'w')
        fh.write(stri_b)
        fh.close()

    if(args.pucker):
        
        stri_b = "# %s \n" % (" ".join(sys.argv[:]))        
        stri_b += "#%-12s  %11s %11s \n" % ("RESIDUE","Phase","Amplitude")

        if(args.top==None):
            for i in range(len(args.pdbs)):
                stri_b += "# PDB %s \n" % args.pdbs[i].split("/")[-1]                
                angles_b,rr = bb.pucker_angles(args.pdbs[i],residues=args.res)
                stri_b += "".join(["%-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[0,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
        else:
            
            angles_b,rr = bb.pucker_angles(args.trj,topology=args.top,residues=args.res)
            for i in range(angles_b.shape[0]):
                stri_b += "# Frame %d \n" % i
                stri_b += "".join(["%-12s %s \n" % (rr[e], "".join([" %11.3e" % angles_b[i,e,k] for k in range(angles_b.shape[2])])) for e in range(angles_b.shape[1])])
                        
        fh = open(args.name + ".pucker.out",'w')
        fh.write(stri_b)
        fh.close()