Skip to content

Commit

Permalink
Merge pull request #336 from jodyphelan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jodyphelan committed Mar 23, 2024
2 parents 5c308bc + 55d416b commit 5a539e3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions tb-profiler
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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')
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 .snp_dists import *
from .phylo import *

__version__ = "6.1.0"
__version__ = "6.2.0"
1 change: 0 additions & 1 deletion tbprofiler/docx.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
from docxtpl import DocxTemplate
from collections import defaultdict
import datetime


def sanitize(d):
Expand Down
2 changes: 1 addition & 1 deletion tbprofiler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tbprofiler/phylo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tbprofiler/reformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
)
Expand Down

0 comments on commit 5a539e3

Please sign in to comment.