Skip to content

Replace R tools and modernize Python companions - #298

Open
Alexander-Mitrofanov wants to merge 6 commits into
feat/294-python-intarna-fusefrom
feat/295-python-companion-scripts
Open

Alexander-Mitrofanov wants to merge 6 commits into
feat/294-python-intarna-fusefrom
feat/295-python-companion-scripts

Conversation

@Alexander-Mitrofanov

@Alexander-Mitrofanov Alexander-Mitrofanov commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Replace the auxiliary R programs with Python output tools and fix the existing CopomuS and IntaRNApvalue workflows. The tools now share checked subprocess execution, RNA/FASTA and CSV validation, executable lookup, and atomic text output while retaining their distinct scientific models and existing command-line interfaces.

This PR depends on #296 and targets feat/294-python-intarna-fuse. The R migration, shared helpers, CopomuS revisions, IntaRNApvalue revisions, and packaging/documentation each have a separate commit.

  • Replace the R CSV p-value and region-plot scripts, preserving negated-energy GEV/BH semantics, positional arguments, parameter files and seven plot formats.
  • Fix CopomuS explicit mutation dispatch and bounds, CG/GC filters, signed coordinates, zero/NA values and minimum-delta ordering. Share profile contents between measures, reuse the wildtype prediction, clean temporary files, and preserve output files on failure.
  • Fix IntaRNApvalue's both-strand mode to shuffle the correct sequences independently and pair them by index. Apply parameter files to observed and shuffled predictions, bound resampling attempts, stop on command failures, normalize wrapped FASTA/DNA, and preserve reproducibility across thread counts.
  • Retain IntaRNApvalue's historical raw-energy fitted distributions, replace numerical integration with fitted CDFs, reject invalid fits, and expose empirical estimates. Document that its sampling conditions on reported interactions; this differs from the genome-wide CSV model.
  • Standardize Python 3.10+, declare scientific dependencies, support pip and Autotools installation of shared modules, and repair the optional executable builder. Refresh all companion documentation and add an audit with reproducible measurements in python/DEVELOPMENT.md.
  • Extend CI to minimum/current dependencies on Python 3.10/3.13, installed entry points, and native companion execution in the C++ platform matrix.

Validation on Linux:

  • GCC 14 release make tests -j2: all 9 test groups pass, including 119 API cases / 462,689 assertions.
  • python3 -m unittest discover -s python/tests -v: all 46 tests pass, including native sampling and mutation workflows.
  • tests/testIntaRNAFuse.py with native IntaRNA/RNAfold: all 10 tests pass, including independent fusion-energy checks.
  • Autotools bootstrap, automake --warnings=portability,error, make install, and make dist pass. Distribution contents include shared modules, packaging metadata, documentation and regressions, and exclude the removed R/Perl directories and Python caches.
  • Installed the Python source distribution in an isolated virtual environment, ran all five command-line help interfaces away from the checkout, and exercised installed IntaRNApvalue. Also validated the opt-in Autotools Python package installation with a custom prefix, including preservation of an existing installation in another prefix.
  • CopomuS energy-only comparison against pre-review commit b4a9c99 produced identical mutation order, ranks and scores after newline normalization. Three one-thread runs had median wall times of 2.94 s before / 2.23 s after, with peak RSS about 17.3 MiB in both. A fixed-seed long-sequence shuffle comparison was byte-identical; timings and commands are recorded in the audit.
  • Python 3.10 grammar checks, workflow YAML parsing and git diff --check pass.

Out-of-tree C++ validation used the existing source-include/pkg-config/CLI-fixture workarounds. No C++ predictor behavior is changed. A platform-specific PyInstaller executable was not built; the builder's invocation, path handling and failure propagation are covered by tests.

Fixes #295.

@martin-raden

Copy link
Copy Markdown
Member

@Alexander-Mitrofanov

thanks, please revise:

implement respective tasks with at least one commit per task or major step

rebase

  • rebase the branch to "feat/294-python-intarna-fuse" and merge respectively

homogenize python tools

  • screen and investigate the now gathered python tools and scripts within the python folder
  • try to homogenize the tools concerning their coding and interfaces; make use of shared code where similar/same functions are needed
  • revise the CopomuS and IntaRNApvalue tools
    • check for code optimizations and needed adaptations to recent python3 style
    • check for bugs, issues or border cases not covered by the current implementation and fix them
    • ensure respective documentations are up to date and complete

@Alexander-Mitrofanov
Alexander-Mitrofanov force-pushed the feat/295-python-companion-scripts branch from b4a9c99 to 7b1412b Compare October 23, 2026 22:52
@Alexander-Mitrofanov Alexander-Mitrofanov changed the title Replace auxiliary R scripts with Python tools Replace R tools and modernize Python companions Oct 23, 2026
@Alexander-Mitrofanov
Alexander-Mitrofanov changed the base branch from master to feat/294-python-intarna-fuse October 23, 2026 22:52

This branch has not been deployed

No deployments
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.

rewrite R scripts in python

2 participants