view karyotype-from-fasta.py @ 10:7f13dc906cb9 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 164c36ba98fe4cd293e035efca00a9efa885a7ec"
author iuc
date Mon, 11 Oct 2021 10:09:51 +0000
parents e6cbe3190642
children
line wrap: on
line source

#!/usr/bin/env python
import sys

from Bio import SeqIO


# Process fasta data, extracting only headers
for idx, seq in enumerate(SeqIO.parse(sys.argv[1], "fasta")):
    sys.stdout.write(
        "chr	-	{seq_id}	{seq_id}	0	{length}	chr{idx}color\n".format(
            seq_id=seq.id, idx=idx, length=len(seq)
        )
    )