PharmGKB / PharmCAT

The Pharmacogenomic Clinical Annotation Tool
Mozilla Public License 2.0
120 stars 39 forks source link

Feature request to bypass BadOutsideCallException for bad outside call #192

Closed songx closed 3 weeks ago

songx commented 4 weeks ago

feature

reporter.BadOutsideCallException when outside CYP2D6 genotype call is an invalid format. ex. 4/4/*5

N/A

Is it possible to assign something like "Bad Outside Call" to the gene genotype with bad outside genotype call instead of stopping the pipeline?

I still would like get PharmCat reporter output for other genes that does not have a bad outside call genotype input

whaleyr commented 4 weeks ago

What, logically, do you mean with that format? Does this sample have three strands for chromosome 22?

songx commented 4 weeks ago

Hi,

That is a wrong D6 genotype from a D6 genotyping tool that is no longer being supported. My pipeline feeds outside calls directly from genotyping tool to pharmcat so I was wondering if possible to not crash the pipeline if the outside genotype call is wrong or invalid.

whaleyr commented 4 weeks ago

Understood. We will bring it up for internal discussion.

markwoon commented 4 weeks ago

@songx What is your expectation when PharmCAT gets invalid data like this?

We would rather alert users earlier rather than later so that problems can be fixed instead of it being missed and becoming a problem later. This would be extra challenging if you're using it to process many samples and have to wait for the end to realize there's a problem with your input.

In this specific case, we also think that the surprise of not having CYP2D6 results in the reporter (if we just ignored the invalid input) is a bigger problem that refusing to process the data.

I would suggest that you should fix the input to PharmCAT. We want to try to accommodate different data syntaxes, but for outside calls, we ask for valid data.

I'm not sure what problems you're having with your D6 genotyper, but you could translate *4,*4 to *4x2 and that would be valid for PharmCAT.

We won't be making this change. The code downstream of this expects valid data and we don't have resources at this time change this behavior and fully test it. It would be simpler to just drop the offending outside call, but again, this means that it would disappear from the result, and that's not acceptable either.

songx commented 4 weeks ago

Hi @markwoon

Thanks for taking the time, totally understand.

If I want to implement a script to check if my outside genotype calls are valid for Pharmcat, do you have any suggestions? Is there a list of valid genotypes for Pharmcat?

whaleyr commented 4 weeks ago

@songx It's pretty simple. If it's a "standard" diploid gene then it contains only one / to separate two allele names. If it's a monoploid or optionally monoploid gene (e.g. G6PD, MT-RNR1) then no / is required. Having more than one / in a diplotype is always an error.

It will accept any allele names but if they're not one that on our valid alleles list then it won't match to any phenotype or recommendation.

markwoon commented 3 weeks ago

Full list of all valid values in outside calls fiel: https://pharmcat.org/Phenotypes-List. You can also download it all as a tsv file.

You get to this page by clicking on the genes in the link Genes & Drugs page

There's a bug right now where HLA genes aren't being included, but that'll be fixed soon.