Skip to content

Test Suite#234

Open
Jeevesh28 wants to merge 12 commits intomasterfrom
test-suite
Open

Test Suite#234
Jeevesh28 wants to merge 12 commits intomasterfrom
test-suite

Conversation

@Jeevesh28
Copy link
Copy Markdown
Contributor

@Jeevesh28 Jeevesh28 commented Mar 17, 2026

Add:

  • Test suite with SARS-CoV-2 data and gold standard
Goal Command
Single test make test-prepare-reference
make test-calculate-expression
make test-calculate-expression-ci
make test-simulate-reads
All tests, stop on first failure make test
All tests, run all and report at end make test-all

   - Replace boost::random with std::random
   - Replace boost::math::normal/cdf with std::erf-based implementation
   - Update Makefile: -std=c++17, remove BOOST
   - Fix C++11/17 compatibility in buildReadIndex, SingleHit, PairedEndHit
   - Remove boost dependencies in bed2vector and bamread files
   - Replace hash_map and hash_set
- Add Makefile test targets: test-prepare-reference, test-calculate-expression, test-simulate-reads
- Add test-all for CI (continue on failure)
- Add generate-gold target to regenerate gold standard
- Use SARS-CoV-2 reference (sarscov2.fasta, sarscov2.gtf) and reads
- Gold includes: reference (.grp, .ti), expression (genes.results, isoforms.results, stat/), simulated (fq, sim.isoforms.results, sim.genes.results)
- TEST_THREADS=4, TEST_SEED=0, N=1000 for reproducibility
- Add tests/output/ to .gitignore
   - Boost-compatible RNG for reproducible results
- Copy all rsem-prepare-reference outputs to gold (grp, ti, chrlist,
  idx.fa, n2g.idx.fa, seq, transcripts.fa, bt2 index files)
- Update test-prepare-reference to diff all reference files
…l tests

- Set TEST_THREADS=1 so Gibbs/calcCI produce reproducible output
- Replace CI sanity checks with exact diff for genes.results, isoforms.results
- generate-gold now invokes generate-gold-ci (all gold in one run)
- Add expression_ci gold (genes, isoforms, stat)
@Jeevesh28 Jeevesh28 requested a review from cndewey March 17, 2026 16:33
@Jeevesh28 Jeevesh28 changed the title Test suite Test Suite Mar 17, 2026
Comment thread Makefile Outdated
@echo "==> Testing rsem-simulate-reads"
rm -rf $(TEST_OUTPUT)/simulated
mkdir -p $(TEST_OUTPUT)/simulated
@theta0=$$(awk 'NR==3 {print $$1}' $(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).theta) && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have this depend on $(GOLD), not $(TEST_OUTPUT)

Comment thread Makefile Outdated
diff $(TEST_OUTPUT)/expression_ci/$(SAMPLE_NAME_CI).stat/$(SAMPLE_NAME_CI).model $(GOLD)/expression_ci/$(SAMPLE_NAME_CI).stat/$(SAMPLE_NAME_CI).model
diff $(TEST_OUTPUT)/expression_ci/$(SAMPLE_NAME_CI).stat/$(SAMPLE_NAME_CI).theta $(GOLD)/expression_ci/$(SAMPLE_NAME_CI).stat/$(SAMPLE_NAME_CI).theta

test-simulate-reads: test-calculate-expression
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dependency on test-calculate-expression. Should just use $(GOLD)

Comment thread Makefile Outdated
./rsem-simulate-reads \
$(GOLD)/reference/$(REF_NAME) \
$(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).model \
$(TEST_OUTPUT)/expression/$(SAMPLE_NAME).isoforms.results \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $(GOLD)

Comment thread Makefile Outdated
@theta0=$$(awk 'NR==3 {print $$1}' $(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).theta) && \
./rsem-simulate-reads \
$(GOLD)/reference/$(REF_NAME) \
$(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).model \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $(GOLD)

Comment thread Makefile Outdated
diff $(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).model $(GOLD)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).model
diff $(TEST_OUTPUT)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).theta $(GOLD)/expression/$(SAMPLE_NAME).stat/$(SAMPLE_NAME).theta

test-calculate-expression-ci: test-prepare-reference
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dependency on test-prepare-reference

Comment thread Makefile Outdated
diff $(TEST_OUTPUT)/reference/$$bf $$f; \
done

test-calculate-expression: test-prepare-reference
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dependency

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these and other related changes be in the remove_boost branch?

Comment thread Makefile

# ---- Individual tests --------------------------------------------

test-prepare-reference:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be helpful to have a message printed at the end of each test indicating success

@cndewey
Copy link
Copy Markdown
Member

cndewey commented Apr 3, 2026

@Jeevesh28 - excellent work getting these test cases set up. I have left some specific comments within the files. Some other comments:

  1. I think we should make the test read file much smaller (maybe just 1000 reads) and avoid having to use git lfs
  2. I am seeing slight numerical differences on an older intel mac. So we will need to move to checks that allow for some very small numerical diffs. Here is the diff for my_sample.theta:
diff tests/output/expression/my_sample.stat/my_sample.theta tests/gold/expression/my_sample.stat/my_sample.theta
1a2
> 0.459553999999847 0.0333932276352768 0.00709735704896766 0.0428769103538539 0.000226531894875526 0.0151884751124963 0.007935117636998 0.0826895888836575 0.223538257936758 0.0224108021009595 0.10508973139631
3d3
< 0.459553999999847 0.0333932276352768 0.00709735704896765 0.0428769103538539 0.000226531894875526 0.0151884751124963 0.007935117636998 0.0826895888836575 0.223538257936758 0.0224108021009595 0.10508973139631
make: *** [test-calculate-expression] Error 1

- Print OK after each test, drop redundant prerequisites
- Replace reads.fastq with subset (10k reads)
- Regenerate tests/gold expression
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.

2 participants