Last active
November 14, 2024 11:32
-
-
Save epaule/c012ed4a64d2fc284830d14423fd3da6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python3 | |
# usage: python3 hap_bedgraph.py FASTA > BEDGRAPH | |
import sys | |
import re | |
from Bio import SeqIO | |
ns=re.compile("[Nn]+") | |
for seq_record in SeqIO.parse(sys.argv[1], "fasta"): | |
for m in ns.finditer(str(seq_record.seq)): | |
print(f'{seq_record.id}\t{m.start()}\t{m.end()+1}\t200') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment