Last active
January 4, 2016 21:09
-
-
Save afrendeiro/8678567 to your computer and use it in GitHub Desktop.
Make tab-delimited chromossome size file from fasta genome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from Bio import SeqIO | |
fastagenome = "data/oikopleura/assembly/Oikopleura_reference_unmasked_v3.0.fa" | |
output = "data/oikopleura/assembly/Oikopleura_reference_chrSizes.tsv" | |
myfile = open(output, "wb") | |
spamwriter = csv.writer(myfile, delimiter='\t', quoting=csv.QUOTE_MINIMAL) | |
for seq_record in SeqIO.parse(fastagenome, "fasta"): | |
spamwriter.writerow([str(seq_record.id) , str(len(seq_record))]) | |
myfile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment