diff --git a/Dockerfile b/Dockerfile index bf6da7c..76783cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" diff --git a/docs/usage.md b/docs/usage.md index 47404f6..dfa898d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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 diff --git a/docs/versioning/exhaustive.md b/docs/versioning/exhaustive.md index 02c5f4a..89f65cc 100644 --- a/docs/versioning/exhaustive.md +++ b/docs/versioning/exhaustive.md @@ -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: diff --git a/tbp_parser/Row.py b/tbp_parser/Row.py index 3455c58..15cc7ed 100644 --- a/tbp_parser/Row.py +++ b/tbp_parser/Row.py @@ -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] diff --git a/tbp_parser/Variant.py b/tbp_parser/Variant.py index 8908388..b568704 100644 --- a/tbp_parser/Variant.py +++ b/tbp_parser/Variant.py @@ -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(): @@ -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.") @@ -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): """