comparison fasta_len.py @ 3:b741d86046a6 draft

planemo upload commit 94b0cd1fff0826c6db3e7dc0c91c0c5a8be8bb0c
author cpt
date Mon, 05 Jun 2023 02:54:00 +0000
parents
children
comparison
equal deleted inserted replaced
2:9757d61608c8 3:b741d86046a6
1 #!/usr/bin/env python
2 import argparse
3 from Bio import SeqIO
4 import sys
5
6
7 if __name__ == "__main__":
8 parser = argparse.ArgumentParser()
9 parser.add_argument("fasta", type=argparse.FileType("r"))
10 args = parser.parse_args()
11
12 for record in SeqIO.parse(args.fasta, "fasta"):
13 sys.stdout.write("%s\t%s\n" % (record.id, len(record)))