Exemplo n.º 1
0
                        for z in range(int(lims[0].strip()), int(lims[1].strip()) + 1):
                            residues.append(z)
                    else:
                        residues.append(int(ress[y].strip()))
            elif "bin" in words[0].lower():
                bins = words[1].lower().split("x")
                if len(bins) != 2:
                    print "Error: Invalid input file!"
                    sys.exit()
                bins[0] = int(bins[0].strip())
                bins[1] = int(bins[1].strip())
except ValueError:
    print "Error: Invalid input file!"
    sys.exit()

if utilities.fileexists(topname) == -1:
    sys.exit()

residue_names = utilities.getallresinfo(topname, "RESIDUE_LABEL")

if len(mdcrds) == 0:
    mdcrds.append("mdcrd")

residue_number = utilities.resnum(topname)
if residue_number == -1:
    print "Error: Invalid topology file " + topname + "!"
    sys.exit()

for x in range(len(residues)):
    if residues[x] < 1:
        print "Error: You chose a nonsensical residue (residue 0 or less)"
Exemplo n.º 2
0
parm = amberParm(prmtop)
if len(mdcrds) == 0: # if no mdcrd supplied, give default
   mdcrds.append('mdcrd')

ptraj = utilities.which('cpptraj') # look for ptraj

if ptraj is None:
   print 'Error: cpptraj needed for FindSaltbridge.py!'
   sys.exit() # quit if not found

if not parm.valid:
   printusage()

for x in range(len(mdcrds)): # check for mdcrd existences
   if utilities.fileexists(mdcrds[x]) == -1:
      printusage()

residues = parm.parm_data['RESIDUE_LABEL']

for x in range(len(residues)): # build acceptor list and donor list
   try:
      tmp = acceptorlist[residues[x]]
      acceptor_inds.append(x+1)
   except KeyError:
      pass

   try:
      tmp = donorlist[residues[x]]
      donor_inds.append(x+1)
   except KeyError:
Exemplo n.º 3
0
    sys.exit()
except ValueError:
    print >> sys.stderr, "Error: Command line error!"
    sys.exit()

print "Removing py_leap.in"
os.system("rm -f py_leap.in")

leapfile = open("py_leap.in", "w")
leapfile.write("source " + frc_fld + "\n")


#### BEGIN INPUT FILE TYPES ####

if pdb != "":
    if utilities.fileexists(pdb) == -1:
        leapfile.close()
        os.system("rm -f py_leap.in")
        sys.exit()
    leapfile.write("l = loadpdb " + pdb + "\n")
    infiles = True


#### END INPUT FILE TYPES ####
if not infiles:
    print "Error: You have not specified any structures!"
    leapfile.close()
    os.system("rm -f py_leap.in")
    sys.exit()

if ci == 1: