Commit ab283567 authored by Haarst, Jan van's avatar Haarst, Jan van
Browse files

Added plotting (through pandas).

parent 56e0ade0
......@@ -48,8 +48,23 @@ def parse_bnx(runsizes = {}):
if __name__ == '__main__':
runsizes = dict()
# Grab the info from the BNX file(s)
runsizes = parse_bnx()
print json.dumps(runsizes,sort_keys=True,indent=4, separators=(',', ': '))
# Dump dictionary into pandas, so we can more easily plot it
df = pd.DataFrame(runsizes)
# Plot the dataframe
df.plot(marker='.', linestyle='-')
# Set title
plt.suptitle('Scan number vs. Length', fontsize=14, fontweight='bold')
# Set labels
plt.xlabel('Scan number')
plt.ylabel('Length (bases)')
# Remove background grid
plt.grid(b=False)
# Prettier legend
plt.legend(loc="upper right",shadow=True, fancybox=True)
# Store plot
plt.savefig("scans.png")
"""
......
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