Skip to content

Commit

Permalink
update minION/BCFtools code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jody Phelan committed Nov 7, 2019
1 parent dfd5130 commit 9b75dc9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
20 changes: 19 additions & 1 deletion scripts/tbprofiler_generate_haplotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,27 @@
from tqdm import tqdm
import sys
import pathogenprofiler as pp


try:
sys.base_prefix
except:
sys.base_prefix = getattr(sys, 'base_prefix', getattr(sys, 'real_prefix', sys.prefix))


def get_conf_dict(library_prefix):
files = {"gff":".gff","ref":".fasta","ann":".ann.txt","barcode":".barcode.bed","bed":".bed","json_db":".dr.json","version":".version.json"}
conf = {}
for key in files:
sys.stderr.write("Using %s file: %s\n" % (key,library_prefix+files[key]))
conf[key] = pp.filecheck(library_prefix+files[key])
return conf



def main(args):
change_field = "change" if args.variant_format=="hgvs" else "_internal_change"
conf = json.load(open(sys.prefix+"/share/tbprofiler/%s.config.json" % args.db))
conf = conf = get_conf_dict(sys.base_prefix + "/share/tbprofiler/%s" % args.db)
drug2genes = defaultdict(set)
gene2drugs = defaultdict(set)
for l in open(conf["bed"]):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setuptools.setup(

name="tbprofiler",
version="2.6.2",
version="2.7.1",
packages=["tbprofiler",],
license="MIT",
long_description="TBProfiler command line tool",
Expand Down
2 changes: 2 additions & 0 deletions tb-profiler
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def main_profile(args):
pp.run_cmd("rm -f %(dir)s/%(prefix)s.targets*.vcf.gz %(dir)s/%(prefix)s*.del_pos.bed %(dir)s/%(prefix)s.*.csi" % vars(args))
if args.platform=="Illumina":
pp.run_cmd("rm %(dir)s/%(prefix)s.targets.delly.bcf" % vars(args))
if args.platform=="minION" or args.caller=="BCFtools":
pp.run_cmd("rm %(dir)s/%(prefix)s.targets.gbcf" % vars(args))
if args.webserver:
html_output = args.webserver_root+"/output/"+args.prefix+".html"
tbp.write_html(results,conf,html_output,extra_columns,["isoniazid","rifampicin","ethambutol","pyrazinamide","streptomycin","ethionamide","fluoroquinolones","amikacin","capreomycin","kanamycin"])
Expand Down
2 changes: 1 addition & 1 deletion tbprofiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from .vcfprofile import *
import os
_ROOT = os.path.abspath(os.path.dirname(__file__))
_VERSION = "2.6.1"
_VERSION = "2.7.1"

0 comments on commit 9b75dc9

Please sign in to comment.