Add gene-annotation resource, source-qualified gene matrices, and STAR count+TPM aggregation (v0.2.2) - #18
Conversation
|
Thanks for implementing the main scope of Issue #17. The overall design looks good, and the CI passes on Python 3.10 and 3.11. Before merging, I would like to address the following points. 1. Add a reproducible way to generate
|
|
Thanks for addressing the previous review points. The reference builder, resume/migration tests, STAR validation cases, and serialized TPM-sum validation now look good. I found one remaining blocker in Support unquoted GTF attributesThe current attribute parser requires every GTF attribute to have a quoted value: ATTRIBUTE_RE = re.compile(r'^\s*([^\\s]+)\\s+"([^"]*)"\s*$')However, GENCODE GTF files commonly contain attributes with unquoted numeric values, for example: An otherwise valid exon record such as the following will therefore fail with Because WulfRNA references are expected to be built from GENCODE-style annotations, this would prevent the new builder from working with the intended real-world input. Please either:
The second approach may be simpler and more robust because the builder does not need to validate fields such as Please also add a test containing a realistic GENCODE-style attribute field with: and confirm that the expected After this parser compatibility issue is fixed and CI passes, I think PR #18 will be ready to merge. |
Motivation
GeneNameand enable TPM calculation from STAR counts.salmon_gene_tpm.tsv) while preserving legacy v0.2.x unqualified outputs for compatibility.ReadsPerGene.out.tabacross samples and compute WulfRNA-calculated gene-level TPMs using exon-union lengths and proper stranded-column selection.Description
combined_gene_annotation.tsvand addGeneAnnotationdataclass plusparse_gene_annotationandvalidate_gene_resource_consistencyto enforce presence, uniqueness, and positive exon-uniongene_length_bp.abundance/<quantifier>_gene_expected_counts.tsvandabundance/<quantifier>_gene_tpm.tsvthat includegene_idandGeneName, while still writing legacyabundance/gene_expected_counts.tsvandabundance/gene_tpm.tsvfor v0.2.x compatibility.ReadsPerGene.out.tabtoabundance/star_gene_counts/, validate and aggregate integer counts toabundance/star_gene_counts.tsv, and compute WulfRNA TPMs intoabundance/star_gene_tpm.tsvusing the stranded column selection and exon-union lengths with validation on TPM sums.combined_gene_annotation.tsv; bump package version to0.2.2and updateREADME.md,CHANGELOG.md,CITATION.cff, and docs.Testing
tests/test_aggregation.pycovering transcript aggregation, legacy vs source-qualified output, and STAR stranded-column behavior, and extendedtests/test_reference_validation.pyandtests/test_star_integration.pyto validate the new gene-annotation handling and STAR TPM flow.pytest -qwhich executed the new and updated tests (test_aggregation.py,test_reference_validation.py,test_star_integration.py) and all tests passed.Codex Task