Mercurial > repos > chemteam > mdanalysis_angle
comparison distance.py @ 1:231a8ddd34c6 draft
planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 9b44a37fc1a0c338693f54eaf52b582439ca9f0c
| author | chemteam |
|---|---|
| date | Thu, 20 Dec 2018 06:47:31 -0500 |
| parents | b9e9c07a016d |
| children | 8a5c112aa0f1 |
comparison
equal
deleted
inserted
replaced
| 0:b9e9c07a016d | 1:231a8ddd34c6 |
|---|---|
| 4 import sys | 4 import sys |
| 5 | 5 |
| 6 import MDAnalysis as mda | 6 import MDAnalysis as mda |
| 7 | 7 |
| 8 import matplotlib | 8 import matplotlib |
| 9 matplotlib.use('Agg') # noqa | |
| 9 import matplotlib.pyplot as plt | 10 import matplotlib.pyplot as plt |
| 10 | 11 |
| 11 import numpy as np | 12 import numpy as np |
| 12 | |
| 13 matplotlib.use('Agg') | |
| 14 | 13 |
| 15 | 14 |
| 16 def parse_command_line(argv): | 15 def parse_command_line(argv): |
| 17 parser = argparse.ArgumentParser() | 16 parser = argparse.ArgumentParser() |
| 18 parser.add_argument('--idcd', help='input dcd') | 17 parser.add_argument('--idcd', help='input dcd') |
| 51 data = [tuple(map(float, xtmp.split())) for xtmp in g[0:]] | 50 data = [tuple(map(float, xtmp.split())) for xtmp in g[0:]] |
| 52 time = [xtmp[0] for xtmp in data] | 51 time = [xtmp[0] for xtmp in data] |
| 53 distance = [xtmp[1] for xtmp in data] | 52 distance = [xtmp[1] for xtmp in data] |
| 54 plt.plot(time, distance) | 53 plt.plot(time, distance) |
| 55 plt.xlabel('Frame No.') | 54 plt.xlabel('Frame No.') |
| 56 plt.ylabel('Distance ($\AA$)') | 55 plt.ylabel(r'Distance ($\AA$)') |
| 57 plt.savefig(args.odistance_plot, format='png') | 56 plt.savefig(args.odistance_plot, format='png') |
