sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
404f6ddc0058cfe8d4493f8db73ac65a7d9f8a89dcfacc2d90807f5c77aea25b | Rust | 5,801 | 149 | //! Faithful reimplementation of C `printf("%.15g", x)` — the format Perl
//! uses for the methylation percentage (`bismark2bedGraph:399`/`:601`,
//! default NV stringification; the 2-dp rounding line `:602` is commented
//! out). This is THE byte-identity linchpin (SPEC §2.3).
//!
//! Approach (validated by plan-revie... |
885c5d9082994847eec97f57c9846a8cb5135f8a55acc9b8ea8cdf43fbafcb97 | Rust | 5,816 | 140 | //! Methylation-extractor splitting report parser + fill (SPEC §2.7c).
//!
//! Like the alignment context block but writes the `*_splitting` placeholders,
//! and the phrasing differs: unmethylated is **only** `Total C to T conversions
//! in … context:` (no `Total unmethylated …` alternate), and the Unknown
//! percen... |
c1155f084034bbdb91ab1d581554bf73076476fc3f820f9b3d5001d44d932c3e | Rust | 5,846 | 178 | //! Hermetic byte-identity CI test (Phase 6).
//!
//! For each flag-combination cell, runs the `bismark2bedGraph_rs` binary on
//! the committed methylation-call fixtures and compares its **decompressed**
//! output (SPEC §1.1 D1) against the expected files under
//! `tests/fixtures/bedgraph/expected/<cell>/`. Those ex... |
d4f60d56561f0500bb67abab804c2b3f76c07defcc1bd6402bde4cc369a2f57f | Rust | 5,857 | 180 | mod shaders;
use brush_kernel::calc_cube_count;
use brush_kernel::create_tensor;
use brush_kernel::kernel_source_gen;
use burn_wgpu::WgpuRuntime;
use shaders::prefix_sum_add_scanned_sums;
use shaders::prefix_sum_scan;
use shaders::prefix_sum_scan_sums;
kernel_source_gen!(PrefixSumScan {}, prefix_sum_scan);
kernel_sou... |
697cb218eb5f6dd4668a72061a3cbaa09b40913accb650f0f678697e3e9f27e5 | Rust | 5,876 | 171 | //! Hermetic byte-identity gate for `filter_non_conversion_rs`.
//!
//! For every success case in `tests/data/filter_nonconversion/cases.tsv` (each generated by the
//! REAL Perl `filter_non_conversion` v0.25.1 via `generate_goldens.sh`), this
//! test runs the Rust binary on the committed input BAM and asserts:
//! - ... |
422fa61aa48f385eb815d4b0411d3f43812708ca645993034197aeb6695d0a0a | Rust | 5,930 | 172 | //! M-bias report parser + fill (SPEC §2.7d) — the trickiest section.
//!
//! THREE distinct facts (PLAN B5 / §8.4):
//! 1. `state` (header-derived: `paired` iff an `R2` context header is seen)
//! drives the R2 **section** deletion in `template::build_report`.
//! 2. R2 **fill** runs only if R2 *data rows* exist (`... |
a686a928ac44ee962678d09d89fb2d0d4abb04ae1adaa96b312b0782712263f8 | Rust | 6,093 | 189 | //! Phase 2 byte-identity golden tests: `--drach` / `--m6A` (the standalone
//! DRACH-motif m6A report).
//!
//! Goldens in `tests/data/coverage2cytosine/phase2_drach/gold/<mode>/` are the Perl v0.25.1 output
//! for each mode (regenerated by `tests/data/coverage2cytosine/phase2_drach/generate_goldens.sh`).
//! Each te... |
57a8e91d92c1d29ef7c0ee88929b42ba8bec1b07f67ad9b28507b1cb2c8421ff | Rust | 6,136 | 209 | //! Shared fixture builders for the integration tests.
//!
//! Each fixture is a set of Bismark report files written into a fresh temp
//! dir. The BAM files themselves are empty (bismark2summary never opens
//! them — it derives report names from the BAM filename).
#![allow(dead_code)]
use std::fs;
use std::path::Pa... |
57ff883dc2544344fa7ef83d5903362a2f1d07cce11ea7f9dfb406bd2198cf2b | Rust | 6,179 | 179 | //! Phase B byte-identity golden tests + edge integration.
//!
//! Goldens in `tests/data/nome_filtering/phase_b/*.golden` are the **decompressed** output of
//! the repo's Perl `NOMe_filtering` v0.25.1 (`tests/data/nome_filtering/phase_b/generate_goldens.sh`).
//! The Rust binary's `.manOwar.txt.gz` output, once decom... |
4fa4e4fec717c4492ee0ae54679d4e71550f14b0cb43f4a459cb4dd9d9488cb0 | Rust | 6,287 | 187 | use anyhow::Result;
use brush_render::{gaussian_splats::Splats, AutodiffBackend, Backend};
use brush_train::{scene::Scene, train::TrainStepStats};
use burn::tensor::{activation::sigmoid, ElementConversion, Tensor};
use image::{DynamicImage, GenericImageView};
use rerun::{Color, FillMode, RecordingStream, TensorBuffer, ... |
eee017f056a49431a4dc20313dc1f84a9ca8aee6415eea7affb38ad22ba48631 | Rust | 6,356 | 177 | //! Property tests via [`proptest`].
//!
//! These exercise the pure-function corners of `bismark-io` with random
//! inputs to surface edge cases that example-based tests might miss.
use bismark::io::{BismarkStrand, CigarExt};
use noodles_sam::alignment::record::cigar::Op;
use noodles_sam::alignment::record::cigar::o... |
d3fd120df23005a5bee9d29fee4bf1d66f3fd35510839d5349cd41f459111dcf | Rust | 6,442 | 158 | //! `bismark-summary` — Rust port of Bismark Perl's `bismark2summary`.
//!
//! **Project-level, multi-sample aggregator** — distinct from the
//! per-sample `bismark2report`. It scans a run folder for Bismark BAMs (by
//! filename only — it never opens a BAM), locates each one's text report
//! files, parses per-sample... |
e79234102c92f47daffc8ee9e51f9b10ea1688f72da932bbbaefd24ebf822f8b | Rust | 6,455 | 175 | //! Byte-identity gate: the generated HTML must be byte-for-byte identical to the
//! live Perl `bismark2report v0.25.1`, modulo the single `localtime` timestamp
//! line (normalized in both before comparison). The Perl script is the PRIMARY
//! oracle (mirror genomeprep/methcons). Auto-skips if `perl` is unavailable.
... |
f1863bcaad0b93015590c0c35b023a7859c837baabd26c0e519a4acc9ed623f0 | Rust | 6,471 | 158 | //! Per-call routing: M-bias accumulator → splitting-report counters →
//! split-file write.
//!
//! Phase B locked the ordering (M-bias → counters → `mbias_only` short-
//! circuit → write). Phase E added yacht-mode col-6 / col-7 derivation
//! (strand-conditional polarity per Perl `:4350, 4382, 4422-4447`).
//!
//! P... |
82b06b4a39785470236d8f4d9a6c2cf868944587511c68cb18e2e0e575a18cc0 | Rust | 6,520 | 192 | //! Bismark strand classification.
//!
//! Bismark encodes the strand across two SAM optional tags rather than a
//! single field:
//!
//! | Tag | Meaning | Values |
//! |----------|-----------------------------------------------|--------------|
//! | `XR:Z:` | Read con... |
2c17ad9d6f94122be824be28dac0fa6127da65df06151c04b81084db355a0672 | Rust | 6,526 | 157 | //! Build-time version/provenance capture for the single-crate Bismark Rust suite.
//!
//! Emits (as `cargo:rustc-env`) the SUITE version + git short-hash + a reproducible
//! build timestamp + a single suite-wide "last modified" date, which `src/meta`
//! re-exports as consts. Every binary's `--version`/`--help` foote... |
cfc4595d6323ba53d37da24024e836f0d05f469eff788bc01e5417b4d3027357 | Rust | 6,577 | 165 | //! Output-filename derivation matching Perl `bismark2bedGraph` v0.25.1.
//!
//! All four derivations operate on the **normalized** bedGraph output name
//! (the `-o` value with `.gz` guaranteed appended). The Perl quirks here
//! are byte-identity-affecting and are replicated verbatim — including the
//! `.zero.cov` f... |
27d12d8d2a03b5dd9a20fa8ecd387f58d76f165c1cd8701e4bdff0aa7a643189 | Rust | 6,654 | 206 | //! Typed accessors for Bismark-relevant SAM optional tags.
//!
//! Free functions over [`noodles_sam::alignment::record_buf::data::Data`]
//! that pull out tags by name and return typed slices/values. Missing
//! required tags surface as [`BismarkIoError::MissingTag`]; malformed
//! values surface as [`BismarkIoError:... |
5eb56d61aeff47b5bdd71ceaffce5fcb26e0c18cd0bc3a26e5f1ec4434204a56 | Rust | 6,812 | 175 | //! Typed errors for `bismark-bam2nuc`.
//!
//! Produced at the CLI-validation, genome-reading, per-read-counting, and
//! report-writing boundaries. Error strings echo Perl `bam2nuc`'s `die`/`warn`
//! wording where it exists (`process_commandline`, `read_genome_into_memory`,
//! `calc_single_end`, `generate_nucleotid... |
f1c54cad4b273fc438f6dffb38069d18d7cd704ca0c59f43aa64a8b9a130cc87 | Rust | 6,931 | 171 | //! Nucleotide-coverage report parser + fill (SPEC §2.7e).
//!
//! Header (line 0) is validated; the body is iterated in a FIXED 20-key order
//! (NOT sorted). Missing keys → `0` for the percentages but the **empty string**
//! for counts/coverage (Perl undef-in-`s///`). The log2 ratio Perl computes is
//! commented ou... |
93a74a1a454d36035412c431fd8c790ef19e3d347b976dacaa5aa17ad615e322 | Rust | 6,989 | 199 | //! Document assembly: byte-level helpers + the 11-step build (SPEC §2.3).
//!
//! The document is a `Vec<u8>` (not a `String`) so report-derived values — most
//! importantly `{{filename}}`, which can be non-UTF8 — round-trip byte-for-byte
//! like Perl. The embedded template/assets are ASCII (`&str`).
use crate::rep... |
16730d1c83e826d3fc8236657db97d626445d2bd6000e70a5ea3f935f97f6639 | Rust | 7,006 | 191 | #![allow(clippy::single_range_in_vec_init)]
use std::collections::HashMap;
use std::path::Path;
use std::{fs::File, io::Read};
use brush_render::BurnBack;
use brush_render::{
camera::{focal_to_fov, fov_to_focal, Camera},
gaussian_splats::Splats,
};
use burn::backend::Autodiff;
use burn::module::AutodiffModule;... |
7c7d453063ebfd81ac600f81d8396c429d8a7d66400aa6520b09240ab8f32220 | Rust | 7,052 | 230 | // While most wgsl binding code is autogenerated, some more glue is needed for
// wgsl burn interop. This file contains some of this glue code, it's mainly
// generated by the macro below.
mod shaders;
pub use burn_jit::cubecl::{
client::ComputeClient, compute::CompiledKernel, compute::CubeTask, server::ComputeSer... |
3acd1d9a870d6d2829b4bf24698e3092619e222a024d1b92ef1203efe82ac7ee | Rust | 7,179 | 202 | //! Command-line interface for `bismark2summary`.
//!
//! [`Cli`] is the clap-derived parser. [`Cli::validate`] resolves it into a
//! [`ResolvedConfig`], applying Perl's basename/title defaults with Perl
//! *truthiness* semantics (`bismark2summary:207-212`): an unset, **empty**,
//! or literal `"0"` value falls back ... |
6d9d81b6cef0b89f7804c109e4f7860bf3263b0c7015b893dca951d0ac54eec7 | Rust | 7,268 | 219 | //! `--unmapped` / `--ambiguous` FastQ output (Perl 1644–1709 + the record write
//! at 2452–2455 / 2461–2464).
//!
//! For the SE single-core spine these files are **gzipped** (`gzip -c`), so the
//! byte-identity gate compares the **decompressed** content (flate2 ≠ Perl gzip
//! bytes — the Phase-2 `--gzip` precedent... |
1115f19e4264f9b4246e18e1662caf390cc9ec4b7fbccc6165136108fe0462b4 | Rust | 7,385 | 199 | //! Phase D byte-identity golden tests: `--merge_CpGs` (+ `--discordance_filter`).
//! Goldens in `tests/data/coverage2cytosine/phase_d/` are generated from the repo Perl v0.25.1.
//! gzip is compared after decompression.
use std::io::Read;
use std::path::{Path, PathBuf};
use assert_cmd::Command;
use flate2::read::Mu... |
f1edecb70cc25e0724740eaaa19c18d77dcdfd53f896e63a277048b509ad0ecf | Rust | 7,512 | 145 | //! Paired-end overlap detection (`--no_overlap`).
//!
//! Phase C.1 (closes #862) — drops R2 calls in the overlap region with R1's
//! reference span, keeping R2's unique-region calls. Mirrors Perl
//! `bismark_methylation_extractor` lines 3825-3828 (OT/CTOB R2, strand='-'
//! branch in the default 4-context strand-sp... |
c5cb19955a4f737c4d2b8cf22bb9c4bb24506c5d75718bde69471a492d6cbc97 | Rust | 7,555 | 188 | //! Typed errors for `bismark-coverage2cytosine`.
//!
//! Produced at the CLI-validation and genome-reading boundaries. Error
//! strings echo Perl `coverage2cytosine`'s `die` wording where it exists
//! (`process_commandline:1990-2197`, `read_genome_into_memory:1648-1751`).
use std::path::PathBuf;
/// All errors rai... |
c34fc0c0f0c3ed021e2237da1a8a3074eb46b68566ace190264634dcd095ce60 | Rust | 7,658 | 272 | extern crate chashmap;
extern crate clap;
extern crate itertools;
#[cfg_attr(test, macro_use)]
extern crate polytype;
extern crate programinduction;
extern crate rayon;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
mod vs;
use self::vs::induce_version_spaces;
use polytype::Type;... |
3489ff52e2c328d648e2cf9ca6311953d0120bcae441c3b9f790bb635ba96e85 | Rust | 7,926 | 225 | //! #1025 Phase 1 — integration tests for the uBAM → temp-FASTQ transcode driver.
//!
//! Builds real (tiny) unaligned BAM files with the noodles BAM writer, then checks
//! `transcode_ubam_to_fastq_se`/`_pe` produce the expected `samtools fastq`-equivalent
//! FASTQ — exercising the raw `record_bufs` read path the uni... |
2e5ffbed199a0112dfa167d856e61a43923cbc2ebcc106cdc28a5806249bb216 | Rust | 7,989 | 228 | //! Phase C byte-identity golden tests: `--gzip`, `--split_by_chromosome`, and
//! the two combined. Goldens (`tests/data/coverage2cytosine/phase_b/phase_c/{split,split_thr}/`)
//! are generated by `tests/data/coverage2cytosine/phase_b/generate_goldens.sh` from the repo's
//! Perl `coverage2cytosine` v0.25.1. gzip outp... |
3a222623700c113a5b15bc342f91ed6b67a6ee983b61b674f0eddd22ce9e758e | Rust | 8,029 | 216 | //! THROWAWAY spike harness (#797 follow-up; parallel-parse design) — splits the
//! `bismark2bedGraph_rs` **read phase** into decompress / parse+validate /
//! hashmap-insert, then measures the **merge cost** of folding a per-file map
//! into a fresh global map. Decides per-file-parallel (Family A) vs
//! sharded/int... |
ecdd6491e630d83ac3058c453ec05e72b8eae48cfc7784fbd28d71d2315610a0 | Rust | 8,107 | 233 | //! Consistency-report formatting — byte-equal to Perl `methylation_consistency`.
//!
//! The templates below were copied from Perl lines 334–344 and
//! **byte-validated against a real Perl run** (Spike 2, `spikes/RESULTS.md`).
//! Exact layout (`\t` = tab, separator = exactly 49 hyphens, no leading `\n`,
//! no trail... |
6f57e9af2476d1c38348eb7d606f6caff84b75ad08b712f96a44077404fe0099 | Rust | 8,189 | 195 | //! Typed errors for `bismark-io`.
//!
//! See `DESIGN.md` Q4 and `PLAN.md` rev 3 for rationale. The crate uses
//! [`thiserror`] for typed errors so callers can match on specific failure
//! modes. Binary crates that consume `bismark-io` wrap these in
//! [`anyhow::Error`] at the orchestration layer.
use std::path::P... |
9495f20ef2eb68fcc5b8e2f287463d55f0fbbf8a249f205b0142cc4c858a5e1d | Rust | 8,329 | 212 | // Autogenerated by brush-wgsl from source wgsl files. Do not edit.
#![allow(dead_code, unused_mut, clippy::all)]
fn create_composer() -> naga_oil::compose::Composer {
let mut composer = naga_oil::compose::Composer::default().with_capabilities(
naga::valid::Capabilities::SUBGROUP |
naga::val... |
f4e2210bf1da24ea1e5b5356ab479049a5f51c9baafca8d38feb892c8a8e0070 | Rust | 8,348 | 235 | //! Plot-data assembly — the per-sample mutation + plot-exclusion that feed
//! the HTML graphs.
//!
//! Mirrors Perl `bismark2summary:406-456`. Runs AFTER the `.txt` row is
//! captured (§2.6), so it works on **mutated** copies: 0-defaulting of
//! unaligned/ambig/no_seq + the six methylation counts, the
//! `aligned_... |
6c3155768b8d9e0466849f843906e9b1c1537bcb7974348d7c35224cc4e43e91 | Rust | 8,369 | 226 | //! M-bias accumulator.
//!
//! Phase B accumulates counters per (read-identity × context × 1-based
//! position) only; the `M-bias.txt` writer lands in Phase D.
//!
//! Per SPEC §6.2 + §7.7: the surrounding state holds an `[MbiasTable; 2]`
//! indexed by read-identity (0 = R1/SE, 1 = R2). Per-context iteration in
//! ... |
d90b68941110e583d94c26f82b674c37b07182771a3f96b10791d98550b3e9e2 | Rust | 8,445 | 255 | //! Output-filename derivation matching Perl `deduplicate_bismark`.
//!
//! The Perl script's derivation chain (lines 145, 225, 227-230, 576):
//!
//! 1. `$x =~ s/.*\///` — strip leading directory path.
//! 2. `$x =~ s/\.gz$//; $x =~ s/\.sam$//; $x =~ s/\.bam$//; $x =~ s/\.txt$//`
//! — strip a single trailing exten... |
9d0c9a0f7edecce49d7c55591d40f903662e2da1b5b81f98de8a2850805ab597 | Rust | 8,569 | 237 | //! Real-data byte-identity gate (Phase E, `#[ignore]`).
//!
//! Runs Perl `bismark_genome_preparation` v0.25.1 and
//! `bismark_genome_preparation_rs` on COPIES of the SAME real genome directory
//! and asserts the bisulfite-converted **CT + GA FASTA** are byte-identical
//! (the acceptance gate, SPEC §7). A **fake `b... |
64c055ee3286d5a5fa40f8ff6c2ed6cb227ba6247e4fbe91cd3da375632ef1a1 | Rust | 8,584 | 187 | //! Multicall dispatcher for the single `bismark` binary (Phase 3 — DECISIONS D2/D3/D4/D7).
//!
//! Every `src/bin/<name>.rs` calls [`dispatch`]. It routes on **`argv[0]`** (a classic
//! tool name → that module's `run_main`, byte-identical to the historic binary) and,
//! when invoked as `bismark`, on **`argv[1]`**: a... |
99a90fbaf91cf99b7e803de26f8d994c80926e9ba8393d7a30b0761aa1836a2e | Rust | 8,585 | 191 | //! Output writers: the sorted bedGraph (`.gz`), the coverage file
//! (`.bismark.cov.gz`), and the optional plain `.zero.cov`. Mirrors Perl
//! `bismark2bedGraph` `generate_output` (`:590-618`) and the header/line
//! layouts (`:116`, `:406`/`:607`, `:409`/`:610`, `:413`/`:614`).
//!
//! Byte-identity is at the **deco... |
29a78171bc296f751a62eb49a1ec786c3fe10f2b1275c3a1a76a93ed3e458c7d | Rust | 8,626 | 207 | //! Typed errors for `bismark-dedup`.
//!
//! All variants are produced at orchestration / pipeline boundaries.
//! Library errors from [`bismark_io`] propagate through the
//! [`BismarkDedupError::Io`] variant via `#[from]`. The binary's `main`
//! wraps these in `anyhow::Error` for top-level reporting; exit-code
//! ... |
064ab8b63568010f3e7a490ab3c6eab4a27969f3db6eae131219bcdfbdc721b0 | Rust | 8,663 | 247 | //! methylseq CLI-surface conformance — `BISMARK_ALIGN` (nf-core/methylseq **4.2.0**).
//!
//! Asserts the Rust `bismark` aligner CLI accepts every command shape methylseq's
//! `BISMARK_ALIGN` module emits, so a drop-in gap is caught HERE (fast CI test)
//! instead of in a production pipeline run. This is the proactiv... |
fa4d329d43a65daeea2fae115a406b2db04fd9b216fcf457567c3489259fe097 | Rust | 8,747 | 255 | //! Command-line interface for `bam2nuc`.
//!
//! [`Cli`] is the clap-derived parser; [`Cli::validate`] resolves it into a
//! [`ResolvedConfig`], reproducing Perl `bam2nuc`'s `process_commandline`
//! (`:346-465`) rules:
//! - `-g/--genome_folder` is **mandatory** (Perl dies otherwise).
//! - no input files AND not `-... |
6a2dc067c8b29a7d59d081cfa56aedc113e01362fe38016e17f270fbed44e336 | Rust | 8,770 | 256 | //! PredictionSlot - holds Prediction and Permit side-by-side.
//!
//! This separation allows the prediction to be behind Mutex for concurrent
//! updates while the permit's idle_flag can be set without holding the lock.
//!
//! Slot poisoning is NOT managed here — it's a pool-level property.
//! The slot always transi... |
89ba7e5c158ab2c0f12c68e4fce5fd8ae38fb5360b7846f35dfb3c0245cda9e9 | Rust | 8,905 | 255 | //! Command-line interface for `NOMe_filtering`.
//!
//! [`Cli`] is the clap-derived parser; [`Cli::validate`] resolves it into a
//! [`ResolvedConfig`], enforcing the SPEC §4 rules:
//!
//! - **Live flags:** positional `<infile>`, `-g`/`--genome_folder` (mandatory),
//! `--dir`, `--version`. `--parent_dir` is accept... |
bfd51f12e555390be3916f78fbc37711c5c14088ca285a2c4478dc5f3dabb15f | Rust | 8,908 | 203 | //! `bismark-extractor` — Rust port of Bismark Perl's `bismark_methylation_extractor`.
//!
//! This crate is the biggest single-tool rewrite in the Bismark Rust workspace
//! — Perl source is 6,050 LOC across 35 CLI flags. Implementation is phased
//! per the design contract at [`bismark-extractor/SPEC.md`](../SPEC.md)... |
1e53c4710a2aef8a5a95c016711ad7ab4af1670d3b7a85e38575c4304bc0831a | Rust | 8,998 | 294 | //! Step III: locate and run the external indexer (`bowtie2-build` /
//! `hisat2-build` / `minimap2 -d`) on the two converted references,
//! concurrently (mirroring Perl's `fork`).
//!
//! Discovery tier mirrors the extractor's subprocess discovery:
//! `BISMARK_BIN` (strict, no fallback) → `PATH` (via `which`) → `cur... |
627b25a1a85da90a49155de72d69e846b37dd7d6e84409fede9579c84c1720e1 | Rust | 9,061 | 250 | //! Phase 3 byte-identity golden tests: `--ffs` (tetra/penta/hexamer context
//! columns appended to each report line, 7 → 10 columns).
//!
//! Goldens in `tests/data/coverage2cytosine/phase3_ffs/gold/<mode>/` are the Perl v0.25.1 output
//! for each mode (regenerated by `tests/data/coverage2cytosine/phase3_ffs/generat... |
23febee578f48c4bd228a046ff66212cf8caa393d0d451a41420e71c5fd25ce2 | Rust | 9,160 | 259 | use async_stream::try_stream;
use brush_render::{render::num_sh_coeffs, Backend};
use burn::{
module::{Param, ParamId},
tensor::{Tensor, TensorData},
};
use futures_lite::Stream;
use ply_rs::{
parser::Parser,
ply::{Property, PropertyAccess},
};
use std::io::BufRead;
use tracing::info_span;
use anyhow::... |
1ee4731658a7e8d9dc4dcc0432c4d9e5c1656f0878906a320f05c0077928c649 | Rust | 9,252 | 292 | //! methylseq CLI-surface conformance — `BISMARK_METHYLATIONEXTRACTOR`
//! (nf-core/methylseq **4.2.0**).
//!
//! Asserts the Rust `bismark_methylation_extractor` CLI accepts every command
//! methylseq's extractor module emits. See `plans/06122026_methylseq-cli-conformance/`.
//!
//! **Command template** (`modules/nf-... |
fc008b960a71a9ff7368eeede502024e37504435ff630fcf196552bbd299b5fc | Rust | 9,258 | 269 | //! Phase D end-to-end smoke — runs the `bismark_methylation_extractor_rs`
//! binary on synthetic BAMs and asserts M-bias.txt content.
//!
//! Rev 1 design choice (Reviewer B I2): this file is NEW rather than
//! extending `tests/se_phase_b_smoke.rs` or `tests/pe_phase_c_smoke.rs`.
//! Those files belong to in-review ... |
106b6b852adf8875c89a61845c56692ef27d081dd63a52689f7a8073f1b105fb | Rust | 9,292 | 243 | //! File descriptor redirection for subprocess isolation.
//!
//! Worker uses fd 1 (stdout) as the control channel to the orchestrator. When Python's
//! setup() spawns subprocesses (subprocess.Popen), they inherit fd 1 and corrupt the
//! control channel by writing directly into it.
//!
//! We redirect fds early in st... |
15df59f0f09ef6ad7e0291b1e2b1359bcf73fc14a5c3d6071b6becca07ff0b1e | Rust | 9,355 | 270 | //! `*.nucleotide_stats.txt` report writer, faithful to Perl `bam2nuc`'s
//! `calculate_averages` (`:276-315`).
//!
//! Layout (tab-separated, trailing `\n` per line). The header is followed by
//! 4 mono rows (`A`,`C`,`G`,`T`) then 16 di rows (`AA`,`AC`,…,`TT`); each row is
//! `<word>\t<count sample>\t<percent sample... |
aaf75fb3bcb28db85b98508ef8ff06e16b10ccbd529ce8cf9b6f4bac5b19fa7f | Rust | 9,391 | 231 | //! End-to-end Phase C smoke test.
//!
//! Builds a synthetic PE BAM in-test (no Perl toolchain required), runs the
//! `bismark_methylation_extractor_rs` binary on it, and asserts:
//! - exit code 0,
//! - all 12 split files present,
//! - splitting report contains "Processed N lines in total" matching the
//! 2N (l... |
a0d419b3b8ffc8f6c5bc590d8c44e91d72c4f64a7e13a7cfd9f4c6c427030fb4 | Rust | 9,636 | 237 | //! M-bias.txt writer (Phase D).
//!
//! Consumes the `[MbiasTable; 2]` accumulator populated by Phases B + C.
//! Byte-identity-targeted at Perl `bismark_methylation_extractor` lines
//! 628-836 (`produce_mbias_plots` — name is historical; the sub writes
//! both M-bias.txt and the optional PNG plots, which are deferr... |
15f89c9b6ecaa3019aa07f308a40bb3d84df96520caaaf7fcd495bd5dd7c2f98 | Rust | 9,717 | 246 | //! Rust-vs-Rust byte-identity oracle for `bismark_rs` (the aligner).
//!
//! This is the regression gate for the Apple Silicon performance epic
//! (`plans/06222026_aligner-apple-silicon/`): every optimization on the
//! faithful Bowtie 2 path must change **zero output bytes**. Unlike the
//! sibling crates' real-data... |
573644a66a8093432ed21775107071ea0c60b2fca152203d3696727a912331ec | Rust | 9,778 | 257 | //! Mode-aware output-file key + filename generation (Phase E).
//!
//! Per `PHASE_E_PLAN.md` §5.1: an [`OutputKey`] enum carries the per-mode
//! key shape, and [`mode_keys`] returns the `(key, filename)` list for
//! `OutputFileMap::new`. Ordering is load-bearing — see [`mode_keys`].
//!
//! Phase E adds the five non... |
b2d5ac6d40d77922dbcbe6237425b82009a2de526c7c1334aae95e967a53df57 | Rust | 9,795 | 282 | use brush_kernel::bitcast_tensor;
use brush_kernel::create_dispatch_buffer;
use brush_kernel::create_tensor;
use brush_kernel::create_uniform_buffer;
use brush_kernel::CubeCount;
use burn::tensor::Int;
use burn::tensor::Tensor;
use burn_jit::JitBackend;
use burn_wgpu::JitTensor;
use burn_wgpu::WgpuRuntime;
use shaders:... |
64be49bc05630149c4ca0114b768e3c048d3cd044f149cb4a12b2fc911cd8070 | Rust | 9,950 | 257 | //! FASTA discovery (extension precedence + lexical order) and chromosome-name
//! extraction — the two pure pieces with exact Perl semantics.
use std::path::{Path, PathBuf};
use crate::genome_prep::error::GenomePrepError;
/// Extension groups, in Perl's precedence order (lines 610–626). The **first
/// non-empty gr... |
2232e7f3108a6d6ad4a6838fc704e63d8a2d937e63b9dd6b137f1f59190ca249 | Rust | 10,009 | 318 | //! Audit hooks to protect Rust-injected runtime objects.
//!
//! Uses sys.addaudithook to intercept operations that could interfere with
//! our runtime machinery. The hook cannot be removed once added.
//!
//! ## Protection: sys.stdout/stderr (Tee pattern)
//!
//! If user code replaces stdout/stderr, we wrap their re... |
d08950586d0380688d937082edf9bad19d94db4e272a7147a02472fa24e87656 | Rust | 10,009 | 307 | //! Command-line surface (clap derive) + validation into [`ResolvedConfig`].
//!
//! Flag spellings match the Perl `bismark_genome_preparation` exactly
//! (underscores preserved: `--single_fasta`, `--path_to_aligner`,
//! `--large-index`, `--genomic_composition`). `--version` is handled manually
//! (clap's auto-versi... |
cf2d8a8847a52140510dc9d5a70c69e149e458f1aa70d8a6fab57479c37b391e | Rust | 10,197 | 289 | //! BAM discovery and per-BAM report-filename derivation.
//!
//! `bismark2summary` never opens a BAM — it uses the BAM **filename** to
//! derive the names of each sample's text report files. This module mirrors
//! Perl `bismark2summary:152-367`:
//!
//! - **Discovery** (`:152-205`): explicit `@ARGV` verbatim, else f... |
8b9900c2344ecb6400801cd1547e7468da7f171165783ba2c250efc99a21fcb1 | Rust | 10,219 | 288 | //! Alignment-report discovery + companion-report resolution (SPEC §2.2).
//!
//! Companion resolution order mirrors Perl: **dedup → nucleotide → splitting →
//! mbias** (`bismark2report:1141/1170/1201/1228`) — this *companion* order only
//! affects which `die` fires first when several companions are ambiguous; the
//... |
9a2ab9a36d6eac87f134e1ecce2c077e39d50aa5f693c9effbbe451308838c56 | Rust | 10,553 | 295 | //! Byte-exact `*.non-conversion_filtering.txt` report formatting.
//!
//! Reproduces Perl `filter_non_conversion`'s SUMMARY (`process_file` lines
//! 311–353) plus the run-time line emitted after the `@ARGV` loop (line 664).
//! The report file content is part of the byte-identity gate, so every space,
//! tab, and ne... |
03fca1c0cfa70ef7b12285d5df6b1285c753b193a2f4f7978baa8520efbf8634 | Rust | 10,581 | 282 | //! External-aligner detection (Bowtie 2 + HISAT2).
//!
//! Mirrors Perl `ensure_the_aligner_is_working` (7060–7092) and the path setup
//! (7480-ish): if `--path_to_<aligner> <dir>` is given it must be a directory
//! and the binary name is appended; otherwise the binary is resolved from
//! `PATH`. We run `<binary> -... |
4dece3d90ffcfc69408b12d361da75e637411a59c91dd2665e814b6e21cd936e | Rust | 10,646 | 324 | //! Command-line interface for `methylation_consistency`.
//!
//! [`Cli`] is the clap-derived parser; [`Cli::validate`] resolves it into a
//! [`ResolvedConfig`], applying defaults and the Perl threshold range checks.
//!
//! Long flag names keep Perl's **underscores** (`--paired_end`, `--single_end`,
//! `--lower_thre... |
c12280966211f789b98b5cf88a8c79ad0a5bff07d1fd3810c16a44aeef242caa | Rust | 10,998 | 322 | //! Phase 1 byte-identity golden tests: `--gc`/`--gc_context` (GpC report + cov)
//! and `--nome-seq` (NOMe-filtered core report + cov + GpC report + cov).
//!
//! Goldens in `tests/data/coverage2cytosine/phase1/gold/<mode>/` are the Perl v0.25.1 output for
//! each mode (regenerated by `tests/data/coverage2cytosine/ph... |
37b585627750d7f0d763e989f61025e100b35a966b69d47426ca7cbf0495a97d | Rust | 11,137 | 247 | //! Paired-end Bismark records.
//!
//! [`BismarkPair`] is the structural-correctness scaffold that makes the
//! per-record-strand-vs-pair-strand distinction explicit at the type level.
//! Output-routing code for paired-end data uses `pair_strand()` — which is
//! derived from R1 alone — rather than each mate's `reco... |
c0bf3c0839e5596658b45110485ca240121b2891258ff6c77331a30653ef3ce7 | Rust | 11,140 | 302 | //! End-to-end orchestration: read a Bismark BAM, classify each read (or PE
//! pair), route to one of three BAMs, and write the consistency report.
//!
//! Mirrors Perl `methylation_consistency`'s `process_file` (lines 138–352).
//! Per-file flow:
//!
//! 1. Open the BAM **no-sort-check** (`BamReader::without_sort_che... |
0161d79787248dfb582e586a7ab8a31d48944542313058618bab159bc3763c7b | Rust | 11,399 | 331 | //! Edge-case + error-path integration tests for `filter_non_conversion_rs`.
//!
//! These cover paths that don't fit the uniform Perl-golden body comparison
//! in `byte_identity.rs` — they assert exit codes, partial output, report
//! sizes, and output record counts. Fixtures are built in-test via noodles
//! and out... |
02b0173bce716527aff9f11fc810851aac649ecd345c110dd81dee45d74ec383 | Rust | 11,532 | 295 | //! Console diagnostics — a STDERR logger gated by `--quiet`, plus the pure
//! text builders for the startup banner, parameter summary, header provenance,
//! progress counter, and final methylation summary.
//!
//! **All diagnostic output goes to STDERR**, matching Perl Bismark's `warn`
//! model (the Perl extractor ... |
1105c471960c1df30857fc621c2ecd62abf9164aee85b5494af24d765b40336d | Rust | 11,567 | 362 | //! Slot socket transport for parent-worker IPC.
//!
//! Platform-specific implementations:
//! - **NamedSocketTransport**: Filesystem sockets (macOS, Linux, BSD)
//! - **AbstractSocketTransport**: Linux abstract namespace (no filesystem, auto-cleanup)
use std::io;
use std::path::PathBuf;
use serde::{Deserialize, Ser... |
2ac6cbec9c8d571d3599c5a6dca430ad816b97cc4f298caddee81ca39d122def | Rust | 11,623 | 304 | //! In-memory genome — a port of Perl `read_genome_into_memory` (5022–5147) +
//! `extract_chromosome_name` (5149–5159).
//!
//! Loads the raw reference FASTA(s) into memory once (before the per-file read
//! loop, Perl 273–277) so the methylation call can pull the matching genomic
//! window per read. **Consumes Phase... |
30b83e6d13814f47c2fd9fafc846ce216911865f392fac0206e39713470c5dd9 | Rust | 11,721 | 365 | //! Read-level methylation-consistency classification — the core algorithm.
//!
//! Mirrors Perl `methylation_consistency` lines 259–301. The flow per read
//! (PE: per pair, counts summed across both mates):
//!
//! 1. Count methylated / unmethylated cytosine calls in the `XM:Z:` string.
//! 2. If `meth + unmeth < min... |
af2576ca4c47601f180f3ee93c6a2ff0b8304ff5482d9cb75771f9dec5bb3e68 | Rust | 11,779 | 288 | //! 🔑 Record-level cross-check (the Phase-1 fidelity gate, epic
//! `06152026_rammap-library-integration`).
//!
//! Runs the production [`InProcessAlignerStream`] AND parses the subprocess
//! `rammap` CLI SAM on the SAME converted-read sample, then asserts the
//! `SamRecord`s are **field-identical on every merge-con... |
3c893a06b1cd58506d117017e49b81b499042bac8b532d5bd0f840b21250e576 | Rust | 11,950 | 321 | //! End-to-end Phase B smoke test.
//!
//! Builds a synthetic SE BAM in-test (no Perl toolchain required), runs the
//! `bismark_methylation_extractor_rs` binary on it, and asserts:
//! - exit code 0,
//! - all 12 split files present,
//! - each split file's first line is the Perl version header,
//! - at least one of ... |
daebdd32b2d10c882669125690b33ee1939675a3487f12313297ed407fac5452 | Rust | 11,959 | 306 | //! Per-file orchestration: read a Bismark BAM with raw noodles `RecordBuf`s,
//! route each read (SE) / read-pair (PE) to the kept or removed output by the
//! XM decision, and write the byte-exact report.
//!
//! ## Why raw `RecordBuf` (not `crate::io::BismarkRecord`)
//!
//! `filter_non_conversion` is a verbatim pas... |
6157ff6acbd42d0babd7b2d2492e2826842396e1b5bb0af76e2c3ff51cd5b0f2 | Rust | 12,079 | 268 | //! Typed errors for `bismark-extractor`.
//!
//! Phase A: errors produced at the CLI-validation boundary.
//! Phase B (rev 1): adds pipeline/extraction errors — `PhaseNotYetImplemented`,
//! `InvalidXmByte`, `IoWrite`, `BismarkIo`, `InternalError`,
//! `NonAsciiChromosomeName`.
use std::path::PathBuf;
use crate::io:... |
76a10b7cd098c62bfda016800f635fd90e024b56a52a5ff7fc8408e534561200 | Rust | 12,120 | 348 | //! Byte-identity goldens vs Perl `bam2nuc` v0.25.1, plus behavioral/exit-code
//! cells. The goldens + BAM/genome fixtures are produced by
//! `tests/data/bam2nuc/generate_goldens.sh` (which runs the real Perl + samtools); these
//! tests run the Rust `bam2nuc_rs` over the SAME fixtures and assert byte-for-byte
//! id... |
d8989239f749cd9c5079c0e0e16a51ee782b157f8d5c7f7256c3316172e50a0a | Rust | 12,435 | 359 | //! `--merge_CpGs` post-pass — pool top/bottom CpG strands into a single
//! dinucleotide entity. Mirrors Perl `combine_CpGs_to_single_CG_entity`
//! (`coverage2cytosine:1753-1958`).
//!
//! Runs **after** the genome-wide CpG report is written (Phase B/C). Re-reads
//! that report (gz-aware), pairs consecutive `+`/`-` ... |
d8a4346fb199317cde6e5441cc4c5a2bc8e39be88aac30f112af7c2276c20cd4 | Rust | 12,580 | 356 | //! Input-file selection and methylation-call line parsing.
//!
//! Mirrors Perl `bismark2bedGraph`:
//! - File selection (`:73-112`): default keeps only basenames matching
//! `^CpG`; `--CX` keeps all. **Argv order is preserved** — never sorted or
//! glob-reordered, because chromosome ownership depends on it (SPE... |
0ef5a3c841bd217d5a3efc11fc0a5b7c3b3a2e76e50b02de938ec8669df4351a | Rust | 12,591 | 329 | //! The pure non-CG-conversion filtering decision over an XM call string.
//!
//! This module is the heart of the byte-identity contract: given a read's
//! `XM:Z:` methylation-call string and a [`FilterMode`], [`read_fails`]
//! returns whether the read (or, in PE, that mate) should be **removed**.
//! It is a faithfu... |
e903bc248419acbfa62e17a839119e527fd4564efef6e85e47f71f37f7b5776b | Rust | 13,115 | 373 | mod codewriter;
use std::{borrow::Cow, collections::HashMap, io, sync::OnceLock};
use anyhow::Result;
use naga::{proc::GlobalCtx, valid::Capabilities, Handle, Type};
use naga_oil::compose::{
ComposableModuleDescriptor, Composer, ComposerError, NagaModuleDescriptor,
};
use regex::Regex;
use thiserror::Error;
cons... |
9c4e4377557cccbf4ee518d3f14643c3d02e04482e9a7bad3bc9afaafa0ccda8 | Rust | 13,265 | 331 | //! Deduplication report formatting.
//!
//! [`DedupReport::format`] produces a byte-equal-to-Perl dedup report.
//! The format below was verified character-by-character against Perl's
//! `deduplicate_bismark` lines 529–537:
//!
//! ```text
//! \n
//! Total number of alignments analysed in <input_path>:\t<count>\n
//!... |
b96c9ddf49fb1f8cee800a33b34f4675743986458a51d2e896de402d35b66d79 | Rust | 13,307 | 345 | //! Integration test against a committed Bismark-Perl-generated BAM fixture.
//!
//! Validates that `BamReader` + `BismarkRecord` together reproduce the
//! expected per-record strand classification and read-identity decoding
//! on a real (small) Bismark BAM. The fixture is documented in
//! `test_files/README.md`; it... |
c8bde52b5c2fa5ad697c1b7cb94bd5e247afa05bff67757f24307e064c4d7827 | Rust | 13,538 | 408 | //! Command-line interface for `filter_non_conversion`.
//!
//! [`Cli`] is the clap-derived parser; [`Cli::validate`] reproduces Perl
//! `filter_non_conversion`'s `process_commandline` validation (lines
//! 469–606) and resolves to a [`ResolvedConfig`].
//!
//! Faithfulness notes:
//! - The integer options are parsed ... |
48e74c2b0c8d02d1689c628849e10486e18e4381dbc3227abf3efa7744beef7d | Rust | 13,742 | 399 | //! UMI extractors for Bismark BAM qnames.
//!
//! Bismark's downstream `deduplicate_bismark` Perl script (v0.25.1)
//! supports two UMI encoding formats in the read ID:
//!
//! - **`--barcode` / `--umi`** — UMI is the tail-of-qname token after
//! the last `:`, e.g. `MISEQ:...:CTCCTTAG`. Perl regex
//! (`deduplica... |
27347de2357fcb92a4beb755bdba0cfae1a0b3fed7b658965c1dadbbee0da5bd | Rust | 13,820 | 463 | use byteorder::{LittleEndian, ReadBytesExt};
use std::collections::HashMap;
use std::io::{self, BufRead, Read};
// TODO: Really these should each hold their respective params but bit of an annoying refactor. We just need
// basic params.
#[derive(Debug, Clone)]
pub enum CameraModel {
SimplePinhole,
Pinhole,
... |
ebc2b588db31da42985fa94b16ce4178d2cea0d9930b898eae6a3a7ed72570e7 | Rust | 13,865 | 347 | //! Regression tests for issue #1030 — the methylation extractor must accept
//! Bismark's **non-directional** PE output, where the SAM first/second-in-pair
//! FLAG bits are deliberately swapped for CTOT/CTOB pairs (the first-in-file
//! record, still sequencing Read 1, carries `0x80`). Before the fix,
//! `BismarkPai... |
f5bd3c5ec14ccdbfc1e547327245f0162104d6ea8c33c47aac48e4dae49c4b14 | Rust | 13,958 | 351 | //! Reconstitute a multi-FASTA reference from a Bismark genome directory.
//!
//! Equivalent to Perl Bismark's auto-reconstitution at `bismark:5129-5141`
//! when `--cram_ref` is not supplied: walks the Bismark genome directory,
//! concatenates the chromosomes into a single multi-FASTA file, and
//! writes it to `outp... |
e79f3c59531b3ed2ebb7ce127d50524f10ebfde6f744b1d06e246e93ba2f92af | Rust | 14,023 | 339 | //! #787 Illumina 5-Base variant-vs-methylation DECONVOLUTION (the SNP-aware caller).
//!
//! The 5-Base SE/PE drivers call methylation per read: a read `T` at a genomic C is
//! "methylated". That is SNP-naive — a genuine **C>T genetic variant** also reads as
//! `T` and would be miscalled as 5mC. DRAGEN deconvolutes ... |
ef440443f1ba5d1ee038f91a742babc6b001e37e6ab8ec2d8ba160fa1cd4fe35 | Rust | 14,354 | 398 | //! Whole-genome FASTA reader, faithful to Perl `bam2nuc`'s
//! `read_genome_into_memory` (`:474-563`) + `extract_chromosome_name`
//! (`:565-575`). This is a line-for-line twin of `coverage2cytosine`'s genome
//! reader (the two Perl routines are identical), trimmed to bam2nuc's needs and
//! given a [`Genome::seqs`] ... |
572b7f06e838bb08a9fe9482f77cbdfc73593594f9691dca85b8d34df090a211 | Rust | 14,443 | 387 | //! #1025 Phase 1 — unaligned BAM (uBAM) read input.
//!
//! Bismark has no native uBAM input (neither did Perl v0.25.1). This module
//! transcodes a uBAM into a temporary FASTQ that byte-matches what
//! `samtools fastq` would emit, so the **existing, byte-frozen** bisulfite-convert
//! → align → merge pipeline consu... |
1ca2b7dc8dac07bcb44d21d7ab3a16779c979eebf8c92bda241046bca9d84be2 | Rust | 14,744 | 414 | //! Command-line interface for `bismark2bedGraph`.
//!
//! [`Cli`] is the clap-derived parser; [`Cli::validate`] resolves it into a
//! [`ResolvedConfig`], rejecting unsupported / conflicting flag combos with
//! Perl-parity error messages (see [`crate::bedgraph::error`]).
//!
//! Flags accepted for Perl compatibility ... |
c05fa9ceb2c7f6b7251995b74a677cde49296ae6ea4a3f2d5a31f8687c6259f5 | Rust | 14,849 | 400 | //! Mono-/di-nucleotide counter + genomic-composition cache.
//!
//! Faithful to Perl `bam2nuc`'s `process_sequence` (`:318-343`) and
//! `get_genomic_frequencies` (`:160-216`).
//!
//! [`NucCounts`] is an **allocation-free** tally: a `[u64; 256]` mono array +
//! a heap `[u64; 65536]` di array (indexed by the packed b... |
39a5bafdad694aca096ee30bf6b793ff0bda892280caa67c865bc9f637bc7da2 | Rust | 15,226 | 419 | //! Whole-genome FASTA reader, faithful to Perl `read_genome_into_memory`
//! (`coverage2cytosine:1648-1739`) + `extract_chromosome_name` (`:1741-1751`).
//!
//! Quirks reproduced (SPEC §6):
//! - **Four-suffix glob priority**: `*.fa` → `*.fa.gz` → `*.fasta` →
//! `*.fasta.gz`; the **first tier with ≥1 matching filen... |
726766f6c1f9c9747fea8bf6858570f866d9facaae16c1c48147de85d172b327 | Rust | 15,304 | 374 | //! SE + PE extraction pipelines (Phase B + Phase C).
//!
//! Per SPEC §7.2 (SE) + §7.3 (PE): record/pair at a time, classify XM bytes,
//! route to split files + accumulate M-bias counters + bump splitting-report
//! counters.
//!
//! Multicore (Phase F), gzip (Phase E), bedGraph/cytosine_report subprocess
//! (Phase ... |
1ab909b14b00c260ce630f8485f07c13fde0de57231d112c83758d148d65623d | Rust | 15,398 | 350 | //! Alignment report parser + fill (SPEC §2.7a). The mandatory data source.
use crate::report::reports::{
field1_owned, graph_value, join_with, report_lines, strip_first_percent, unknown_tr,
};
use crate::report::template::{rfind, subst_all};
/// Captured alignment-report fields (raw bytes, verbatim from the repo... |
dcb130afa668d631dae905806181b2a74128f6eb40783b09dc7bc24365a6efc1 | Rust | 15,583 | 375 | //! Phase C.2 integration tests.
//!
//! Covers:
//! - **#865** empty-file-sweep STDERR log lines match Perl's `warn` output
//! (`{filename} contains data ->\tkept\n` and `{filename} was empty
//! ->\tdeleted\n`).
//! - **#864** splitting-report byte-shape on a known fixture (regression
//! guard for the 4 Criti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.