Repository navigation
Count the pseudogenes AMAP called in each sample in the report's chart - #67
Merged
Merged
Conversation
The report's Pseudogene Detection chart counted the genes flagged by Mycobrowser's Is_Pseudogene or AMAP's pseudogene column, summed by lineage under a Mycobrowser title, so CDC1551 showed 129 where AMAP calls 123, a lineage with none dropped out and a lineage with more samples looked as if it had more. REPORT_INPUTS now gives each master table row the sample it is from, and the chart draws every sample at the number AMAP called, the QC table's, a sample with none at 0, with a table of the counts beside it. The master table explorer shows the note that says why a gene is a pseudogene, and tests/test_report_pseudogenes.py runs the chained steps and the section's own R code.
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 was wrong
The report's Pseudogene Detection section (
bin/report/report_AMAP.Rmd, chunkpseudogenes) kept the master-table genes flagged in Mycobrowser'sIs_Pseudogeneor in AMAP'spseudogenecolumn, counted them per lineage and titled the chart "Pseudogenes per Lineage (Mycobrowser annotation)". Its text described them as genes without a stop codon.Is_Pseudogenesays which genes are pseudogenes in H37Rv, not in the sample. CDC1551 alone came out at 129, where AMAP calls 123 and the QC table (after Count the pseudogenes AMAP called in the QC table聽#58) says 123; the other 6 are genes Mycobrowser marks that CDC1551 has intact: Rv0947c, Rv1150, Rv2023A, Rv2098c, Rv3021c, Rv3324A.Is_Pseudogeneis empty, so the chart showed AMAP's calls under a Mycobrowser title.count()over the flagged rows left out a lineage with none.Measured on real data: the benchmark's FIX_CDS outputs through the rendered scripts of GET_OUTPUTS, GET_COUNT and REPORT_INPUTS in
paururo/amap:latest, then the chunk.pseudogene_countin the QC table)--skip_mycobrowserL4's 296 is 129 + 129 + 13 + 25 added up over four genomes, though per genome M. bovis has the most.
What changed
modules/local/freport.nf) puts the sample each master-table row is from, the name its file carries, in a firstsamplecolumn ofinput_mastertables.txt, as it already does for the QC tables. The master tables GET_OUTPUTS publishes are unchanged.pseudogene == "yes", AMAP's own call and what the QC table counts, per sample within each lineage, a sample with none at 0: a box per lineage and each sample as a point (jittered sideways only) on an axis from 0, titled "Pseudogenes AMAP Called per Sample". A "Per Sample" tab lists the counts. When no sample has any, the section says so and the table shows every sample at 0.notecolumn gives the reason, and that Mycobrowser'sIs_Pseudogeneis not counted. The em-dash is gone.notenext topseudogene, so the reason is in the report.bin/report/demo/make_demo.pywrites the newsamplecolumn; its other tables and its random draws are unchanged.docs/user-guide/report.mdand its page, a CHANGELOG bullet under Correctness and one under Testing (694 tests),docs/about/changelog.htmlrebuilt.Tests
tests/test_report_pseudogenes.py(12) chains the steps after the correction astests/test_sample_ids.pydoes, with four samples (two in L2 with 2 pseudogenes each, one in L4 with none, one in NA with 3) and Mycobrowser marking Rv0001, intact in every sample, with Mycobrowser on and off. It checks that REPORT_INPUTS' rows carry their sample, then runs the section's own R code with thereport_tablesharness: each sample at the number AMAP called, equal to the QC table's, a sample with none at 0, a title that names AMAP and not Mycobrowser, and every sample at 0 when none has any.samplecolumn; the chunk's table islineage, n(with Mycobrowser L2 6, NA 4, L4 1; without it L2 4, NA 3 and no L4); the title names Mycobrowser; with no pseudogene and no Mycobrowser it builds no table at all.python:3.9-slimwithrequirements-test.txt): the chained tests pass and the R ones skip, as on CI.tools/build_docs.py --checkandtools/check_site.pyon Python 3.11 pass.Not changed
docs/examples/demo_report.html: rendered again from the demo data it also changes in eight sections touched by earlier report fixes (Count every sample in the report's genes not in the reference聽#50, Plot every COG category in the report's figures聽#54, Count a category a sample has no gene in as 0 in the report聽#61), so refreshing the example and the site's pictures of it is left for a change of its own.