diff --git a/tb-profiler b/tb-profiler index beb3729..8701154 100644 --- a/tb-profiler +++ b/tb-profiler @@ -8,7 +8,6 @@ import json import tbprofiler as tbp import os import csv -from datetime import datetime from uuid import uuid4 import glob import atexit @@ -198,9 +197,6 @@ def main_update_tbdb(args): pp.run_cmd(f"git checkout {args.commit}") if args.prefix==None: - if args.branch == "master": - args.prefix = "tbdb" - else: args.prefix = args.branch @@ -517,7 +513,7 @@ parser_sub.set_defaults(func=main_load_library) parser_sub = subparsers.add_parser('update_tbdb', help='Pull the latest tbdb library and load', formatter_class=ArgumentDefaultsRichHelpFormatter) parser_sub.add_argument('--prefix','-p',help='Database name') parser_sub.add_argument('--repo','-r',default="https://github.com/jodyphelan/tbdb.git",help='Repository to pull from') -parser_sub.add_argument('--branch','-b',default="master",help='Branch to pull from') +parser_sub.add_argument('--branch','-b',default="tbdb",help='Branch to pull from') parser_sub.add_argument('--commit','-c',help='Git commit hash to checkout (default: latest)') parser_sub.add_argument('--match_ref',type=str,help='The prefix for all output files') parser_sub.add_argument('--dir','-d',default=".",help='Storage directory') diff --git a/tbprofiler/__init__.py b/tbprofiler/__init__.py index b8ce298..b0c07d0 100644 --- a/tbprofiler/__init__.py +++ b/tbprofiler/__init__.py @@ -7,4 +7,4 @@ from .snp_dists import * from .phylo import * -__version__ = "6.1.0" +__version__ = "6.2.0" diff --git a/tbprofiler/docx.py b/tbprofiler/docx.py index 21600e6..21a03fb 100644 --- a/tbprofiler/docx.py +++ b/tbprofiler/docx.py @@ -1,7 +1,6 @@ import sys from docxtpl import DocxTemplate from collections import defaultdict -import datetime def sanitize(d): diff --git a/tbprofiler/models.py b/tbprofiler/models.py index dc25f61..9a30d77 100644 --- a/tbprofiler/models.py +++ b/tbprofiler/models.py @@ -111,7 +111,7 @@ def get_qc(self): else: text = "Not available for VCF input" return text - + def get_missing_pos(self,sep="\t"): if isinstance(self.qc, (BamQC,)): text = dict_list2text(self.qc.missing_positions,mappings={"pos":"Genome Position","annotation.gene":"Gene","annotation.variant":"Variant", "depth":"Depth"},sep=sep) diff --git a/tbprofiler/phylo.py b/tbprofiler/phylo.py index 35a8e82..11da7e3 100644 --- a/tbprofiler/phylo.py +++ b/tbprofiler/phylo.py @@ -9,7 +9,7 @@ import argparse def usher_add_sample(args: argparse.Namespace) -> None: - logging.info(f"Adding sample to phylogeny") + logging.info("Adding sample to phylogeny") if args.vcf: @@ -54,7 +54,7 @@ def generate_low_dp_mask(bam: str,ref: str,outfile: str,min_dp: int = 10) -> Non for p in range(length): if (chrom,p) not in ok_positions: missing_positions.append((chrom,p)) - + # write missing positions to bed file with open(outfile,"w") as O: for x in missing_positions: diff --git a/tbprofiler/reformat.py b/tbprofiler/reformat.py index e2d706e..84edcc9 100644 --- a/tbprofiler/reformat.py +++ b/tbprofiler/reformat.py @@ -225,7 +225,7 @@ def create_resistance_result( main_lineage, sub_lineage = get_main_lineage(lineage) drtype = get_drtypes(dr_variants) pipeline = Pipeline( - software_version=args.version, + software_version=args.version, db_version=args.conf['version'], software=[{'process':k,'software':v} for k,v in shared_dict.items()] )