Bioconductor / VariantAnnotation

Annotation of Genetic Variants
https://bioconductor.org/packages/VariantAnnotation
23 stars 20 forks source link

Incorrect added ##FILTER line when none are present. #42

Closed FreekManders closed 2 years ago

FreekManders commented 4 years ago

When no ##FILTER line is present in the header of a vcf, then a DataFrame with 1 row and 1 column is added to the header of the vcf. This results in the following line being written when writing out the vcf: ##FILTER=All filters passed This incorrectly written line causes igv to crash when loading in a vcf. When other ##FILTER lines are present the line that gets written out is: ##FILTER=<ID=PASS,Description="All filters passed">

This issue arises because of line 186 of the methods-writeVcf.R file. Changing the line to this would probably fix this issue: } else if(ncol(df) == 1L && nrow(df) == 1L && nms != "FILTER") {

I've added a minimal example vcf file here: example_vcf.txt

Session info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] MutationalPatterns_1.12.0         NMF_0.22.0                        cluster_2.1.0                    
 [4] rngtools_1.5                      pkgmaker_0.31.1                   registry_0.5-1                   
 [7] BSgenome.Hsapiens.UCSC.hg19_1.4.0 BSgenome_1.54.0                   rtracklayer_1.46.0               
[10] ggbeeswarm_0.6.0                  VariantAnnotation_1.32.0          Rsamtools_2.2.3                  
[13] Biostrings_2.54.0                 XVector_0.26.0                    SummarizedExperiment_1.16.1      
[16] DelayedArray_0.12.3               BiocParallel_1.20.1               matrixStats_0.56.0               
[19] Biobase_2.46.0                    GenomicRanges_1.38.0              GenomeInfoDb_1.22.1              
[22] IRanges_2.20.2                    S4Vectors_0.24.4                  BiocGenerics_0.32.0              
[25] forcats_0.5.0                     stringr_1.4.0                     dplyr_1.0.0                      
[28] purrr_0.3.4                       readr_1.3.1                       tidyr_1.1.0                      
[31] tibble_3.0.1                      ggplot2_3.3.1                     tidyverse_1.3.0