Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sage-wright committed Dec 11, 2024
2 parents 195ed35 + b4a87e2 commit e8087e7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARG TBP_PARSER_VER
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="tbp-parser"
LABEL software.version="2.2.1"
LABEL software.version="2.1.1"
LABEL description="tbp-parser and samtools"
LABEL website="https://github.com/theiagen/tbp-parser"
LABEL license="https://github.com/theiagen/tbp-parser/blob/main/LICENSE"
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ docker pull us-docker.pkg.dev/general-theiagen/theiagen/tbp-parser:2.2.1 #(1)!
The entrypoint for this Docker image is the `tbp-parser` help message. To run this container *interactively*, you can use the following command:

``` bash
docker run -it --entrypoint=/bin/bash us-docker.pkg.dev/general-theiagen/theiagen/tbp-parser:2.2.1
docker run -it --entrypoint=/bin/bash us-docker.pkg.dev/general-theiagen/theiagen/tbp-parser:2.1.1

# Once inside the container interactively, you can run the tbp-parser tool
python3 /tbp-parser/tbp_parser/tbp_parser.py -v
# v2.2.0
# v2.2.1
```

### Locally with Python
Expand Down
3 changes: 1 addition & 2 deletions docs/versioning/exhaustive.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ The following is a list of every version of `tbp-parser` and a short summary of
- Earlier versions are now deprecated and will no longer be supported.
- v2.1.1 - adds the source and comment fields from TBDB to the Laboratorian report; fixes a bug where mmpR5 was not being completly renamed to Rv0678; fixes a bug where mutations that didn't share the same position were being compared
- v2.2.0 - removes ciprofloxacin, fluoroquinolones, and ofloxacin from gyrA and gyrB and aminoglycosides from rrs in the `globals.GENE_TO_ANTIMICROBIAL_DRUG_NAME` dictionary; if a drug is missing in the TBProfiler JSON's gene_associated_drug field that is present in that global dictionary, it will be added for the mutation.
- v2.2.1 - fixes a bug where rifampicin was not being renamed to rifampin and resulted in duplicate rows in the laboratorian report
-

---

The following diagram shows how each version is related to the others without technical details:
Expand Down
1 change: 1 addition & 0 deletions tbp_parser/Row.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ def describe_rationale(self):
if any(rule in self.mdl_interpretation for rule in globals.RULE_TO_RATIONALE.keys()):
interpretation = self.mdl_interpretation[0]
rule = self.mdl_interpretation[1:]
self.logger.debug("rule={}".format(rule))
self.mdl_interpretation = interpretation
self.logger.debug(globals.RULE_TO_RATIONALE[rule])
globals.RULE_TO_RATIONALE[rule]
Expand Down
12 changes: 11 additions & 1 deletion tbp_parser/Variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def extract_annotations(self):
self.logger.debug("VAR:The drug ({}) was not found in the annotation dictionary; adding it with a WHO confidence of 'No WHO annotation'".format(drug))
self.annotation_dictionary[drug] = Row(self.logger, self, "No WHO annotation", drug)

if self.gene_name in globals.GENE_TO_ANTIMICROBIAL_DRUG_NAME.keys():
for antimicrobial in globals.GENE_TO_ANTIMICROBIAL_DRUG_NAME[self.gene_name]:
if antimicrobial not in self.annotation_dictionary.keys():
self.logger.debug("VAR: The drug ({}) was not found in the gene associated drug list; adding it with a WHO confidence of 'No WHO annotation'".format(antimicrobial))
self.annotation_dictionary[antimicrobial] = Row(self.logger, self, "No WHO annotation", antimicrobial, source="Mutation effect for given drug is not in TBDB")


if self.gene_name in globals.GENE_TO_ANTIMICROBIAL_DRUG_NAME.keys():
for antimicrobial in globals.GENE_TO_ANTIMICROBIAL_DRUG_NAME[self.gene_name]:
if antimicrobial not in self.annotation_dictionary.keys():
Expand All @@ -120,6 +127,7 @@ def extract_annotations(self):

self.logger.debug("VAR:The annotation dictionary has all gene associated drugs included; it now has a length of {}".format(len(self.annotation_dictionary)))


else:
# possibilities 1b and 2: the annotation field has no content or the field does not exist
self.logger.debug("VAR:The annotation field has no content or does not exist. Now iterating through gene associated drugs and gene-drug combination dictionary.")
Expand All @@ -134,7 +142,9 @@ def extract_annotations(self):
if antimicrobial not in self.annotation_dictionary.keys():
self.annotation_dictionary[antimicrobial] = Row(self.logger, self, "No WHO annotation", antimicrobial)

self.logger.debug("VAR:{} annotation(s) extracted, now exiting function".format(len(self.annotation_dictionary)))
self.logger.debug("VAR:After iterating through gene_associated_drugs, the annotation dictionary has a length of {}".format(len(self.annotation_dictionary)))

self.logger.debug("VAR:Annotations extracted, now exiting function")

def apply_expert_rules(self, interpretation_destination):
"""
Expand Down

0 comments on commit e8087e7

Please sign in to comment.