Commit 6e444486 authored by Jacob Durrant's avatar Jacob Durrant

Python3 and some other changes.

parent 72fda0c0
Pipeline #278 canceled with stages
Changes
=======
2.1
---
1. Now Python 3 compatible.
2. Fixed minor bug that assigned atoms with names like "HG21" to element "HG"
rather than "H". No longer supporting element "HG".
3. Improved formatting (black) and docstrings.
4. Moved GUI wrapper to new `depreciated/` folder. This feature is no longer
supported.
2.0.3
-----
......@@ -9,4 +19,4 @@ Changes
it was all alpha carbons. Take care when comparing POVME 2.0.1 and POVME
2.0.2/2.0.3 output.
3. Fixed NumPy warning.
4. Spelling error ("Angstroms").
\ No newline at end of file
4. Spelling error ("Angstroms").
python POVME2_GUI.py
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMIsApplet</key>
<true/>
<key>AMStayOpen</key>
<false/>
<key>BuildMachineOSBuild</key>
<string>13A563a</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>Automator workflow file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Application Stub</string>
<key>CFBundleIconFile</key>
<string>AutomatorApplet</string>
<key>CFBundleIdentifier</key>
<string>com.apple.automator.POVME.MacOSX</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>POVME.MacOSX</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array/>
<key>CFBundleVersion</key>
<string>381</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>5A11344p</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>13A563a</string>
<key>DTSDKName</key>
<string></string>
<key>DTXcode</key>
<string>0500</string>
<key>DTXcodeBuild</key>
<string>5A11344p</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSUIElement</key>
<true/>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
<key>NSMainNibFile</key>
<string>ApplicationStub</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSServices</key>
<array/>
<key>UTExportedTypeDeclarations</key>
<array/>
<key>UTImportedTypeDeclarations</key>
<array/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>381</string>
<key>AMApplicationVersion</key>
<string>2.4</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>on run {input, parameters} set p to POSIX path of (path to me) return {p} end run</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>FEE013EE-B901-460C-883A-F7AC8B5EDE7E</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>494828F9-1CE2-4F19-AC89-D7134816A7F0</string>
<key>UUID</key>
<string>F68E1868-F5E5-49C1-AABC-A8E03A2F1C13</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>309.500000:444.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>2.0.3</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>COMMAND_STRING</key>
<dict/>
<key>CheckedForUserDefaultShell</key>
<dict/>
<key>inputMethod</key>
<dict/>
<key>shell</key>
<dict/>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run Shell Script.action</string>
<key>ActionName</key>
<string>Run Shell Script</string>
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>cd ${1}
cd ../
if [ -f /usr/bin/python ];
then
/usr/bin/python POVME2_GUI.py &gt;/dev/null 2&gt;&amp;1&amp;
else
if [ -f /usr/local/bin/python ];
then
/usr/local/bin/python POVME2_GUI.py &gt;/dev/null 2&gt;&amp;1&amp;
else
if [ -f /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python/python ];
then
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python/python POVME2_GUI.py
else
python POVME2_GUI.py &gt;/dev/null 2&gt;&amp;1&amp;
fi
fi
fi
sleep 5
# set focus
if [ -f /usr/bin/osascript ];
then
/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true'
fi</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
<integer>1</integer>
<key>shell</key>
<string>/bin/bash</string>
<key>source</key>
<string></string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.RunShellScript</string>
<key>CFBundleVersion</key>
<string>2.0.3</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunShellScriptAction</string>
<key>InputUUID</key>
<string>DCCAA7DF-D67B-4573-BFA2-C1EDA5C04F3E</string>
<key>Keywords</key>
<array>
<string>Shell</string>
<string>Script</string>
<string>Command</string>
<string>Run</string>
<string>Unix</string>
</array>
<key>OutputUUID</key>
<string>89BC9F1F-15F2-4E6A-9BEA-D11BEE95F481</string>
<key>UUID</key>
<string>537481C5-6175-4A2B-80F7-E50360DF2909</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<integer>0</integer>
<key>name</key>
<string>inputMethod</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
<key>1</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>1</string>
</dict>
<key>2</key>
<dict>
<key>default value</key>
<false/>
<key>name</key>
<string>CheckedForUserDefaultShell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>2</string>
</dict>
<key>3</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>COMMAND_STRING</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>3</string>
</dict>
<key>4</key>
<dict>
<key>default value</key>
<string>/bin/sh</string>
<key>name</key>
<string>shell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>4</string>
</dict>
</dict>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:402.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict>
<key>04317E67-C6FA-428A-83E0-5CF21C60218D</key>
<dict>
<key>from</key>
<string>F68E1868-F5E5-49C1-AABC-A8E03A2F1C13 - F68E1868-F5E5-49C1-AABC-A8E03A2F1C13</string>
<key>to</key>
<string>537481C5-6175-4A2B-80F7-E50360DF2909 - 537481C5-6175-4A2B-80F7-E50360DF2909</string>
</dict>
</dict>
<key>workflowMetaData</key>
<dict>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.application</string>
</dict>
</dict>
</plist>
python POVME2_GUI.py
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@ from sys import argv
#Get VMD-annotated PDB from user through sys.argv
script, pdb_file = argv
print "This script will create a PDB /n with the correct formatting for MDA"
print("This script will create a PDB /n with the correct formatting for MDA")
#Creates a new Universe with user input
u = MDAnalysis.Universe(pdb_file, topology_format = 'PDB')
#Writes a new trajectory in the format MDAnalysis can work with
......
......@@ -19,9 +19,9 @@ for line in volumes:
vol_dic[a] = float(b)
#Creates a list of the volumes from vol_dic
vol_list = vol_dic.values()
vol_list = list(vol_dic.values())
#Creates a list of the frames from vol_dic
frame_num = vol_dic.keys()
frame_num = list(vol_dic.keys())
#Creates scatterplot, x = frames, y = volumes
plt.scatter(frame_num, vol_list, marker = '.', s = 50, c = 'orange')
# X axis label
......@@ -31,7 +31,7 @@ plt.ylabel('Binding Pocket Volume')
# Plot Title
plt.title('Binding Pocket Volume Over Time')
#Sets parameters of X axis for viewing
plt.xticks(range(-1, len(frame_num), (len(frame_num)/10)))
plt.xticks(list(range(-1, len(frame_num), (len(frame_num)/10))))
plt.xlim([- 1, len(frame_num)])
# Shows plot
plt.savefig('Scatterplot.png')
\ No newline at end of file
......@@ -18,12 +18,12 @@ for line in volumes:
#Finds maximum value in volumes and stores as max_val
max_val = 0
for val in vol_dic.values():
for val in list(vol_dic.values()):
if val > max_val:
max_val = val
#Finds the frame of the maximum value and stores as max_val_frame
for frame, volume in vol_dic.items():
for frame, volume in list(vol_dic.items()):
if volume == max_val:
max_val_frame = frame
......@@ -32,15 +32,15 @@ min_val = min(vol_dic.values())
#Finds frame of minimum volume and stores as min_val_frame
for frame, volume in vol_dic.items():
for frame, volume in list(vol_dic.items()):
if volume == min_val:
min_val_frame = frame
print """
print("""
The maximum pocket volume of this data set is %r, at frame %r,
while the minimum pocket volume of this data set is %r, at frame %r.
""" % (max_val, max_val_frame, min_val, min_val_frame)
""" % (max_val, max_val_frame, min_val, min_val_frame))
......@@ -5,7 +5,7 @@ from sys import argv
script, pdb_file = argv
#Get number of the POVME frame from User
frame_num = raw_input("What is the frame number you want? ")
frame_num = input("What is the frame number you want? ")
frame_num_int = int(frame_num)
frame_num_str = str(frame_num)
......@@ -20,5 +20,5 @@ with mda.Writer("MD_frame_" + frame_num_str + ".pdb",
start = frame_num_int,
multiframe = False) as pdb:
pdb.write(u)
print "Created new PDB file for specified frame, titled 'MD_frame_%r.pdb'" %frame_num
print "Your POVME frame is titled 'POVME_frame_%r.pdb' " % frame_num
\ No newline at end of file
print("Created new PDB file for specified frame, titled 'MD_frame_%r.pdb'" %frame_num)
print("Your POVME frame is titled 'POVME_frame_%r.pdb' " % frame_num)
\ No newline at end of file
......@@ -21,7 +21,7 @@ for line in volumes:
#Create a list of volume values, store in vol_list
vol_list = vol_dic.values()
vol_list = list(vol_dic.values())
#Sets bin parameters for the histogram
#bins = np.array([n for n in range(0, len(vol_list)#, 5)])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment