Skip to content

Commit

Permalink
prevent blastn from phoning home
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Apr 8, 2022
1 parent a231648 commit f61492e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions platon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def setup(args):
"""Test environment and build a runtime configuration."""
# runtime configurations
global env, threads, verbose
env['BLAST_USAGE_REPORT'] = 'false' # prevent BLAST from contacting NCBI

threads = args.threads
log.info('threads=%i', threads)
verbose = args.verbose
Expand Down
6 changes: 4 additions & 2 deletions platon/functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import subprocess as sp
from pathlib import Path

import platon.config as cfg
import platon.constants as pc
Expand Down Expand Up @@ -116,6 +115,7 @@ def search_inc_type(contig):
proc = sp.run(
cmd,
cwd=str(cfg.tmp_path),
env=cfg.env,
stdout=sp.PIPE,
stderr=sp.PIPE,
universal_newlines=True
Expand Down Expand Up @@ -281,7 +281,7 @@ def search_reference_plasmids(contig):
"""Search for reference plasmid hits."""

# Reduce blastn word size to overcome segmentation faults due to too many HSPs.
blast_word_size = int(contig['length'] / 100)
blast_word_size = int(contig['length'] / 1000)
if(blast_word_size < 11):
blast_word_size = 11

Expand All @@ -302,6 +302,7 @@ def search_reference_plasmids(contig):
proc = sp.run(
cmd,
cwd=str(cfg.tmp_path),
env=cfg.env,
stdout=sp.PIPE,
stderr=sp.PIPE,
universal_newlines=True
Expand Down Expand Up @@ -363,6 +364,7 @@ def search_orit_sequences(contig):
proc = sp.run(
cmd,
cwd=str(cfg.tmp_path),
env=cfg.env,
stdout=sp.PIPE,
stderr=sp.PIPE,
universal_newlines=True
Expand Down

0 comments on commit f61492e

Please sign in to comment.