Skip to content

Commit

Permalink
Update ViralMSA.py
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd authored Oct 12, 2023
1 parent f459ed3 commit d814daf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ViralMSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@
import subprocess
import sys

# non-standard imports
try:
from Bio import Entrez
except ModuleNotFoundError:
print("ERROR: Unable to import Biopython. Install with: pip install biopython", file=sys.stderr); exit(1)

# useful constants
VERSION = '1.1.35'
VERSION = '1.1.36'
RELEASES_URL = 'https://api.github.com/repos/niemasd/ViralMSA/tags'
CIGAR_LETTERS = {'M','D','I','S','H','=','X'}
DEFAULT_BUFSIZE = 1048576 # 1 MB #8192 # 8 KB
Expand Down Expand Up @@ -986,6 +980,10 @@ def parse_args():

# download reference genome
def download_ref_genome(reference, ref_path, ref_genome_path, email, bufsize=DEFAULT_BUFSIZE):
try:
from Bio import Entrez
except ModuleNotFoundError:
print("ERROR: Unable to import Biopython, which is needed to download a reference genome.\nInstall with: pip install biopython", file=sys.stderr); exit(1)
makedirs(ref_path, exist_ok=True); Entrez.email = email
try:
handle = Entrez.efetch(db='nucleotide', rettype='fasta', id=reference)
Expand Down

0 comments on commit d814daf

Please sign in to comment.