Repository navigation
Draw each reference's own genes under its own samples - #10
Merged
Merged
Conversation
The report's GFF reader took a placeholder written as data for a name and merged genes by name. A GFF built from a table writes pandas' NaN as Name=nan: on one of the cohort's references 3,001 of 3,989 genes became a single gene called nan, so the genome landscape, the variable-genes table and go-to-gene knew 988 genes, and the per-gene depth tables named the rest nan. A placeholder (nan, NA, '.') is now read as no name, as the gene-conversion annotation already does, and the name falls through to the locus tag or the ID. A RefSeq GFF names every CDS after its protein, so each gene of H37Rv came back twice, as dnaA and as NP_214515.1. A CDS whose Parent is a gene of the file is now that gene, a gene and a same-named CDS that overlap stay one, and genes that share a name at different places stay two.
The report took the GFF, the masked regions and the length of the first reference of the run for the whole genome page. On a cohort mapped against two assemblies, the second one's samples were drawn over the first one's genes, and its variable-genes table, go-to-gene, masked regions and genome insights were the first one's too. Every reference's GFF, masked regions and FASTA index now reach the report (--ref-gff, --ref-mask, --ref-fai), and it builds one genome per reference: its length, genes and masked regions, placed contig after contig in the index's order, as its samples' profiles are binned. The genome page shows one reference at a time, opening on the one most samples were mapped to, with a button for each; clicking a deletion opens its reference, go-to-gene finds a gene in any of them, a sample's own profile uses its own reference, and the SNP density per Mb divides by it. A single-reference report looks as it did.
Nextflow 26's strict parser reads per_ref(gffs) as a call to a function named per_ref, which a closure held in a variable is not, so every run stopped before it started; Nextflow 24 took it. The pairing is now refPairs in utils.nf, beside the other helpers.
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
The report's genome page took the GFF, the masked regions and the length of the first reference of the run for every sample. On the 185-sample cohort mapped against two assemblies, E1ASM0057's 72 samples were drawn over E1ASM0035's genes. The variable-genes table, go-to-gene, the masked regions and the callability insight all came from E1ASM0035.
--ref-gff,--ref-mask,--ref-fai, asREF=path). The report builds one genome per reference: its length, genes and masked regions, placed contig after contig in the index's order, as its samples' profiles are binned.Reading those GFFs also turned up two faults of the report's GFF reader:
Name=nan. The reader took it for a name and merged genes by name, so on E1ASM0035 3,001 of 3,989 genes became one gene callednan: the landscape knew 988 genes, and the per-gene depth tables named the restnan. A placeholder (nan,NA,.) is now read as no name, as the gene-conversion annotation already does.dnaAandNP_214515.1). A CDS whoseParentis a gene of the file is now that gene. Genes that share a name at different places stay two.Name=nan)Outputs and defaults
QC_REPORTtakes every reference's GFF, repeat/exclude list and FASTA index instead of the first reference's GFF and list.qc_report.pyhas new options--ref-gff,--ref-maskand--ref-fai. With them,--gffand--mask-bedare not used. Both still work for a report made by hand.genomes(one entry per reference). The top-levelgenes,mask_*andgenome_lenhold the reference with the most samples, so a single-reference report reads as before.gene_depth.tsvtables fall back to the locus tag or the ID where the GFF writesName=nan.How it was verified
The cohort's report was re-rendered with both references' real GFFs and indexes and opened in headless Chrome: E1ASM0035 shows its 113 samples over 4.41 Mb, E1ASM0057 its 72 over 4.35 Mb, each with its own variable genes. Switching between them works, and there are no console errors.
Not run here: the Nextflow step that pairs each reference with its files. CI's stub run checks the wiring but not the script, which runs on the cluster.
Checklist
tests/run_tests.shpasses locally (unit, js and lint; the pipeline leg in CI)ruff check .is clean, and I did not restyle code the change does not touchmodules/has astub:block (not applicable: no new process)tests/data/was not edited by hand (fixtures come frommake_test_data.py)CHANGELOG.mdentry and, where relevant, a docs update