Repository navigation
Fix parser/CLI bugs, make the docs runnable for newcomers, strengthen CI - #1
Merged
Merged
Conversation
Python: - read_fasta/read_fastq: a bare ">" or "@" header raised an uncaught IndexError (traceback from the CLI); now a clear ValueError. FASTQ readers tolerate blank lines between records. - CLI `gc` printed NA-less output and aborted the whole file on an all-N record; it now prints NA for that record and continues. - CLI `stats` on an empty FASTA reported "max() arg is an empty sequence"; now "no sequences found". - gc_content(ignore_n=True) now drops every non-ACGT symbol from the denominator, matching the R package (was N only). - kmer_count is case-insensitive and skips k-mers with ambiguous bases by default (skip_ambiguous=False restores the old counting). - __version__ is read from package metadata (single source of truth); version bumped to 0.2.0 for the behaviour changes. Ship py.typed. - Doctests run under pytest; ruff lint config added. R: - reverse_complement() accepts IUPAC ambiguity codes, like Python. - count_motif() errors on an empty motif instead of returning nchar(seq). CI: - Run on pull_request as well as push. - Python: test 3.10-3.13 (requires-python is >=3.10) and lint with ruff. - R: full R CMD check instead of devtools::test(), so stale Rd files, NAMESPACE problems and broken examples are caught. Docs: fix the placeholder install URLs in python/README.md, add CI badges and usage examples to the top-level README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqrAUWjyEmFz36zphqfoBs
R: - reverse_complement(NA) returned the string "NA" instead of NA. Python CLI: - `rushtools gc --digits -1` printed NA for every record (the format error was mistaken for "no A/C/G/T bases"); negative values are now rejected by argparse with a clear message. - `rushtools revcomp HELLO` printed "OLLED" without complaint; it now errors on characters that are not DNA/IUPAC codes. The library function reverse_complement() is unchanged. Tests for each, plus a regression test that FASTQ files with Windows line endings read cleanly. pytest now also works before installing (pythonpath = ["src"]). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqrAUWjyEmFz36zphqfoBs
- examples/: tiny made-up genes.fasta and reads.fastq, so every example that used to point at a non-existent "genes.fasta" now runs as written. - Top-level README: prerequisites, "Getting started in 5 minutes" with a virtual environment, the real output under every command, R install from the clone (no extra packages needed), a glossary (FASTA, FASTQ, Phred, GC, IUPAC, ORF, k-mer, N50, fold change, BH/padj, ...) and a troubleshooting table. The Python loop example now handles the all-N record instead of crashing on it. - python/README: function table, outputs, a working "branch or tag" install line (there is no v0.1.0 tag yet), venv steps. - r/README: the install line pointed at "yourGitHubName/rushtools" without subdir = "r"; fixed. Examples for every function with output; how to keep DESeq2 gene IDs (row names) through tidy_de_table(); how to run the tests with testthat only. - CITATION.cff, CONTRIBUTING.md, python/CHANGELOG.md. - python/LICENSE copyright holder now matches the R licence; R version 0.2.0.9000 to match the "development version" heading in NEWS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqrAUWjyEmFz36zphqfoBs
Spell out the `cd python` / `cd r` / `cd ..` steps instead of "from the X folder", so each block runs as written straight after the previous one; note where to get the example file if you installed without cloning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqrAUWjyEmFz36zphqfoBs
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.
Summary
A review of the R and Python packages, then a walkthrough as a new student following the READMEs from a fresh clone. This PR fixes the bugs found and every place the student got stuck.
Bug fixes (each with a test)
Python
read_fasta/read_fastq: a bare>or@header raised an uncaughtIndexError, which the CLI showed as a traceback. It is now a clearValueError. FASTQ reading also tolerates blank lines between records.rushtools gcaborted the whole file on an all-N record. It now printsNAfor that record and continues.rushtools gc --digits -1silently printedNAfor every record. It now gives an error.rushtools statson an empty file saidmax() arg is an empty sequence. It now says "no sequences found".rushtools revcomp HELLOprintedOLLED. It now rejects non-DNA characters.R
count_motif(x, "")returnednchar(x). It now errors.reverse_complement(NA)returned the string"NA". It now returnsNA.Behaviour changes (Python version bumped to 0.2.0)
gc_content(ignore_n=TRUE)now drops every non-ACGT symbol from the denominator, not just N. This matches the R package.kmer_countis now case-insensitive and by default skips k-mers that contain ambiguous bases. Passskip_ambiguous=Falsefor the old counting.reverse_complement()now accepts IUPAC ambiguity codes, like Python.__version__is now read from the package metadata.Docs
examples/, so every README example runs as written. Real output is shown under each example.USERinpython/README.mdandyourGitHubNameinr/README.md.CITATION.cff,CONTRIBUTING.mdand a Python changelog.CI
pull_requestas well aspush.ruff check, and doctests now run.R CMD checkinstead ofdevtools::test().Testing
pytestgives 42 passed, andruff check .is clean.testthat::test_local(".")passes.R CMD check --as-cranlocally shows only a locale warning and a clock note, both from the sandbox.After merging
Tag a release (e.g.
v0.2.0). Until this is merged,pip installandinstall_githubfrom GitHub install the old code.🤖 Generated with Claude Code
https://claude.ai/code/session_01WqrAUWjyEmFz36zphqfoBs
Generated by Claude Code