20 from sys
import platform
21 from shutil
import rmtree
28 from Tkinter
import Listbox
39 Renames all files in a particular directory recursively from 1 - N. Useful due to some apps not being JD2 compatible!
47 for root, dirs, files
in os.walk(inFolder, topdown=
True):
50 if re.search(contains, f):
51 print "File_"+repr(filenum)+
"_"+f
52 p = os.path.join(root, f)
58 os.system(
"cp "+f+
" "+outFolder)
60 fSP = os.path.split(f)
61 fileSP = fSP[1].
split(
".")
62 newName = outName+
"_"+repr(filenum)+
"."+fileSP[1]
64 newPath = os.path.join(outFolder, newName)
65 oldPath = os.path.join(outFolder, fSP[1])
66 os.system(
"mv "+oldPath+
" "+newPath)
68 print "Files Copied.."
74 Gets distance between atom one and two of two residues.
76 xyz1 = p.residue(res1).
xyz(atom1)
77 xyz2 = p.residue(res2).
xyz(atom2)
82 Gets distance bt two coord vectors(list)
86 d = math.sqrt(
pow(xyz1[0]-xyz2[0], 2)+
pow(xyz1[1]-xyz2[1], 2)+
pow(xyz1[2]-xyz2[2], 2))
91 Get OS of the particular platform the toolkit is being run on.
95 if re.search(
"darwin", plat):
97 elif re.search(
"linux", plat):
99 elif re.search(
"win", plat):
102 print "Platform Not Found"
107 Loop string (start:end:chain) conversion to newer Region class.
110 start = loop_string.split(
":")[0]; end = loop_string.split(
":")[1]; chain = loop_string.split(
":")[2]
113 if (start ==
"" and end==
""):
114 region =
Region(chain.upper(),
None,
None)
117 region =
Region(chain.upper(),
None,
int(end))
120 region =
Region(chain.upper(),
int(start),
None)
129 Loops as strings representation of regions to newer Regions class.
132 for loop_string
in loops_as_strings:
xyzVector< Real > xyz(Real const &r1, Real const &omega1, Real const &t, Real const &dz1, Real const &delta_omega1, Real const &delta_z1)
Returns the x-, y-, and z-coordinates of a point on a helix given r1, omega1, and t...
utility::vector1< std::string > split(const std::string &s)
split given std::string using ' ' symbol.
DimensionExpressionPow pow(Dimension const &dim1, Dimension const &dim2)
pow( Dimension, Dimension )