igvteam / igv-reports

Python application to generate self-contained pages embedding IGV visualizations, with no dependency on original input files.
MIT License
347 stars 51 forks source link

INFO field parsing #72

Closed georgiesamaha closed 1 year ago

georgiesamaha commented 1 year ago

Hi,

Thank you for igv-reports, its a great tool. I am currently using it to visualise structural variants and wanted to include some additional INFO fields in the variants table. Using the IGVreports biocontainer v1.6.1 and Singularity, I ran the following:

vcf=/data/Results/sample_recessive.vcf.gz 
bam=/data/Bams/sample_sorted.bam

singularity run -B /data igv-reports_1.6.1--pyh7cba7a3_0.sif \
create_report \
    ${vcf} \
    --genome hg38 \
    --info-columns SVTYPE SVLEN CHR2 END \
    --flanking 1000 \
    --tracks ${vcf} ${bam} \
    --output /data/Results/sample_igvreport.html

However, in the .html report only only the CHROM, POSITION, REF, ALT, ID, SVTYPE, SVLEN, CHR2 columns are filled in for each variant site. I have confirmed the END INFO field is contained within my VCF header and I am correctly naming it:

##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the structural variant">

Are only some INFO fields currently supported? Would appreciate any help on understanding/resolving this :)

jrobinso commented 1 year ago

I think you've hit a special problem with the END property in pysam, it is a bug but doesn't look like its going to be fixed there anytime soon, see https://github.com/pysam-developers/pysam/issues/973. As igv-reports uses pysam to parse VCF the "END" info-column is not visible (to IGV).

jrobinso commented 1 year ago

Also, btw, the suggestion to use "record.stop" for "END" at https://github.com/pysam-developers/pysam/issues/973 does not work reliablity for inter-chromosomal rerrangements, I suspect there is some condition that doesn't allow records.stop to be < record.pos, although there is no such restriction for the "END" info field.

georgiesamaha commented 1 year ago

Ah thank you @jrobinso!