Skip to content
Snippets Groups Projects
Commit 2cc768ee authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Port to pysam >= 0.14

parent d1ed737c
No related branches found
No related tags found
1 merge request!7Svtyper parallel
......@@ -7,7 +7,7 @@ import re
import multiprocessing
from functools import partial
from pysam import Fastafile
from pysam import FastaFile
def eprint(*args, **kwargs):
......@@ -15,14 +15,14 @@ def eprint(*args, **kwargs):
def get_chromosomes(fastafile):
with Fastafile(fastafile) as fasta:
with FastaFile(fastafile) as fasta:
chromosomes = fasta.references
return chromosomes
def find_chrom_Nstretches(chrom, fastafile, cutoff):
p = re.compile("N{%s,}" % cutoff)
with Fastafile(fastafile) as fasta:
with FastaFile(fastafile) as fasta:
sequence = fasta.fetch(chrom)
gaps = [(chrom, m.start(), m.end() + 1) for m in re.finditer(p, sequence)]
return gaps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment