rust-bio / rust-bio-tools

A set of command line utilities based on Rust-Bio.
MIT License
182 stars 24 forks source link

`vcf-report` exits with "thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value'" error #205

Closed hassanfa closed 2 years ago

hassanfa commented 2 years ago

I'm testing out vcf-report with VCF files generated by VarDict, as I was looking for packages/libraries/tools to generate oncoprint plots for our workflow: https://github.com/Clinical-Genomics/BALSAMIC

I followed routine install on MacOS Big Sur: conda create --name rust-bio-tools rust-bio-tools

And ran the following command:

rbt vcf-report fasta.fa --vcfs a=sample1.vcf.gz b=sample2.vcf.gz --bams a:sampleA=sample1.bam b:sampleB=sample2.bam -- oncoprint_example/

The output is quite cryptic and doesn't really tell me what went wrong:

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src/bcf/report/table_report/create_report_table.rs:65:thread '77<unnamed>
' panicked at 'called `Option::unwrap()` on a `None` valuenote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
', src/bcf/report/table_report/create_report_table.rs:65:77

Are there any example files or documentations I can follow to find out what might be wrong?

fxwiegand commented 2 years ago

Thanks for using the vcf-report. I had a quick look and the problems seems to be missing annotations for the vcf files you are using. Currently all vcfs need to be annotated with [VEP] using the options --hgvs and --hgvsg. (https://www.ensembl.org/info/docs/tools/vep/script/vep_options.html). I think we have appropriate error messages if there is a single annotation missing but did not catch the case when there are no annotations at all. I will fix that asap. Let us know if you run into any other problems.

hassanfa commented 2 years ago

@fxwiegand Thank you for swift response. My files are actually VEP annotated. I annotated it once again with --everything option in VEP.

example of a single variant in the VCF

``` 17 7517929 . T G 148 PASS SAMPLE=vitalmoth;TYPE=SN V;DP=1734;VD=25;AF=0.0144;BIAS=2:2;REFBIAS=323:1383;VARBIAS=3:22;PMEAN=13;PSTD=1 ;QUAL=31.9;QSTD=1;SBF=0.60463;ODDRATIO=1.71223;MQ=60;SN=5.25;HIAF=0.0127;ADJAF=0 ;SHIFT3=0;MSI=2;MSILEN=2;NM=1.8;HICNT=21;HICOV=1656;LSEQ=GCCGGGCCAGGCCCCCGGCG;RS EQ=CTCCCCGGAGGAGGAGCCGG;DUPRATE=0;SPLITREAD=0;SPANPAIR=0;CSQ=G|5_prime_UTR_varia nt|MODIFIER|FXR2|ENSG00000129245|Transcript|ENST00000250113|protein_coding|1/17| |ENST00000250113.7:c.-79A>C||257|||||||-1||SNV|HGNC|4024|YES||||CCDS45604.1|ENSP 00000250113|P51116||UPI0000072727||Ensembl||T|T||||||||||||||||||||||||||||||||| ||||||||,G|downstream_gene_variant|MODIFIER|snoU13|ENSG00000251860|Transcript|EN ST00000516051|snoRNA|||||||||||3338|1||SNV|RFAM||YES||||||||||Ensembl||T|T|||||| |||||||||||||||||||||||||||||||||||,G|intron_variant|MODIFIER|SHBG|ENSG000001292 14|Transcript|ENST00000570547|protein_coding||1/5|ENST00000570547.1:c.-62+500T>G |||||||||1||SNV|HGNC|10839||||||ENSP00000458875||I3L1J1&I3L1C1|UPI00024D0A39||En sembl||T|T|||||||||||||||||||||||||||||||||||||||||,G|intron_variant|MODIFIER|FX R2|ENSG00000129245|Transcript|ENST00000571597|protein_coding||1/5|ENST0000057159 7.1:c.-130+180A>C|||||||||-1|cds_end_NF|SNV|HGNC|4024||||||ENSP00000459230||I3L1 Z2|UPI00025A2CEC||Ensembl||T|T|||||||||||||||||||||||||||||||||||||||||,G|intron _variant|MODIFIER|SHBG|ENSG00000129214|Transcript|ENST00000572182|protein_coding ||1/3|ENST00000572182.1:c.-62+500T>G|||||||||1||SNV|HGNC|10839||||||ENSP00000458 816||I3L1G4|UPI00024D0A3C||Ensembl||T|T||||||||||||||||||||||||||||||||||||||||| ,G|intron_variant|MODIFIER|SHBG|ENSG00000129214|Transcript|ENST00000572262|prote in_coding||1/6|ENST00000572262.1:c.-62+500T>G|||||||||1||SNV|HGNC|10839||||||ENS P00000459999||I3L2X4|UPI00024D0A3D||Ensembl||T|T|||||||||||||||||||||||||||||||| |||||||||,G|intron_variant|MODIFIER|SHBG|ENSG00000129214|Transcript|ENST00000574 539|protein_coding||1/6|ENST00000574539.1:c.-62+500T>G|||||||||1||SNV|HGNC|10839 ||||||ENSP00000458181||I3L1C1&B4DYU0|UPI00017A8505||Ensembl||T|T|||||||||||||||| |||||||||||||||||||||||||,G|intron_variant|MODIFIER|SHBG|ENSG00000129214|Transcr ipt|ENST00000575314|protein_coding||1/7|ENST00000575314.1:c.-62+500T>G|||||||||1 ||SNV|HGNC|10839||||||ENSP00000458559||I3L1C1&I3L145|UPI0000EE635C||Ensembl||T|T |||||||||||||||||||||||||||||||||||||||||,G|intron_variant|MODIFIER|SHBG|ENSG000 00129214|Transcript|ENST00000576478|protein_coding||1/4|ENST00000576478.1:c.-62+ 500T>G|||||||||1||SNV|HGNC|10839||||||ENSP00000461133||I3L4B9|UPI00024D0A3B||Ens embl||T|T|||||||||||||||||||||||||||||||||||||||||,G|intron_variant|MODIFIER|SHB G|ENSG00000129214|Transcript|ENST00000576728|protein_coding||1/5|ENST00000576728 .1:c.-62+500T>G|||||||||1||SNV|HGNC|10839||||||ENSP00000459620||I3L2F1|UPI00024D 0A3A||Ensembl||T|T|||||||||||||||||||||||||||||||||||||||||,G|downstream_gene_va riant|MODIFIER|AC007421.1|ENSG00000268503|Transcript|ENST00000593717|protein_cod ing|||||||||||502|1||SNV|Clone_based_ensembl_gene||YES|||||ENSP00000472798|||UPI 000163E4BA||Ensembl||T|T|||||||||||||||||||||||||||||||||||||||||,G|intron_varia nt|MODIFIER|SHBG|6462|Transcript|NM_001289114.1|protein_coding||1/7|NM_001289114 .1:c.-62+500T>G|||||||||1||SNV|EntrezGene|10839||||||NP_001276043.1||||rseq_mrna _match|RefSeq||T|T|||||||||||||||||||||||||||||||||||||||||,G|5_prime_UTR_varian t|MODIFIER|FXR2|9513|Transcript|NM_004860.4|protein_coding|1/17||NM_004860.4:c.- 79A>C||287|||||||-1||SNV|EntrezGene|4024|YES|||||NP_004851.2||||rseq_mrna_match| RefSeq||T|T|||||||||||||||||||||||||||||||||||||||||,G|regulatory_region_variant |MODIFIER|||RegulatoryFeature|ENSR00000090884|promoter||||||||||||||SNV||||||||| |||||||||||||||||||||||||||||||||||||||||||||||| GT:DP:VD:AD:AF:RD:ALD 0/1:1734:25:1706,25:0.0144:323,1383:3,22 ```

Any suggestions that I could try?

FelixMoelder commented 2 years ago

VEP uses the CSQ-field for annotation by default. As the ANN–field is the default for most other tools we also use it for the vcf-report. So, if you have not done this yet you have to set the ANN-field in VEP by adding --vcf_info_field ANN.

PS: I just looked at your example and it indeed shows that the CSQ-field is used. For easy fixing just rerun VEP using the ANN-field. But anyway, we should add an option for setting the annotation field freely.

fxwiegand commented 2 years ago

I just updated the CLI help with the needed VEP option mentioned by @FelixMoelder in #207. This should work until we have added an option for setting the annotation field ourselves.

hassanfa commented 2 years ago

Great! Thank you both for clarifying. After re-annotation, it is working as intended.