sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a9489632aa0750e457baa9c3e5eff5bdaa254c7a4ad4343e224f3180db7f0204
Rust
751
38
#[cfg(target_os = "android")] pub mod android; use anyhow::Result; #[derive(Clone, Debug)] pub struct PickedFile { pub data: Vec<u8>, pub file_name: String, } #[cfg(not(target_os = "android"))] pub async fn pick_file_rfd() -> Result<PickedFile> { use anyhow::Context; let file = rfd::AsyncFileDialog::...
56830e90b188e89cb76564ae8d833e8b7cb4778527b610062d5421404f0b1cb5
Rust
785
28
//! Minimal STDERR logger. Diagnostics are never part of the byte-identity gate; //! `--verbose` gates the extra detail. Mirrors `bismark-genome-preparation`. /// Tiny logger: `note` always prints (Perl `warn`-level); `info` only with /// `--verbose` (Perl `$verbose and print`). #[derive(Debug, Clone, Copy)] pub struc...
e65a00c587423b4a2b1ce38c75d666b556d733eafc0c010f59bef04e9c11d067
Rust
800
33
pub(crate) struct CodeWriter { state: String, indent: usize, } impl CodeWriter { pub(crate) fn new() -> Self { Self { state: String::new(), indent: 0, } } pub(crate) fn add_line<T: AsRef<str>>(&mut self, line: T) { self.indent -= line.as_ref().chars(...
d40fc530f3ccaf03bdd5f8dfd01e982661c4aef239de3ab6551746f4a4961f1e
Rust
868
19
//! Permit pool for concurrent slot management. //! //! The permit system uses typestate to enforce valid state transitions at compile time: //! - `PermitInUse` → `PermitIdle` via `into_idle()` (returns to pool on drop) //! - `PermitInUse` → `PermitPoisoned` via `into_poisoned()` (orphaned on drop) //! - `PermitPoisone...
e67f59b633defbbd56efc11439733cd0e20cd312fb02e411cf09d17eac9b44eb
Rust
1,034
36
#![cfg(target_os = "android")] use jni::sys::{jint, JNI_VERSION_1_6}; use std::os::raw::c_void; use std::sync::Arc; #[allow(non_snake_case)] #[no_mangle] pub extern "system" fn JNI_OnLoad(vm: jni::JavaVM, _: *mut c_void) -> jint { let vm_ref = Arc::new(vm); rrfd::android::jni_initialize(vm_ref); JNI_VERSIO...
55aa8a77030862b7e9ca662e9d3e88a44fb0602850f85e9cd82552090f937d12
Rust
1,048
24
//! Typed errors for `bismark-report`. //! //! `main` maps any of these to exit code `1`; clap parse errors map to `2` //! (clap convention). None of the error *text* is part of the byte-identity //! gate — diagnostics go to STDERR only. #[derive(Debug, thiserror::Error)] pub enum ReportError { /// Direct `std::io...
640eb67cd13aeb06cdd7160d49e8e51c00d7628cb9ab87d3352d84aa782b6946
Rust
1,091
28
//! # Bismark — the whole bisulfite-sequencing suite (Rust): one crate, one binary. //! //! Every tool is a module here (`bismark::bam2nuc`, `bismark::dedup`, …), folded //! from the former 14 crates (epic `plans/07062026_single-binary-suite/`). The //! multicall CLI + classic-name aliases are wired in Phase 3; during ...
2e8c8ba8b1938a0e515ee27a20aa0d64fbc3a293057621eaab1d3c872c2d4ac7
Rust
1,157
30
//! methylseq CLI-surface conformance — `BISMARK_REPORT` (nf-core/methylseq **4.2.0**). //! //! Asserts the Rust `bismark2report` CLI accepts the command methylseq's report //! module emits. See `plans/06122026_methylseq-cli-conformance/`. //! //! **Command template** (`modules/nf-core/bismark/report/main.nf`; //! `con...
24cd4250e48bcea551c3dd521c8ce8fe3d3d3d5279419b3c35979bdfd310e2fa
Rust
1,209
31
// 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...
c6fd01b3b0268fda85cf823874e105f9d5248b287adffd08838ab7765dbf8a59
Rust
1,266
28
//! Tripwire: the checked-in `docs/images/bismark_summary_report.html` is the //! STALE v0.15.2 Highcharts-era report (zero `Plotly` tokens). The acceptance //! oracle must be a fresh run of the current Perl `bismark2summary` — never //! this file. This test fails loudly if that committed HTML ever gains a //! `Plotly`...
b1e4891eeb5fbbe35f85a46a29280a8b22c9040add1598120a706d6e69fb3c22
Rust
1,308
50
use std::sync::atomic::{AtomicBool, Ordering}; use tracing::{info_span, Subscriber}; use tracing_subscriber::layer::{Context, Layer}; use tracing_subscriber::registry::LookupSpan; use burn_wgpu::{Wgpu, WgpuDevice}; // Global flag to enable/disable sync static SYNC_ENABLED: AtomicBool = AtomicBool::new(false); // Tr...
bb2780990cc4e88f73e7fe63c535cada44259b6ce332f3d0a1af30b900ad20dd
Rust
1,347
40
//! THROWAWAY SPIKE (filter_non_conversion port) — NOT shipped code. //! //! Question: does a pure noodles `RecordBuf` -> BAM round-trip preserve the //! alignment-record body byte-identically vs samtools' own reference, so a //! verbatim-passthrough filter can rely on it for byte-identity? //! //! Run: cargo run -p bi...
9a99ec14dd6b318a0a29908bde43549ba42066e810a8ac3478a28437abc16fa3
Rust
1,349
39
//! Step IV (opt, `--combined_genome`): the Bismark-Rust combined-reference //! extension. Additive — runs after the standard CT/GA outputs + indices. //! //! Writes `Bisulfite_Genome/Combined/genome_mfa.combined.fa` (all CT-converted //! records, then all GA-converted records — built directly from the converted //! st...
0a7bc4f212a046d408963cb5c4522be5beb2269ad5f1c672685242b9015f5488
Rust
1,378
54
use brush_render::{camera::Camera, Backend}; use burn::tensor::Tensor; #[derive(Debug, Default, Clone)] pub struct SceneView { pub camera: Camera, pub image: image::DynamicImage, } // Encapsulates a multi-view scene including cameras and the splats. // Also provides methods for checkpointing the training proc...
9ba1bc70fd190a3dd6c7850a9d51a465b49de12bc58793567744a0acc8ae62bc
Rust
1,384
55
#[derive(Debug, Default, Clone)] pub struct Camera { pub fov: glam::Vec2, pub center_uv: glam::Vec2, pub position: glam::Vec3, pub rotation: glam::Quat, } impl Camera { pub fn new( position: glam::Vec3, rotation: glam::Quat, fov: glam::Vec2, center_uv: glam::Vec2, ...
85f236ea8465b3ddfb3ce5347b928d5f1848333b50bbafe1f80608f3a8ff0ad1
Rust
1,459
42
//! methylseq CLI-surface conformance — `BISMARK_SUMMARY` (nf-core/methylseq **4.2.0**). //! //! Asserts the Rust `bismark2summary` CLI accepts the command methylseq's summary //! module emits. See `plans/06122026_methylseq-cli-conformance/`. //! //! **Command template** (`modules/nf-core/bismark/summary/main.nf`; //! ...
4763552c6a8b02fdcd48e93aeab0bace99b9f9419c6d5e7a135562477cd5d257
Rust
1,466
41
//! `bismark-io` — Bismark-aware BAM/SAM/CRAM I/O on top of [`noodles`]. //! //! This crate is the shared library for Bismark's Rust rewrite, exposing //! Bismark-flavoured wrappers around [`noodles`] record types — strand- //! classified, tag-decoded, CIGAR-aware. //! //! See `DESIGN.md` (in the crate root) for the de...
e09cc30567a6bf0714b68eee839741fe6d5052adfeca0d85190167e65d0b3bd4
Rust
1,588
43
//! Drift guard: the committed `summary_template.html` MUST equal the inline //! single-quoted heredoc in the Perl `bismark2summary` source. If the Perl //! template is ever edited, this fails loudly so the embedded copy is //! refreshed. Auto-skips when the Perl source is unavailable. use std::path::Path; const TEMP...
611f5d5138c1287e5398d3fbe2d6f4980af5fef58f37fde97251c538aeeac8ca
Rust
1,612
53
fn main() -> anyhow::Result<()> { let wgpu_options = brush_viewer::wgpu_config::get_config(); #[cfg(not(target_arch = "wasm32"))] { // Build app display. let native_options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default() .with_inner_size(egu...
805194c24f19a030aa82882e0450f73a0bb2f460560407949db26e2a99a013c0
Rust
1,687
40
//! SAM header → ASCII chromosome-name lookup table. //! //! Built once per input file at `extract_se` entry. Mirrors `bismark-dedup`'s //! refid-table pattern (`pipeline.rs:64-82`) but returns chr **names** rather //! than interned u32 ids — the extractor's output lines embed the literal //! chr string. //! //! Per Re...
360ef79702d5df81233050be86c3cd3df0ef4f3d5824013ca145830968ef2651
Rust
1,782
76
use burn_jit::{JitElement, JitRuntime}; use burn_wgpu::JitTensor; use std::collections::HashMap; #[derive(Clone, Copy)] pub(crate) enum DimBound { Exact(usize), Any, Matching(&'static str), } pub(crate) struct DimCheck<'a, R: JitRuntime> { bound: HashMap<&'a str, usize>, device: Option<R::Device>,...
cf42cf94ca9b395acf592ef4b83cb6efff5cbaeaceaf3dce969f223aad397953
Rust
1,910
63
pub mod colmap; pub mod colmap_read_model; pub mod nerf_synthetic; pub mod scene_batch; use std::path::{Path, PathBuf}; use anyhow::Result; use brush_train::scene::SceneView; use burn::{ prelude::Backend, tensor::{Tensor, TensorData}, }; use image::{DynamicImage, GenericImageView}; pub(crate) fn normalized_p...
c0dcd618c15352923ddd2249032d8e3ed7d06fce865a06c7726c722f112df138
Rust
1,965
45
//! Deterministic `.txt` golden test — runs the built binary end-to-end and //! asserts the byte-exact table. Needs **no** Perl (the `.txt` is pure //! pass-through), so it gates the table on every CI runner. mod common; use std::process::Command; #[test] fn wgbs_two_sample_txt_is_byte_exact() { let dir = tempfi...
722f658313b6855e74a8cecdbd11c2058583c2571cfa4b149a31f45e91992cdf
Rust
2,029
47
//! Typed errors for `bismark-nome-filtering`. //! //! Produced at the CLI / orchestration boundary. Genome-load failures //! propagate from the promoted [`crate::io::genome`] reader via the //! [`BismarkNomeError::Genome`] `#[from]` variant — note these come from the //! module-local `GenomeError`, NOT from `crate::io...
d59849a6672c9ab441f0647499a7f3bc91ae0594cd860cf78798dd9ae00f5cfc
Rust
2,032
67
//! Phase A integration sanity tests for `coverage2cytosine_rs`. //! //! Spawns the built binary and asserts the minimum Phase-A bar: it builds, //! prints a recognisable `--version` provenance string, lists the v1.0 flags //! in `--help`, and fails clearly on bad invocations. use assert_cmd::Command; use predicates::...
b605038f65c49a8e1ce38ef1f2a133f15c801ee9f759f552d7a9eaba35e4b198
Rust
2,039
53
//! methylseq CLI-surface conformance — `BISMARK_GENOMEPREPARATION` //! (nf-core/methylseq **4.2.0**). //! //! Asserts the Rust `bismark_genome_preparation` CLI accepts every command //! methylseq's genome-prep module emits. See `plans/06122026_methylseq-cli-conformance/`. //! //! **Command template** (`modules/nf-core...
f98d59827003c811a7db11794730d96fa3190f0bc073757e359363eb325aadbe
Rust
2,082
55
//! Argument-struct types for the extraction kernel. //! //! Per SPEC §6.3 + §7.7: typed parameter structs replace the 14-arg //! `extract_calls` signature seen in the prior-art Rust port. Adding a //! new flag = adding a typed field, not appending to a positional list. //! //! Phase A: defines the struct shape. Field-...
581a889bd4e4bf35d43c65cc10d3fdb918288a6b76bceb3949da6ee2fba438cd
Rust
2,128
59
//! Real-data smoke (`#[ignore]`) for the oxy byte-identity gate. //! //! The AUTHORITATIVE real-data gate is `scripts/bam2nuc_byte_identity.sh`, which //! runs BOTH the Rust `bam2nuc_rs` and the Perl `bam2nuc` v0.25.1 over a real //! genome + BAMs and diffs the outputs byte-for-byte (see that script's header //! for t...
c0c9bb553479015ca42a2932d1785d76c6b18958bb5fb0dd269a4e9b1257a474
Rust
2,204
63
//! Step I output tree: `<genome>/Bisulfite_Genome/{CT,GA}_conversion/`. use std::path::{Path, PathBuf}; use crate::genome_prep::error::GenomePrepError; use crate::genome_prep::logging::Logger; /// Create the `Bisulfite_Genome/{CT,GA}_conversion/` tree under `genome_folder`. /// If `Bisulfite_Genome/` already exists...
5be327010145b9731250b50ca62006c00a1301ce744e1833ff599922d476da29
Rust
2,222
70
use burn::tensor::{backend::Backend, module::conv2d, ops::ConvOptions, Tensor}; fn gaussian<B: Backend>(window_size: usize, sigma: f32, device: &B::Device) -> Tensor<B, 1> { let sigma2 = 2.0 * sigma.powf(2.0); let window_extent = (window_size / 2) as f32; let gauss_floats: Vec<_> = (0..window_size) ...
845ae89b40be571c27c69e91507e7e92725a6e7426a07ee4f504342cae30a0de
Rust
2,225
78
//! coglet: Rust execution engine for cog models. mod health; pub mod input_validation; mod prediction; mod predictor; mod version; pub mod bridge; mod fd_redirect; pub mod orchestrator; pub mod permit; pub mod service; mod setup_log_accumulator; #[cfg(feature = "tracing")] pub mod trace; pub mod transport; pub mod w...
e8bc794fbb16776704086f5b91a1fdbd88cda3ac4edce2760223cc6115e4bce6
Rust
2,264
81
//! Tracing layer that accumulates all logs from coglet server during setup. //! //! Captures every tracing event from the moment the server starts until setup completes. //! This includes: //! - Initial server startup logs ("coglet <version>") //! - Orchestrator logs ("Spawning worker subprocess") //! - Re-emitted wor...
bd58a28ad853d29183782f47a6cd121b35e91360e63f9155ae5aea61c309895b
Rust
2,336
76
use brush_render::camera::Camera; use glam::{Mat3, Quat, Vec2, Vec3}; pub struct OrbitControls { pub focus: Vec3, pub radius: f32, pan_momentum: Vec2, rotate_momentum: Vec2, } impl OrbitControls { pub fn new(radius: f32) -> Self { Self { focus: Vec3::ZERO, radius, ...
888a258bcf7bc535c0fa8b57fdb1f54e7cebaf23c80ce952194f24389f51b196
Rust
2,462
57
//! #1025 Phase 1 — real-data regression guard for the uBAM transcoder. //! //! Uses genuine **Trim Galore 2.2.0 `--output-format ubam`** output (subsampled to 200 //! single-end reads / 200 collated paired-end pairs from the 10K `test_files/` BAMs) and //! asserts the in-process transcode (`ubam::transcode_ubam_to_fas...
f72f12ba7ce0c6e6b2591e9a2a28265db7e9b150096eac6e863c3dd34a91f4e9
Rust
2,484
68
//! Command-line surface (clap derive). //! //! Flag spellings match the Perl `bismark2report` exactly (underscores //! preserved: `--alignment_report`, `--dedup_report`, `--splitting_report`, //! `--mbias_report`, `--nucleotide_report`). `--version`/`--man` are handled //! manually (clap's auto-version is disabled) so...
790aa44e8f0be1600974505ac6e85090bb5a5593a747e4edd9ea04b036369cda
Rust
2,514
61
// 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...
a52241b7aff1a8b4f3a28f04fc24cc265d26ab02bf4efdb42693e7424bda06f2
Rust
2,516
78
//! Faithful reproduction of Perl's `substr(EXPR, OFFSET, LEN)` rvalue //! semantics (SPEC §9). //! //! The sole caller passing a possibly-negative offset is the reverse-read //! genome-window extraction in Phase B (`substr(chr, last_end-3, …)` for a //! reverse read whose rightmost coordinate is at chromosome position...
d9c4244f272287e87d8d2430b43fb3e26801b93e3ccd6696c248afece57f38f1
Rust
2,533
67
//! Function-level micro-benchmark for `SamRecord::parse` (06222026 perf epic). //! //! The parse byte-split's win is real but below the end-to-end noise floor //! (the aligner is ~90% bowtie2-bound under `-p`; GATE_00). This bench isolates //! it: it compares the current byte-scan field split against the pre-epic //! ...
1b542e373cccacd5a912ac899cd5be810ca79edd5b205ee91663afdb0a2f13f8
Rust
2,632
65
//! Typed errors for `bismark-genome-preparation`. //! //! The binary's `main` maps any of these to exit code `1`; clap parse errors //! map to `2` (clap convention). None of the error *text* is part of the //! byte-identity gate (diagnostics are STDERR). use std::path::PathBuf; /// All errors raised by the genome-pr...
01ee3f4fbc00c848ff9620b8a4b088757d608ef679980d5c220219641975029d
Rust
2,637
90
//! Phase A integration tests for the `NOMe_filtering_rs` binary. //! //! Covers the boot surface: `--version`, the `--merge_CpGs`+`--CX` die, the //! mandatory-genome die, and a valid invocation that loads a tiny synthetic //! genome and exits 0. Per-read processing + output is Phase B (not tested here //! — Phase A's...
b88981ed37d9a8b1d438525f703b6b0247dc87523716c9b7b98b36d1698cf264
Rust
2,803
92
//! Output-filename derivation matching Perl `NOMe_filtering` (`:464-468` plus //! the force-`.gz` at `:74-76`). //! //! The Perl chain is: //! ```text //! $out = $infile; //! $out =~ s/\.gz$//; # strip ONE trailing .gz //! $out =~ s/\.txt$//; # strip ONE trailing .txt //! $out =~ s/$/.manOwar.txt/; #...
e6bebcb46039b5e4bebd3c0985dd9c2bc74f56ed70a7b2b65eb7d0e1dd706cae
Rust
2,835
83
//! Methylation-call validation, mirroring Perl `validate_methylation_call` //! (`bismark2bedGraph:558-588`). //! //! The branch (CpG vs non-CpG) is chosen by the call letter: Perl tests //! `$meth_state2 =~ /^z/i` (`:564`), so a call starting with `z`/`Z` takes //! the CpG branch. Comparisons are **full-field string e...
97c9bb08f0939c2dc479c93bacfdf16bc0741d3f626858da1d6afd6e91d4ca8e
Rust
2,849
94
//! Optional `--ucsc` post-pass (Perl `bismark2bedGraph:514-552`). //! //! Re-reads the just-written bedGraph and emits a UCSC-compatible variant //! (`{out}_UCSC.bedGraph.gz`): the header line is copied verbatim; for each //! data line the chromosome name is transformed — `MT` → `chrM`, and any //! name not already st...
f913540eb65435e52f8847844f9108f8278b6221b12aa94238f840fb0ac9e42f
Rust
2,896
86
use brush_render::camera::{self, Camera}; use brush_train::scene::SceneView; use std::io::{Cursor, Read}; use crate::colmap_read_model; #[allow(unused_variables)] pub fn read_dataset( zip_data: &[u8], max_frames: Option<usize>, max_resolution: Option<u32>, ) -> anyhow::Result<Vec<SceneView>> { let mut...
4f5271b5944988c918bfb2536e4cc732f42ecb827855131e765d206bd7dbd5f1
Rust
2,976
70
//! Typed errors for `bismark-methylation-consistency`. //! //! Produced at the CLI-validation and pipeline-orchestration boundaries. //! Library errors from [`bismark_io`] propagate via the //! [`MethConsError::Io`] variant. `main` maps any of these to exit code 1; //! clap parse errors exit 2 (clap convention). None ...
f50f026b60cff6ddd044ea3755f652ccf55aec31c3b02e0e0ee9354c6ac301bd
Rust
3,006
78
//! `bismark-methylation-consistency` — Rust port of Bismark Perl's //! `methylation_consistency` script. //! //! Splits a Bismark alignment BAM into three BAMs by the **read-level** //! consistency of its CpG (or, with `--chh`, CHH) methylation calls — //! consistently methylated (`>= upper_threshold`), consistently u...
a96328175dd5fd83d8337681fb54a94390fbe99dad7cf6db3e1604d6f71bd0f5
Rust
3,029
98
//! The tab-delimited `bismark_summary_report.txt` table. //! //! Perl `bismark2summary:228-246` (header), `:387-404` (rows), `:478-481` //! (write). One row per sample in discovery/argv order, 15 tab-separated //! columns, header + each row `\n`-terminated. Values are the **raw** //! captured strings (empty = not foun...
9f33e397add6251e6e7cddcf422ca84b2bfe26911ff7504f8bd04fbf52ce268d
Rust
3,037
94
//! Output-filename derivation, faithful to Perl `bam2nuc` `:147-152`. //! //! ```text //! $outfile = basename($infile); # s/.*\/// //! die unless $outfile =~ s/(bam|cram)$/nucleotide_stats.txt/; //! ``` //! //! Two quirks replicated exactly: //! - **No dot anchor:** the regex strips a trailing `bam`/`c...
97e05a2a9e85178878e20abba073900bab85e6d3b3fd19a77350120b89590295
Rust
3,082
102
//! Phase A sanity tests. //! //! Spawns the `bismark_methylation_extractor` binary with basic flags //! and asserts the binary boots correctly + `--help` lists all 35 flags //! + `--version` matches the provenance regex. use assert_cmd::Command; use predicates::str::is_match; #[test] fn version_output_matches_proven...
0e8c6571d9d0c3bf57408c206e8dac739a4c296f95c5bc998b6e1e47c777f385
Rust
3,089
92
//! STDERR diagnostics — a logger gated by `--quiet`. //! //! All diagnostic output goes to STDERR, matching Perl `methylation_consistency`'s //! `warn` model (stdout stays clean; only `--version` writes to stdout, in //! `main.rs`). These messages are NOT part of the byte-identity gate (SPEC §7) //! — they mirror Perl...
7bc2eea8ba67adc58089d5482c858de13bd1bc1d71e0073ae7eaf6278c1c26ad
Rust
3,100
76
//! Typed errors for `bismark-aligner` (Phase 1: CLI / discovery / aligner //! detection). //! //! `main` maps any of these to exit code `1`; clap parse errors map to `2` //! (clap convention). None of the error *text* is part of the byte-identity //! gate (diagnostics go to STDERR), but messages mirror Perl `die`s whe...
5fa8504c269df0e3aa20a0a373ff46f4f3fe1241e5365d93c5350a60b34e3f8f
Rust
3,133
96
//! Output-filename derivation matching Perl `filter_non_conversion` //! (`process_file`, lines 85–98). //! //! The Perl chain for each output is: //! ```text //! my $outfile = $infile; # the CLI arg verbatim — NO directory strip //! $outfile =~ s/\.bam$//; # strip a single trailing ".bam" (dot-anchored) /...
05b70fa8abc934ce2230cfbe8fcb71a7deebffea600076f181ed0a5e592992e6
Rust
3,140
91
use brush_render::camera::Camera; use brush_render::Backend; use burn::tensor::Tensor; use brush_train::scene::Scene; use brush_train::scene::SceneBatch; use crate::image_to_tensor; pub struct SceneLoader<B: Backend> { images: Vec<Tensor<B, 3>>, cameras: Vec<Camera>, index: usize, batch_size: usize, ...
85ea58cebb21bfd5124710370bf871a7c6c72db9eade1efe620701aee5c9f85e
Rust
3,215
85
//! Generate Python stub files for coglet. //! //! Run with: cargo run --bin stub_gen //! //! Custom generate logic: pyo3-stub-gen places classes from the native //! `coglet._impl` module into the `coglet` parent package stub. We redirect //! that output to `coglet/_impl.pyi` so native module types are preserved in //...
39e3653e915e38220ce86eb95dfb73bb25113d5e9409d3d14cb46d9fb2625666
Rust
3,229
93
#![allow(clippy::too_many_arguments)] #![allow(clippy::single_range_in_vec_init)] use brush_kernel::bitcast_tensor; use burn::backend::Autodiff; use burn::tensor::{ElementConversion, Int, Tensor}; use burn_jit::JitBackend; use burn_wgpu::{JitTensor, WgpuRuntime}; use camera::Camera; mod dim_check; mod kernels; mod saf...
385e3661d5cb94d204d6ac651b6c5f8b297d36191b00242da807f5005395df13
Rust
3,304
84
use super::PickedFile; use anyhow::Result; use async_channel::Sender; use jni::objects::{GlobalRef, JByteArray, JClass, JStaticMethodID, JString}; use jni::signature::Primitive; use jni::JNIEnv; use lazy_static::lazy_static; use std::sync::Arc; use std::sync::RwLock; lazy_static! { static ref VM: RwLock<Option<Arc...
3ec94b691d8710a6673eb6a09d78797fa37dfac8a2a9279adcb3023a67251890
Rust
3,366
97
//! `{{date}}` / `{{time}}` generation — the report's only non-determinism. //! //! Two paths (PLAN A6, zero new dependency trees): //! * **deterministic** (`--__test_timestamp <epoch>`): format the epoch in //! **UTC** with pure-std integer civil-time math → byte-stable golden HTML. //! * **default** (`None`): local...
dafd19ab8685e6dc49fc127f6c0060e88ba32efa8a863b5ed2aa8d6b9e6fdf45
Rust
3,435
118
//! Version information for coglet. /// Coglet version from Cargo.toml pub const COGLET_VERSION: &str = env!("CARGO_PKG_VERSION"); /// Version information for the runtime. #[derive(Debug, Clone, serde::Serialize)] pub struct VersionInfo { /// Coglet runtime version. pub coglet: &'static str, /// Git SHA (...
71656c0f66969bd4383ef37eaab978f8d9d10b7463981c2c42d634e35a3b679b
Rust
3,448
84
//! Functional (not byte-identity) test: a scaffold-heavy genome. //! //! Perl `bismark2bedGraph`'s default mode opens **one temp filehandle per //! chromosome** (`:274-283`), so a genome with thousands of scaffolds exceeds //! `ulimit -n` (~1024) and Perl dies — which is the whole reason Perl's //! `--gazillion` mode ...
6f62c8db71df1a2b9ee260a8ba982f42bb92caa7bf03b8607903f51d56f1f718
Rust
3,453
96
//! Sentry error reporting integration. //! //! Initializes Sentry when `SENTRY_DSN` is present in the environment. //! When no DSN is configured, the SDK creates a disabled (no-op) client //! with zero runtime overhead. use tracing::info; /// Guard returned by [`init_sentry`]. Must be held for the lifetime of the //...
659db7bda0cf38d5e29cfbca3532a40a50815d97c3351fd41ff4b036ff77ffdb
Rust
3,591
124
//! HTTP server implementation. use std::net::SocketAddr; use std::sync::Arc; use tokio::net::TcpListener; use tokio::sync::watch; use tracing::info; use crate::service::PredictionService; use super::routes::routes; #[derive(Debug, Clone)] pub struct ServerConfig { pub host: String, pub port: u16, /// ...
702fc4217693aeddc4d8277b613a78f7e42dc8f53fc5f2ce252bd46ca677dfdf
Rust
3,610
89
//! `bismark-genome-preparation` — Rust port of the Perl `bismark_genome_preparation`. //! //! Reads a genome directory of FASTA file(s) and writes two in-silico //! bisulfite-converted references — a **C→T-converted** (top-strand) copy and a //! **G→A-converted** (bottom-strand) copy — under //! `<genome>/Bisulfite_Ge...
76c8c14666a913b6ec9a7b70228a1f06ab9c17e1ddd949ffabe73af0e2de83a0
Rust
3,615
109
use std::sync::Arc; use brush_render::Backend; use burn::tensor::Tensor; use burn_wgpu::{JitTensor, WgpuRuntime}; use egui::TextureId; use wgpu::ImageDataLayout; fn copy_buffer_to_texture( img: JitTensor<WgpuRuntime, f32>, texture: &wgpu::Texture, encoder: &mut wgpu::CommandEncoder, ) { let [height, w...
e7d6ba70f2e8bb98680d479909fca82d85fddefaab36220ef6e12a80f22acbaf
Rust
3,616
133
//! Predictor traits and prediction lifecycle types. use std::collections::HashMap; use std::time::{Duration, Instant}; pub use crate::prediction::{CancellationToken, PredictionOutput}; /// Result of a completed prediction. #[derive(Debug, Clone)] pub struct PredictionResult { pub output: PredictionOutput, p...
92e55f3228a44a9b3df58c52f129a090685ea7ce9ec68fedd36fea854b8d2902
Rust
3,617
91
//! Cancellation support for predictions. //! //! Sync predictors use `PyThreadState_SetAsyncExc` to inject a //! `CancelationException` (a `BaseException` subclass) into the Python //! thread running `predict()`. //! //! Async predictors use asyncio task cancellation: //! - Store task reference when prediction starts ...
c7fa86afe4354dac2477864d3296d2bbdcdb334605243fa574693f066535e0ed
Rust
3,667
86
//! Typed errors for `bismark-summary`. //! //! All variants are produced at the orchestration / pipeline layer. The //! binary's `main` maps any error to a nonzero exit code (the value is not //! byte-gated; STDERR text is informational). Mirrors the `bismark-dedup` //! `error.rs` shape. use std::path::PathBuf; /// ...
ccffb0e6dc1038c42c5c2750631bef9c072ad1da4315aac738da1801ab358462
Rust
3,773
145
//! Binary-level behaviors: exit codes, output naming, `-o`, and error paths //! (PLAN D4 / §6.1). These do not need Perl. use std::path::Path; use assert_cmd::Command; use tempfile::tempdir; fn bin() -> Command { Command::cargo_bin("bismark2report").unwrap() } fn minimal_pe_report() -> Vec<u8> { std::fs::r...
35068ba11fc3e4e47305ceae80840751ddf71fe5b396d6aa1ac6929e7f428e20
Rust
3,841
97
//! HTML `{{report_timestamp}}` formatting. //! //! Perl uses scalar `localtime` (`bismark2summary:488`), a C `ctime` string: //! `"Www Mmm <space-padded D> HH:MM:SS YYYY"` (e.g. `"Mon Jun 1 09:07:00 //! 2026"` — note the two spaces before a single-digit day-of-month). //! //! **Deliberate deviation (documented):** th...
34dec8e21a209c05dfa481f1a864a76dec546748ae4bfaf2dada56b927401b25
Rust
3,875
112
//! Bismark coverage-file (`*.bismark.cov[.gz]`) reading + line parsing. //! //! Mirrors Perl `generate_genome_wide_cytosine_report:184-209`: gz-aware open, //! tab-split, **column 4 (percentage) and column 3 (end) discarded**, 1-based //! `start` as the lookup key. Parse policy folded from Phase-B review (B-I1/2/3): /...
7f1f45c7fbd079386031340021be20b14f24f6f267c9311b497520ebeb9af086
Rust
3,963
94
//! Typed errors for `bismark-bedgraph`. //! //! Variants are produced at CLI-validation and pipeline boundaries. //! Messages mirror Perl `bismark2bedGraph` v0.25.1 where a user-facing //! string exists (cited by Perl line number). The binary's `main` maps //! any [`BismarkBedgraphError`] to exit code 1 (clap parse er...
934a9ec591d394f151cb6867d69a6b155f72d437102d66ce4fc18f0b32c8f636
Rust
3,979
103
// 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...
2a9dcf564994c3427106ec2f6e3487cc74bf01a24be1ad0b23ac10487faaa8eb
Rust
3,988
115
//! methylseq CLI-surface conformance — `BISMARK_COVERAGE2CYTOSINE` //! (nf-core/methylseq **4.2.0**). //! //! Asserts the Rust `coverage2cytosine` CLI accepts every command methylseq's //! c2c module emits. See `plans/06122026_methylseq-cli-conformance/`. //! //! **Command template** (`modules/nf-core/bismark/coverage...
0346f24f65aaefc0c9bf922f2b8e65f5019fde67ab4fe5ac9658bc7fa00b0469
Rust
3,991
115
//! Custom tracing layer for worker subprocess. //! //! Ships structured tracing events over IPC to orchestrator, preserving target and level. //! Optionally writes to fd 101 for direct debugging (controlled by RUST_WORKER_DIRECT_LOG=1). use std::io::Write; use std::sync::{Arc, Mutex}; use tokio::sync::mpsc; use trac...
57e8c630ea97f3ce67c249a433d567a897df46a2e3fadc1ea934d1e11114fb26
Rust
4,015
102
//! methylseq CLI-surface conformance — `BISMARK_DEDUPLICATE` (nf-core/methylseq **4.2.0**). //! //! Asserts the Rust `deduplicate_bismark` CLI accepts every command methylseq's //! `BISMARK_DEDUPLICATE` module emits. See `plans/06122026_methylseq-cli-conformance/`. //! //! **Command template** (`modules/nf-core/bismar...
67d7ed034ec680f9ef277ef904a4ae0db8418fe092959630d5421ed78373d94c
Rust
4,018
81
//! Shared build-time version/provenance for the Bismark Rust suite. //! //! The **suite version** (single source: `rust/VERSION` or `$BISMARK_SUITE_VERSION`), //! the git short-hash, and a reproducible build timestamp are captured at build //! time by `build.rs`. Every Bismark Rust binary reports the *suite* version v...
08ae8db848765843112338848b0c8178f2d010195a6b8d6b671b2960e9ea919f
Rust
4,135
117
//! The always-on cytosine-context summary (`*.cytosine_context_summary.txt`). //! //! Mirrors Perl `reset_context_summary` (`:1961-1975`), `context_reporting` //! (`:1977-1988`), and `print_context_summary` (`:63-78`): a 64-cell grid of //! the 16 `C{A,C,G,T}{A,C,G,T}` trinucleotides × 4 upstream bases `{A,C,G,T}`, //...
1eed75f46b2fa0f9e7adc60d316d6a512bd49b064da2c72e9cb018affe382b42
Rust
4,263
113
//! Top-level orchestration: Step I (folders + discovery + early aligner-path //! validation) → Step II (conversion) → Step III (indexing) → Step IV (opt //! combined genome). use crate::genome_prep::cli::{Aligner, Cli}; use crate::genome_prep::error::GenomePrepError; use crate::genome_prep::logging::Logger; use crate...
1f65051a36c5bbde6ebfdb010c74a197d9c4de8ab6e7e7d05d862456239a3f8a
Rust
4,296
124
//! Real-data byte-identity gate (Phase 6, `#[ignore]`). //! //! Runs Perl `bismark2bedGraph` v0.25.1 and `bismark2bedGraph_rs` on the //! SAME methylation-extractor call files in the SAME argv order, and asserts //! their **decompressed** bedGraph + coverage are byte-identical (SPEC §1.1 //! D1). This is the genuinely...
39fc729518f5123f638ab5f9704c467c07e91adf56a1491d37b737cb78118815
Rust
4,297
112
//! Faithful reimplementation of C `printf("%.15g", x)` — the format Perl //! uses for default scalar (NV) stringification. //! //! In `bismark2summary` this powers the **unmethylated** percentage arrays //! (SPEC §2.9a): `$p_*_unmeth = 100 - $p_*_meth`, where `$p_*_meth` is an //! already-rounded `%.2f` string. Perl n...
f83185f87cf04d59cdf88b7fd8fc7dd60582406e091a87bc2404d60572cc8cd4
Rust
4,323
117
//! Phase A sanity test. //! //! Spawns the `deduplicate_bismark` binary with `--version` and asserts the //! output matches the uniform suite provenance regex. This is the minimum bar for //! Phase A: the binary builds, runs, and emits a recognisable identity string. use assert_cmd::Command; use predicates::prelude::...
3ad093b96c07311e223f7493dbd7187db8cbd0a15a1968c32239317d59534603
Rust
4,395
110
//! Deduplication report parser + fill (SPEC §2.7b). use crate::report::reports::{before_first_ws, field1_owned, join_with, report_lines}; use crate::report::template::subst_all; /// Captured deduplication fields. #[derive(Debug, Default)] pub struct Dedup { pub total_seqs: Option<Vec<u8>>, pub dups: Option<V...
331b270c798efe3738c8d31f8526d81751f0fd767f2575185230a929b5f9cf61
Rust
4,464
124
//! `bismark-bedgraph` — Rust port of Bismark Perl's `bismark2bedGraph`. //! //! Consumes the methylation extractor's per-context call files //! (`CpG_OT_*`, `CpG_OB_*`, … and the CHG/CHH equivalents with `--CX`) and //! emits a sorted, gzip-compressed bedGraph + coverage file. Installed as //! `bismark2bedGraph` durin...
8827db997a8c337df6e5005506a79570eeb5daa73e9d8f3b0cddd08798b965ed
Rust
4,691
150
//! Build script for coglet-python. //! //! Captures build metadata and converts semver to PEP 440 for Python compatibility. use std::process::Command; fn main() { // Convert CARGO_PKG_VERSION (semver) to PEP 440 let version = env!("CARGO_PKG_VERSION"); let pep440 = semver_to_pep440(version); println!...
0077b8e4dcc7431d0894e22fc994cf9291c708988af56f4b2d44973c895a826a
Rust
4,747
143
//! Output-filename derivation matching Perl `methylation_consistency`. //! //! Perl line 186: `my $file_root = $file; $file_root =~ s/\.bam$//;`. That //! is the *entire* derivation — strip a **single trailing `.bam`** and keep //! everything else (including the full directory prefix) verbatim. Outputs //! are written...
95ca3a70f0da4042de3ecc1c79102d81f22443ee7f6f064cdaed42b252bb9183
Rust
4,834
116
//! Typed errors for `filter_non_conversion`. //! //! Display strings echo the Perl `filter_non_conversion` `die`/`warn` //! messages where practical. These are surfaced on STDERR (not part of the //! byte-identity gate, which covers the BAM bodies + report file), but //! keeping them faithful eases cross-checking agai...
6f52ad6db26f9b815b6c8c396465a8a6329b4f8eba74075bebca049414027ef2
Rust
4,924
120
//! `bismark-coverage2cytosine` — Rust port of Bismark Perl's `coverage2cytosine`. //! //! Reads a Bismark coverage file (`*.bismark.cov[.gz]`) + the genome FASTA and //! emits a genome-wide per-cytosine report (CpG by default; all-context with //! `--CX`). This crate is the second producer (after `bismark-bedgraph`, /...
5e768b49816588764ec7f59fe8d1c9b86451a155030ff06472c5318ed84ef316
Rust
4,937
176
//! Health status types for coglet runtime. use serde::{Deserialize, Serialize}; /// Health status of the coglet runtime. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum Health { /// Just started, status unknown #[default] ...
7fa96e26c2dae66f07e2236e456fb0530c19af25b75cd5bc2bf853ef2e41689e
Rust
4,958
120
//! Embedded `plotly/` assets + the `read_report_template` line normalizer. //! //! The HTML template itself is the inline Perl heredoc, extracted verbatim //! into `summary_template.html` (see [`crate::summary::html::TEMPLATE`]). The three //! companion assets — `plot.ly` (~3 MB), `bismark.logo`, `bioinf.logo` — are /...
7c5a1436d9ffae9972bf9e0ed5724026be139b08ea39c00550b658838cedab13
Rust
5,068
135
//! `bismark-filter-nonconversion` — Rust port of Bismark Perl's //! `filter_non_conversion` script. //! //! Reads a Bismark BAM, walks each read's `XM:Z:` methylation-call string, //! and removes reads (SE) / read-pairs (PE) with too much **non-CpG** //! methylation (apparent incomplete bisulfite conversion). A verbat...
090e356058a97fdf286775daac904c82f0971100ee0afeb0ca215e9cd56be864
Rust
5,161
148
//! Report parsers. Each submodule exposes a pure `parse(&[u8]) -> Captured` plus //! a `fill(doc, &Captured) -> doc`. The split keeps parsing unit-testable //! without any template, and concentrates Perl's **sequential** whole-document //! substitution ORDER in `fill` (SPEC §8: a later `{{name}}` replace can legally /...
27d43d6e78e6cac16efa1ad60070d520e3d7ec44d9bab9189d58744fa9b70b3d
Rust
5,230
125
//! `bismark-nome-filtering` — Rust port of Bismark Perl's **standalone** //! `NOMe_filtering` (v0.25.1). A per-read NOMe-Seq classifier that consumes the //! methylation extractor's `--yacht` output and emits a per-read CG/GC //! methylation tally; byte-identical to Perl v0.25.1. //! //! ⚠️ This is the standalone tool...
5953242545d3e7d5c5a9b3cc942c836e5908679f91faacd906d716134f78a88b
Rust
5,265
166
//! Real-data byte-identity gate for `filter_non_conversion_rs`. //! //! `#[ignore]`d + env-gated: runs the REAL Perl `filter_non_conversion` //! v0.25.1 AND the Rust binary on a real Bismark BAM, then asserts the //! decompressed kept/removed bodies (`samtools view`) and the report //! (timing-line-normalized) are byt...
62f63e1123403eccb056c032412c32f69b27d3d6fdffe8aabefb2ea7787b7e5e
Rust
5,282
131
//! `bismark-bam2nuc` — Rust port of Bismark Perl's `bam2nuc`. //! //! Computes the **mono- and di-nucleotide coverage** of a Bismark alignment as //! a QC metric: for every read with a clean (no `I/D/S/N`) CIGAR it tallies the //! **genomic** sequence at the read's mapped span (NOT the read's own bases), //! reverse-c...
936fc236c1b94808f7936514d5e491d56448658b59614b7493e5c90a5faeef93
Rust
5,299
151
//! CLI-behavior tests for the flags that don't shape the *content* of the //! data streams (and so aren't covered by the byte-identity cells): //! `--dir` (output placement + directory creation), the accepted-but-ignored //! no-op flags (`--remove_spaces`, `--counts`, `--buffer_size`, //! `--ample_memory`, `--gazillio...
98575dfb5aebd55d9cdf8460bfbbec821490730cf5cce01bb18a395e469e9926
Rust
5,302
136
//! The four embedded Plotly assets + the faithful `read_report_template` //! line-normalizer (SPEC §2.6 / §8.2). //! //! Embedding strategy: `include_str!` from the crate-local `assets/` directory //! (VENDORED copies of the repo `plotly/` files) so the crate is SELF-CONTAINED //! and publishable to crates.io — a `.cr...
b1c08fffed9d7a2aec74f792fcb7e93f1c391d8b30d188aad3d9ae9118e77a01
Rust
5,310
161
use crate::camera::Camera; use crate::safetensor_utils::safetensor_to_burn; use crate::{render::num_sh_coeffs, Backend}; use burn::tensor::Distribution; use burn::tensor::Tensor; use burn::{ module::{Module, Param, ParamId}, tensor::Device, }; use safetensors::SafeTensors; #[derive(Module, Debug)] pub struct S...
6d2b50dde29b4c4bbe58c4bc5bf6950a66ad41bc43cd1aaaac828a99ffee0bb7
Rust
5,473
164
use std::io::Cursor; use std::io::Read; use std::path::Path; use anyhow::Context; use anyhow::Result; use brush_render::camera; use brush_render::camera::Camera; use brush_train::scene::SceneView; use crate::clamp_img_to_max_size; use crate::normalized_path_string; // TODO: This could be simplified with some serde-...
b24dddc482d16a717e828cb730ec97c9ae4b9878bf6c9a375826a6414153228b
Rust
5,583
137
//! Phase 3 — multicall dispatch tests (DECISIONS D2/D3/D4/D7). //! //! The classic-name byte-identity tests live in each tool's own `*_…` test files //! (invoked via the classic `[[bin]]` → `argv[0]` alias → unchanged `run_main`). //! These cover the NEW `bismark <subcommand>` / bare-`bismark` dispatch surface. //! Th...
c0f37422a6b62df4e5dd72fd98156a6099fc9b3555f1925d9806f2206ee3cf68
Rust
5,585
142
//! `bismark-report` — Rust port of the Perl `bismark2report`. //! //! Reads a Bismark **alignment** report (mandatory) plus up to four optional //! companion reports — **deduplication**, methylation-extractor **splitting**, //! **M-bias**, and **nucleotide coverage** — and fills a single self-contained //! HTML templa...
624815bcae1f93f61806316e0f77596e691ddeea24bb6bc63afeeb8692ab2ace
Rust
5,691
178
//! Framed codec for worker communication. //! //! Uses LengthDelimitedCodec for framing + serde_json for serialization. //! Works over any AsyncRead/AsyncWrite (pipes, sockets, etc). use std::io; use std::marker::PhantomData; use serde::{Serialize, de::DeserializeOwned}; use tokio_util::bytes::{Bytes, BytesMut}; use...