Mercurial > repos > jay > pdaug_merge_dataframes
diff PDAUG_Peptide_Length_Distribution/PDAUG_Peptide_Length_Distribution.py @ 0:5bb52d4bf172 draft
"planemo upload for repository https://github.com/jaidevjoshi83/pdaug commit a9bd83f6a1afa6338cb6e4358b63ebff5bed155e"
author | jay |
---|---|
date | Wed, 28 Oct 2020 01:54:31 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PDAUG_Peptide_Length_Distribution/PDAUG_Peptide_Length_Distribution.py Wed Oct 28 01:54:31 2020 +0000 @@ -0,0 +1,31 @@ +import matplotlib.pyplot as plt +import Bio +from Bio import SeqIO +import os + + +def LegnthDestribution(InFile, OutFile): + + + sizes = [len(rec.seq) for rec in SeqIO.parse(InFile, "fasta")] + + plt.hist(sizes, bins=20) + plt.title("%i Negative bacteriocin sequences\nLengths %i to %i" \ + % (len(sizes),min(sizes),max(sizes))) + plt.xlabel("Sequence length (bp)") + plt.ylabel("Count") + + plt.savefig(OutFile) + + + +if __name__=="__main__": + + import argparse + + parser = argparse.ArgumentParser() + + parser.add_argument("-I", "--InFile", required=True, default=None, help="Input file name") + parser.add_argument("-O", "--OutFile", required=False, default="Out.png", help="Input file name") + args = parser.parse_args() + LegnthDestribution(args.InFile, args.OutFile)