Repository navigation
Deliver indels, and read two SNPs of one codon as one change - #13
Merged
Merged
Conversation
The main VCF holds SNPs only, and of the indels only the homozygous ones reached a filtered file, the legacy var.homo.indel.vcf. A minority indel was in none, and a minority frameshift is how resistance through Rv0678 often starts. CALL_FREEBAYES now writes each sample's indels, normalised, with FILTER PASS where they meet the hom or het rule a SNP has and LowSupport where not; annotated, they are <sample>.<ref>.indels.ann.vcf.gz. INDEL_MATRIX puts the run's indels in <samplesheet>_indel_matrix.tsv: every indel a sample calls with a PASS, its length, gene, effect and HGVS, and per sample the fraction, the depth and the filter, with AF 0 at the anchor's depth where a sample was read without it. The report's matrix panel gains an Indels view, and the legacy split set gains var.het.indel.vcf. Two SNPs in one codon change one amino acid, and annotated a base at a time they name two changes that are not there. GET_MNV runs get_MNV 1.1.5 on each sample's passing SNPs and indels with the BAM they were called on, and reads every codon whole on the reads that span it. MNV_TABLE keeps in <samplesheet>_mnv.tsv the codons at least --mnv_min_reads reads carry whole: get_MNV also writes a combined change for two SNPs of one codon on different molecules, which no read carries. With it, the SNP matrix gains codon_change and codon_change_samples. On reads simulated from H37Rv, rpoB codon 445 reads His445Glu on 103 of 104 reads (base by base, His445Asp and His445Gln), a pair in codon 460 on 23% of the reads reads Glu460Leu where its first base alone says a stop, and two SNPs of codon 430 on different molecules stay two changes. get_MNV runs in its bioconda image, pinned by digest, until the pipeline image is rebuilt with it; the Dockerfile now installs it. The report read single-base records only, so every SNP FreeBayes wrote as an MNP (CAC>GAG: two changes of one codon on the same reads) was in the SNP matrix and in none of the report's tables. It now reads such a record as the SNPs it is made of.
The first real run of GET_MNV failed on every sample. get_MNV writes its VCF and indexes it with tabix, which the bioconda image it runs in does not carry, so it warned, skipped the index and exited 0, and Nextflow failed the task over the .tbi it had been told to expect. A stub run touches every declared output, so only a real run could see it; an end-to-end run did. The VCF is now published bgzipped and unindexed (tabix -p vcf indexes it as it is), and the codon table the run reads never used the index.
5 of 6 tasks
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Two things the pipeline did not deliver: its indels, and the amino-acid change of a codon that carries more than one SNP.
Indels. The main VCF holds SNPs only, and of the indels only the homozygous ones reached a filtered file (the legacy
var.homo.indel.vcf). A minority indel was in none, and a minority frameshift is how resistance through Rv0678 often starts. Indels now get the definition a SNP has: each sample's<sample>.<ref>.indels.ann.vcf.gzkeeps every indel FreeBayes made, normalised, withFILTERPASSwhere it meets the hom or het rule andLowSupportwhere not, so a minority call keeps its fraction instead of vanishing.<samplesheet>_indel_matrix.tsvholds the run's indels the way the SNP matrix holds its SNPs, and the report's matrix panel gains an Indels view with frameshifts marked.Codon-level changes, with get_MNV. Two SNPs in one codon change one amino acid, and annotated a base at a time they name two changes that are not there.
GET_MNVruns get_MNV 1.1.5 on each sample's passing SNPs and indels with the BAM they were called on, and reads every codon whole on the reads that span it. get_MNV also writes a combined change for two SNPs of one codon on different molecules, which no read carries, so<samplesheet>_mnv.tsvkeeps only the codons at least--mnv_min_readsreads carry whole. The SNP matrix gainscodon_change/codon_change_samples, and the report marks those SNPs and their cells.On reads simulated from an H37Rv window (rpoB + Rv0678), called with FreeBayes and annotated with SnpEff:
MNV-masked)The same run's indel matrix: Rv0678 c.144dupC p.Glu49fs, c.301delG p.Ala101fs at AF 0.1852, and c.402_404delACG p.Arg135del at AF 0.8061; the sample without them reads AF 0 at the anchor's depth.
A report fix on the way. The report read single-base records only, so every SNP FreeBayes wrote as an MNP (CAC>GAG in one record) was in the SNP matrix and in none of the report's tables. It now reads such a record as the SNPs it is made of.
Outputs and defaults
<sample>.<ref>.indels.ann.vcf.gz(+.tbi;indels.vcf.gzwith--annotate_main_vcf false),var.het.indel(.ann).vcfin the legacy split set, andmnv/with get_MNV's TSV, VCF, summary and run manifest.<samplesheet>_indel_matrix.tsvand<samplesheet>_mnv.tsv.<samplesheet>_snp_matrix.tsvgains two columns afteraa_change,codon_changeandcodon_change_samples, when get_MNV runs. Anything that reads that file by column position needs to account for them; with--run_mnv falsethe layout is unchanged.--make_indel_matrix,--run_mnv,--mnv_min_reads 2,--mnv_gff_features CDS,--mnv_translation_table 11,--mnv_container.GET_MNV(per sample, 2 CPUs, 2 GB),MNV_TABLE,INDEL_MATRIX, each with a stub.GET_MNVruns inquay.io/biocontainers/get_mnv1.1.5, pinned by digest, until the pipeline image carries it. The Dockerfile now installsget_mnv=1.1.5, but this PR publishes no image (docker-publishruns on a version tag); after the next release, bumpparams.containerand empty--mnv_container. The Singularity profiles keep thedocker://scheme and thedockerprofile strips it, as for the main image.main, so the first launch after the merge runsGET_MNVand pulls its image from quay.io.How it was verified
GET_MNVscript with a gzipped and a plain GFF (2), and the get_MNV image's scheme per profile (1).-profile test_fullreaches the three new processes.Checklist
tests/run_tests.shpasses locally (all four legs)ruff check .is clean, and I did not restyle code the change does not touchmodules/has astub:block, and-profile test_fullreaches ittests/data/was not edited by hand (fixtures come frommake_test_data.py)CHANGELOG.mdentry and, where relevant, a docs update