Skip to content

Commit

Permalink
optional biopython in vcfanno
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoad committed May 9, 2024
1 parent f085ce3 commit 819760d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cravat/vcfanno.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
import cravat
import vcf
import json
from Bio import bgzf
from cravat.inout import AllMappingsParser
try:
from Bio import bgzf
except ModuleNotFoundError:
bgzf = None
pass

# from vcf_line_processor import VCFLineProcessor

Expand Down Expand Up @@ -396,6 +400,10 @@ def process(self):
self.merge_output()

def vcfanno(args):
try:
from Bio import bgzf
except ModuleNotFoundError:
raise ModuleNotFoundError('vcfanno requires biopython. Try running "pip install biopython".')
input_path = pathlib.Path(args.input_path)
if args.output_path is not None:
output_path = args.output_path
Expand Down

0 comments on commit 819760d

Please sign in to comment.