Skip to content

A8: locus IDs with commas - #12

Merged
TejusK123 merged 2 commits into
refactoringfrom
a8-comma-ids
Oct 19, 2026
Merged

TejusK123 merged 2 commits into
refactoringfrom
a8-comma-ids

Conversation

@TejusK123

Copy link
Copy Markdown
Owner

A8: locus IDs with commas

Since B1, AutoDeep infer stopped on any miRDeep2 run whose contig names contain commas, as NCBI RefSeq names often do. The S. frugiperda (FAW) training run is one: "145 loci from result.csv are not in output.mrd".

Cause. init_data.py removes every comma from result_*.csv before reading it, but output.mrd keeps miRDeep2's IDs, e.g. ..._chromosome_8,_ZJU_Sfru_1.0,_whole_genome_shotgun_sequence_12098. The pypdf code worked only because miRDeep2 leaves the commas out of the PDF file names.

Fix.

  • mrd.py: new strip_commas(). parse_mrd() uses it on every locus ID and raises an error if two IDs become identical without their commas.
  • init_data.py: uses the same strip_commas() on result_*.csv, so both files follow one rule.
  • AutoDeep.sh: removed step 4, which renamed PDFs in the working folder (nothing has read PDFs since B1), along with its TODO: Do the same filename cleanup for .mrd file, which this PR resolves. The steps are now numbered 1/4 to 4/4.

Output IDs have no commas, as before B1, so runs without commas give byte-identical output. No feature, label or Methods text changes, so there is no METHODS_CHANGES.md entry. reanalysis.py imports none of the changed code, so its numbers cannot move.

Tests (written first; all six new checks failed before the fix)

  • tests/test_mrd.py: parse_mrd removes the commas from IDs, and rejects two IDs that are identical without them.
  • tests/test_example.py: every tutorial test now also runs on a copy whose contig name has a comma added in both files (chrII: becomes chrII,:). The output must equal the expected xgboost_judgement.csv exactly. Runs in CI.
  • tests/test_ids_with_commas.py (local; skipped without AUTODEEP_TEST_RUN, as in CI): AutoDeep infer on a copy of the FAW run gives all 145 rows of original_data_FAW.csv with the same 5' homogeneity and num_locis.

Other check (local, not a test). On FAW, every other feature also equals the training rows (145/145), folding energy included. The two exceptions are the overhangs (Bot 108/145, Top 70/145, 23 blank), which differ because B3 redefined them.

Results. Locally, with the testing folder: 136 passed. CI: see the checks below.

folding_properties.parse_mrd_file() (entropy features, never called) still keeps commas. It is left alone because it is not part of the pipeline.

🤖 Generated with Claude Code

TejusK123 and others added 2 commits October 18, 2026 22:00
parse_mrd must drop commas from IDs and reject IDs that collide without them;
the tutorial run with a comma in its contig name and the local FAW run must
go through AutoDeep infer. Mark A8 in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….csv

One shared strip_commas() in mrd.py; parse_mrd raises if two IDs collide.
Drop AutoDeep.sh's PDF-renaming step, unused since B1, and its TODO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TejusK123
TejusK123 merged commit ff78f66 into refactoring Oct 19, 2026
2 checks passed
@TejusK123
TejusK123 deleted the a8-comma-ids branch October 19, 2026 03:05
TejusK123 added a commit that referenced this pull request Oct 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant