view fasta_len.py @ 4:dd14a8d8f884 draft default tip

planemo upload commit f33bdf952d796c5d7a240b132af3c4cbd102decc
author cpt
date Fri, 05 Jan 2024 05:57:49 +0000
parents b741d86046a6
children
line wrap: on
line source

#!/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)))