Repository navigation
B3: signed 3' overhangs at both duplex ends, from output.mrd (duplex rule) - #11
Merged
Merged
Conversation
"3' Overhang Bot" (Drosha end) and "3' Overhang Top" (Dicer end) are now signed (+2 canonical, 0 blunt, negative a 5' overhang) and computed by miRDeep2's find_star rule from the observed star and pri_struct in output.mrd, with no refold. They are blank for loci without star reads. Previously Bot was abs(right - left) on AutoDeep's own fold and Top came from a padding heuristic. Q3 answered (Tejus, 18 Oct 2026). Training data keep the old values until B8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…x rule) Tejus chose the duplex rule over miRDeep2's expected-star rule: only mature-star base pairs count (Drosha and Dicer cut off the flanks and loop). At each end, the overhang is the unpaired nucleotides beyond the terminal pair on the 3'-end strand minus those on the 5'-end strand. Unlike miRDeep2's rule, it ignores mature pairs with the loop and gives the same value whichever strand is the mature. The rules differ on 10 of 148 Pomonella loci with star reads; labels are unchanged for all of them. METHODS_CHANGES.md (B3) records the definition and the reasons for the paper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TejusK123
added a commit
that referenced
this pull request
Oct 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
B3: signed 3' overhangs at both duplex ends, from output.mrd (duplex rule)
Implements B3 in
review/REVISIONS.md, with Tejus's answer to Q3 (18 Oct 2026, written under Q3).What changes
Before:
folding_properties.pycomputed "3' Overhang Bot" asabs(right - left), the unsigned difference between the unpaired 5' and 3' ends of AutoDeep's own RNAfold structure of the precursor, and "3' Overhang Top" with a padding heuristic. Both were computed even for loci without star reads.Now: both come from miRDeep2's
output.mrd(mrd.overhangs), by the duplex rule:obsline, the most abundant star read), which is the starresult.csvreports. The structure ispri_struct, the one miRDeep2 used. Nothing is refolded (Tejus: miRDeep2's ViennaRNA is current).Why not miRDeep2's expected-star rule. The first version of this PR used miRDeep2's rule (
find_star: 2 plus the observed star's offset from the star miRDeep2 expects). Tejus chose the duplex rule instead. The reasons, numbers and caveats for the paper are inreview/METHODS_CHANGES.md(B3, "For the paper"). In short:The two rules differ on 10 of 148 Pomonella loci with star reads; those loci are listed in METHODS_CHANGES.md.
Effect
C. pomonella run (212 loci;
AutoDeep inferon a copy, compared with the pre-B3 run of the same data):refactoringare worse for loci without star reads.miRDeep2 tutorial example: its one novel locus has star reads and stays 2/2, so
examples/mirdeep2_tutorial/expected/xgboost_judgement.csvis unchanged.Reanalysis (
review/reanalysis.pyontraining_data_pre/and the shipped model): unchanged, identical toreview/reanalysis_osx-arm64.txt. That is expected: the training CSVs are not rebuilt until B8.Training data:
training_data_pre/keeps the old values until B8. Until then,AutoDeep train -ton new runs mixes the old and new definitions.Tests
These were written first and failed on the earlier code:
tests/test_overhangs_pipeline.py: runsfolding_properties.pyand inference on two synthetic loci with a known structure. The pre-B3 code wrote1, 1for a star that leaves 1-nt 5' overhangs (correct:-1, -1) and2, 2for a locus without star reads (correct: blank). Inference accepts the blanks.tests/test_mrd_overhangs.py, duplex rule. These three failed on the miRDeep2-rule version:QFTL02000135.1_4908): miRDeep2's rule gave -1, the duplex rule 3;QFTL02000007.1_25533): miRDeep2's rule gave 2, the duplex rule -3.The rest of
tests/test_mrd_overhangs.py:tests/data/mirgenedb_hsa_ten.csv, ViennaRNA 2.7.0 folds). Seven give 2 at both ends. Let-7-P2a1 and Mir-145 give 1 at the Drosha end and Mir-21 gives 3 at the Dicer end, as their folds show. The values are the same under both rules;result.csv's consensus star, and the overhangs are blank exactly when the star read count is 0.Other test files:
tests/test_mrd.py:parse_mrdkeepsobs,pri_seqandpri_struct.tests/test_mrd_parity.py(Pomonella, local): the other features still equal the training data; the overhangs the pipeline writes equalmrd.overhangs; the predictions equal the shipped model's on the training features with the new overhangs.Local run with
AUTODEEP_TEST_RUNset to the Pomonella run: 130 passed.For Tejus
review/METHODS_CHANGES.md: paste the old sentences that define the overhangs (Methods and Table 1). The new text and the "For the paper" notes are written.tests/data/mirgenedb_hsa_ten.csvholds ten MirGeneDB sequences and their arm annotations. MirGeneDB's site states no licence; please confirm they can be in a GPL-3.0 repository.🤖 Generated with Claude Code