Mercurial > repos > cpt > cpt_wig_bigwig
diff fasta_len.py @ 3:b741d86046a6 draft
planemo upload commit 94b0cd1fff0826c6db3e7dc0c91c0c5a8be8bb0c
author | cpt |
---|---|
date | Mon, 05 Jun 2023 02:54:00 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fasta_len.py Mon Jun 05 02:54:00 2023 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python +import argparse +from Bio import SeqIO +import sys + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("fasta", type=argparse.FileType("r")) + args = parser.parse_args() + + for record in SeqIO.parse(args.fasta, "fasta"): + sys.stdout.write("%s\t%s\n" % (record.id, len(record)))