sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
8150274ba2a704d4998d7d1353ae062af41b371e3b8d7fe353473dce4eeecfe2
Rust
1,303
41
use crate::common::run_modkit; mod common; #[test] fn test_entropy_help() { run_modkit(&["entropy", "--help"]).expect("entropy help"); } #[test] fn test_entropy_regression() { let td = std::env::temp_dir().join("test_entropy_regression"); std::fs::create_dir_all(&td).expect("should make temp dir"); r...
e3c6481d656fd11c6763a192bdd27e6ce0ab7ba02cac4c9c8a4bdf4e92daf8b0
Rust
1,344
62
extern crate core; pub mod adjust; pub mod bedmethyl_util; // pub mod commands; pub mod command_utils; pub mod dmr; pub mod entropy; pub mod errs; pub mod extract; pub mod interval_chunks; pub mod localise; // pub mod logging; pub mod mod_bam; pub mod mod_base_code; pub mod modbam_util; pub mod monoid; pub mod motifs;...
5eb5f4aa9402ca3187ad48fbafe70a14d3feba70b722813b1551a768fc18e359
Rust
1,507
62
use crate::common::{check_against_expected_text_file, run_modkit}; mod common; #[test] fn test_pileup_hemi_help() { let pileup_help_args = ["pileup-hemi", "--help"]; let _out = run_modkit(&pileup_help_args).unwrap(); } #[test] fn test_pileup_hemi_hm() { let temp_file = std::env::temp_dir().join("test_pil...
de9e1194f07ba5a1294d0186a1774201c675e1ed0a0dbdde37f88615b1511602
Rust
1,556
53
use nom::bytes::complete::tag; use nom::character::complete::{ alphanumeric1, anychar, multispace1, none_of, u64 as nomu64, }; use nom::multi::{fold_many1, separated_list0}; use nom::number::complete::float; use nom::IResult; pub(crate) fn consume_digit(l: &str) -> IResult<&str, u64> { multispace1(l).and_then(...
9617ed0302db891dcfbb81c344bf2d1ae412110d89d5683271eab0069114f6fc
Rust
1,594
54
use crate::common::run_modkit; use anyhow::Context; use std::fs::File; use std::io::{BufRead, BufReader}; mod common; #[test] fn test_validate_help() { run_modkit(&["validate", "--help"]) .context("validate --help failed") .unwrap(); } #[test] fn test_validate_expected() { let output_file = s...
494333f82076af740a410b529f0d18ef91d23732f34db5c10b68a90fa404cc31
Rust
1,618
60
use derive_new::new; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt::Debug; use std::fs::File; use std::path::Path; use mod_kit::mod_base_code::{DnaBase, ModCodeRepr}; pub(crate) mod filenames { pub const WEIGHTS_FN: &'static str = "model.mpk"; pub const CONFIG_FN: &'static s...
5f0aacd7310af25e42a0ea4f2adda831bfc36fb978355b7479a9f141accf7bd2
Rust
2,161
80
use rayon::prelude::*; use rustc_hash::FxHashMap; use crate::mod_base_code::ModCodeRepr; use crate::monoid::Moniod; use crate::motifs::{EnrichedMotif, KmerRef, RawBase}; #[inline] pub(super) fn aggregate_base_counts_on_position( kmer_counts: &[(KmerRef, u32)], ) -> FxHashMap<RawBase, FxHashMap<usize, u32>> { ...
2284f192dcb2c6ca65fb3e41b3e93a5e2b801e7d792514050e4c42d23abd56fd
Rust
2,245
80
use crate::common::{ check_against_expected_text_file, check_legal_csv, run_modkit, }; mod common; #[test] fn test_dmr_helps() { let _ = run_modkit(&["dmr", "pair", "--help"]) .expect("failed to run modkit dmr pair help"); let _ = run_modkit(&["dmr", "multi", "--help"]) .expect("failed to ...
7c967ac2a77b0a5eb18c5d93b7303d4f1938095398edfd362c2820882fb1e792
Rust
2,342
79
use crate::common::{check_against_expected_text_file, run_modkit}; use mod_kit::util::GenomeRegion; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::{Path, PathBuf}; mod common; #[test] fn test_open_chromatin_help() { run_modkit(&["open-chromatin", "--help"]).expect("should run help"); run...
49cc802ac8cd7a26a7345ee1e0e483e0f7a442ab234eb9d93f488107a7f8b2ae
Rust
2,526
89
use std::collections::HashMap; use mod_kit::mod_bam::MN_TAG; use rust_htslib::bam; use rust_htslib::bam::Read; use crate::common::{run_modkit, run_simple_summary}; mod common; #[test] fn test_repair_help() { run_modkit(&["repair", "--help"]).unwrap(); } #[test] fn test_repair_regression() { let out_bam = s...
b8923ddfea3db3ed28fc5158405a51a95fd70653798dcd470c3ca178ad3c8bd9
Rust
2,537
93
use std::fs::File; use std::io::{self, BufRead, BufReader, Read}; use std::path::Path; #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum InputKind { Plain, Bgzip, GzipButNotBgzip, } /// Detect whether a file is BGZF/bgzip-compressed. /// /// BGZF is gzip with: /// - gzip magic bytes: 1f 8b /// - compressi...
55630ac4e62fd98543f4e885e7ba3353af8b94e5ee49323604bc1f798ffab749
Rust
2,918
107
use crate::util::{get_master_progress_bar, get_ticker}; use indicatif::ProgressBar; use rand::rngs::StdRng; use rand::{Rng, SeedableRng}; /// A utility data structure that when used in an interator allows /// to randomly sample either a preset number of reads or a fraction /// of reads. If sampling a preset number o...
e3092d48db275bf894005e6b7967a00160cb841156e19709ab311dc44ad5c1ec
Rust
3,135
101
use derive_new::new; use prettytable::{cell, row}; use rayon::prelude::*; use rustc_hash::{FxHashMap, FxHashSet}; use crate::dmr::bedmethyl::BedMethylLine; use crate::mod_base_code::ModCodeRepr; use crate::monoid::Moniod; use crate::tabix::HtsTabixHandler; use crate::util::{GenomeRegion, ModPositionInfo, StrandRule}; ...
f5d6526e7e9fc7228b159261fe032dabe4c6e0fc58e24d782ea86d1763132cf9
Rust
3,349
115
use std::string::FromUtf8Error; pub type MkResult<T, E = MkError> = Result<T, E>; #[derive(thiserror::Error, Debug)] pub enum MkError { // Tag parsing #[error("invalid-aux-tags")] InvalidTags, #[error("invalid-MM-tag")] InvalidMm(String), #[error("invalid-ML-tag")] InvalidMl(String), #...
a8fc40f7eda5e772336a0d740262348e30fca4c1f6988592945f7b80bfb0be58
Rust
3,656
122
use rust_htslib::bam::{self, HeaderView}; use rust_htslib::htslib::bam1_t; use std::rc::Rc; pub struct SafeRecord { inner: bam1_t, } unsafe impl Send for SafeRecord {} unsafe impl Sync for SafeRecord {} impl SafeRecord { pub fn ingest(read: &mut bam::Record) -> Self { let dummy = bam::Record::new(); ...
2954eb0094418d1752c61796bce6d360ef11b5bff01ee96e5e39bbdc7ec4c749
Rust
3,755
111
use std::fs::File; use std::path::PathBuf; use anyhow::Context; use log::{debug, LevelFilter}; use log4rs::append::console::{ConsoleAppender, Target}; use log4rs::append::file::FileAppender; use log4rs::config::{Appender, Root}; use log4rs::encode::pattern::PatternEncoder; use log4rs::filter::threshold::ThresholdFilte...
874016e3b96ed5199e7f2eb95006c11c103acbfddb3d77d65ff265233d450782
Rust
4,333
132
pub(crate) mod conv_lstm { use burn::config::Config; use burn::module::Module; use burn::nn::conv::{Conv2d, Conv2dConfig}; use burn::nn::{ BatchNorm, BatchNormConfig, Linear, LinearConfig, Lstm, LstmConfig, Relu, }; use burn::prelude::Backend; use burn::tensor::Tensor; #...
8791c0f0ad1044515b5a746ba6fb5721c8caf12e4d86dc878219b12ac0ee230f
Rust
4,565
132
use std::collections::HashSet; use std::fmt::Debug; use std::hash::Hash; use std::ops::Range; use std::path::PathBuf; use indicatif::{MultiProgress, ProgressIterator}; use log::debug; use rustc_hash::{FxHashMap, FxHashSet}; use crate::fasta::HtsLibFastaRecords; use crate::mod_base_code::DnaBase; use crate::util::{get...
a22396ec743b03746eaacab9f1b987ad8159105d71aa57b2c83db9ba1ac1c820
Rust
4,962
181
use statrs::distribution::{ChiSquared, ContinuousCDF}; use statrs::function::gamma::ln_gamma; // #[derive(Debug, Clone)] // pub(super) struct IsoformMethylationCounts { // /// Counts for categories such as: // /// [methylated_a, methylated_b, unmethylated] // pub counts: Vec<u64>, // } #[derive(Debug, Clo...
aed17fc10a782cdb89701991c1dcd8e330bd265fc2823ffe664b5e26b376b46a
Rust
5,445
132
use std::path::PathBuf; use anyhow::{anyhow, bail, Context}; use log::{debug, error}; use rayon::prelude::*; use rust_htslib::bam; use mod_kit::mod_base_code::{DnaBase, ModCodeRepr}; use mod_kit::threshold_mod_caller::MultipleThresholdModCaller; use mod_kit::util::Region; use crate::features; use crate::features::Co...
df7910af836c4bfe5d30be56207a9832885313f31466a27700f656cf766714a1
Rust
5,477
171
use crate::common::{ run_modkit, run_simple_summary, run_simple_summary_with_collapse_method, run_simple_summary_with_edge_filter, run_summary_with_include_positions, }; use anyhow::Context; use mod_kit::mod_bam::{CollapseMethod, EdgeFilter}; use mod_kit::mod_base_code::{BaseState, DnaBase}; use std::collection...
74fcc8fe5ce4a3863b71a26948551af9ea310a9c706f7023adf1cb774c77d9c3
Rust
6,149
204
use bitvec::order::Lsb0; use bitvec::vec::BitVec; use derive_new::new; use log::debug; use rust_htslib::bam; use crate::dmr::bedmethyl::BedMethylLine; use crate::mod_bam::CollapseMethod; use crate::mod_base_code::{DnaBase, ModCodeRepr}; use crate::util::StrandRule; pub(crate) mod base_mods_adapter; pub(crate) mod bed...
8129a91bc4ac7502c62591f25d01a6fec160b14530ef2155484fb624aa9df3f2
Rust
6,225
198
use std::{ fs::File, io::{BufRead, BufReader, BufWriter, Read, Write}, }; use common::run_modkit; use mod_kit::dmr::bedmethyl::BedMethylLine; mod common; #[test] fn test_merge_bedmethyl_help() { run_modkit(&["bedmethyl", "--help"]).unwrap(); run_modkit(&["bedmethyl", "merge", "--help"]).unwrap(); ...
44c64b69d3441628ca858824f5b350b3e4a5cb486103ca6cfa8c10b228fb6988
Rust
6,326
210
use std::marker::PhantomData; use std::ops::Range; use std::path::PathBuf; use anyhow::Context; use itertools::Itertools; use log_once::debug_once; use rust_htslib::tbx::{Read, Reader as TbxReader}; use rustc_hash::FxHashMap; use crate::dmr::bedmethyl::BedMethylLine; use crate::errs::{MkError, MkResult}; use crate::m...
9627d40b7daddc42588008d6aa37e2ff9b100fab85e1b8978ecdfecc1315da36
Rust
6,425
148
use anyhow::Result as AnyhowResult; use clap::Subcommand; use mod_kit::bedmethyl_util::subcommands::EntryBedMethyl; use mod_kit::dmr::subcommands::BedMethylDmr; use mod_kit::entropy::subcommand::MethylationEntropy; use mod_kit::extract::subcommand::ExtractMods; use mod_kit::localise::subcommand::EntryLocalize; use mod_...
c3870f35ccb9272f17fbe67dd4c84cb351c88e1fde6445e07b89a1af58b3db4e
Rust
6,529
192
use crate::features::CountsFeatures; use derive_new::new; use log::debug; use mod_kit::util::TAB; use ndarray::{s, Array1}; use rustc_hash::FxHashMap; use std::collections::{BTreeMap, VecDeque}; use std::fmt::{Display, Formatter}; use std::ops::Div; #[derive(new, Debug)] pub(crate) struct OpenChromRecord { pub(cra...
ed58961d7434be2e18624e7f40196e946a01b2e1c962381b7ea3c94f95e42eee
Rust
6,981
245
use anyhow::{anyhow, bail, Result as AnyhowResult}; use derive_new::new; use mod_kit::mod_bam::{CollapseMethod, EdgeFilter}; use mod_kit::position_filter::StrandedPositionFilter; use mod_kit::summarize::{summarize_modbam, ModSummary}; use mod_kit::threshold_mod_caller::MultipleThresholdModCaller; use serde::Deserialize...
a3031da9134a88d448feb88214097ad863196809c96eef29e346582e3f5e5e99
Rust
7,026
246
use anyhow::{anyhow, bail, Result as AnyhowResult}; use derive_new::new; use mod_kit::mod_bam::{CollapseMethod, EdgeFilter}; use mod_kit::position_filter::StrandedPositionFilter; use mod_kit::summarize::{summarize_modbam, ModSummary}; use mod_kit::threshold_mod_caller::MultipleThresholdModCaller; use serde::Deserialize...
efe0fbafbad412b3a73182885f18c9556e545c4222ceec7843d392e9b0735d37
Rust
7,057
221
use std::io::BufRead; use bigtools::{ bed::bedparser::{BedValueError, StreamingBedValues}, Value, }; use indicatif::ProgressBar; use log::debug; use rustc_hash::FxHashSet; use crate::{ dmr::bedmethyl::BedMethylLine, errs::{MkError, MkResult}, mod_base_code::ModCodeRepr, util::StrandRule, }; p...
62cc7c2129fbcc27b38907291438917a2239c6e8a88cd37ea0d7617ced47b963
Rust
7,104
265
use std::collections::HashMap; use derive_new::new; use std::fmt::Write; use crate::dmr::{ bedmethyl::BedMethylLine, isoform::{Exon, GeneModel, GtfTranscript}, }; #[derive(new)] pub(super) struct GenomeSortedTranscriptModel { pub strand: char, // '+' or '-' pub exons: Vec<Exon>, // ordered in tra...
146593acc6c5784c93d153f11ec2e9d082e7a42879b8b825b964a6a9d3c3df8f
Rust
7,563
172
use clap::{arg, Args}; use std::path::PathBuf; #[derive(Args, Clone, Debug)] pub(super) struct InputArgs { /// Input bedmethyl table, can be used directly from modkit pileup. #[clap(help_heading = "Input Options")] #[arg(short = 'i', long)] pub in_bedmethyl: PathBuf, /// Number of threads to use. ...
cdc8cf39c6b7192011314f620f1eb646d73785366136089736d2fbd8ab470ba3
Rust
7,728
260
use std::collections::HashMap; use std::path::PathBuf; use crate::errs::{MkError, MkResult}; use crate::mod_bam::{CollapseMethod, EdgeFilter}; use crate::mod_base_code::{DnaBase, ModCodeRepr}; use crate::position_filter::StrandedPositionFilter; use crate::read_ids_to_base_mod_probs::ReadIdsToBaseModProbs; use crate::r...
142a10d7a4d6a947319ae3b90602d950ddb81c28afa4b03b2647bf3a152f78d1
Rust
7,741
235
use anyhow::{anyhow, bail}; use charming::component::{ Axis, DataZoom, DataZoomType, Feature, Legend, Restore, SaveAsImage, Title, Toolbox, ToolboxDataZoom, }; use charming::datatype::{CompositeValue, DataPoint, NumericValue}; use charming::element::{AxisType, LineStyle, Orient, Symbol}; use charming::series::L...
c9282e37285522b273b566c2cc2e008422c60061eacffa04a09be8ab31ac14dc
Rust
7,942
243
use mod_kit::util::{GenomeRegion, Region}; use rust_htslib::bam::{self, Read}; use std::collections::{HashMap, VecDeque}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::ops::Range; use std::path::PathBuf; use crate::util::InferenceMessage; use anyhow::{anyhow, bail, Context}; use itertools::Itertools; ...
53e61bcb61adf548d3c98365df41d7358698356d3e538a0cd0e66a763d536254
Rust
7,973
218
use std::fs::File; use std::io::{stdout, BufRead, BufReader, BufWriter, Write}; use std::path::PathBuf; use anyhow::{anyhow, bail}; use clap::Args; use indicatif::{ParallelProgressIterator, ProgressIterator}; use itertools::Itertools; use log::{debug, error, info}; use log_once::info_once; use rayon::prelude::*; use r...
96bacfd26dae5dcae40f0b64ba13769fc0c28275ba379d72b29805cc92d95ba4
Rust
8,176
374
use rustc_hash::{FxHashMap, FxHashSet}; use std::collections::{BTreeMap, HashMap, HashSet}; use std::hash::Hash; pub trait Moniod { fn zero() -> Self; fn op(self, other: Self) -> Self; fn op_mut(&mut self, other: Self); fn len(&self) -> usize; } pub trait BorrowingMoniod { fn zero() -> Self; f...
910e25cc2f19c2444a99fe0c55a2520b77976ad94ab9baefe1f3aacc8b68e603
Rust
8,592
181
use clap::Args; use std::path::PathBuf; #[derive(Args)] pub(super) struct InputArgs { /// Path to modBAM file to extract read-level information from, or one of /// `-` or `stdin` to specify a stream from standard input. If a file /// is used it may be sorted and have associated index. pub in_bam: Strin...
75b6557db990b1ef21a695d1b199da994ea11d39ab5856b279225bf97a050e18
Rust
9,655
240
use anyhow::anyhow; use clap::Args; use itertools::Itertools; use linear_map::LinearMap; use log::warn; use rust_htslib::bam; use rustc_hash::FxHashMap; use crate::mod_base_code::{ DnaBase, ModCodeRepr, ModifiedBasesOptions, RNA_CODES_TO_MODOMICS_NAMES, }; use crate::writers::bedrmod_bedmethyl_header; #[derive(Ar...
044d3982ef12bc03a3b4e4dca1a71d8d4589085cca774867db0f1494b47a085f
Rust
10,527
332
use crate::dmr::llr_model::AggregatedCounts; use anyhow::{anyhow, bail}; use log::info; use rv::dist::Beta; use rv::misc::gauss_legendre_quadrature; use statrs::function::beta::ln_beta; use std::fmt::{Display, Formatter}; const LOWER: f64 = 1e-5; const UPPER: f64 = 1f64 - LOWER; fn appell_f1_stable(x: f64, y: f64, a:...
77637c05d34662bda2bdfeedf7cb43b9c88f370acf1eff7068d470471ab2903e
Rust
10,994
344
use std::cmp::Ordering; use std::collections::HashMap; use std::path::Path; use anyhow::bail; use derive_new::new; use rust_htslib::bam::{self, FetchDefinition, Read}; use rustc_hash::FxHashMap; use crate::interval_chunks::{FocusPositions2, MultiChromCoordinates}; use crate::mod_bam::{DuplexModCall, DuplexPattern, Ed...
5507920006590a352567b064a08726c9b437cc4f3b0bd335214f807027f4b536
Rust
11,071
326
use crate::common::run_modkit; use anyhow::{anyhow, Context}; use mod_kit::dmr::bedmethyl::BedMethylLine; use mod_kit::errs::MkError; use mod_kit::mod_bam::{ BaseModCall, ModBaseInfo, RawModTags, SeqPosBaseModProbs, }; use mod_kit::mod_base_code::{ DnaBase, ModCodeRepr, ParseChar, METHYL_CYTOSINE, SIX_METHYL_AD...
837e7cd0ae9044b20a4aaf70bd41287dc2a48e70449d20ada1445b15a1428133
Rust
11,512
310
use std::collections::HashMap; use std::fs::File; use std::io::{stdout, BufRead, BufReader, BufWriter, Write}; use std::path::PathBuf; use std::sync::Arc; use anyhow::{anyhow, bail}; use clap::Args; use indicatif::{MultiProgress, ParallelProgressIterator, ProgressIterator}; use itertools::Itertools; use log::{debug, i...
2a43d6dc4c0305d9be691e440a12b97bb78774ae9e589ef20be3abda7e56d7b6
Rust
11,527
358
use derive_new::new; use itertools::Itertools; use log::debug; use regex::Regex; use rustc_hash::{FxHashMap, FxHashSet}; use std::collections::{BTreeSet, HashMap}; use std::str::Chars; use substring::Substring; #[derive(new)] struct AlphabetInfo { columns: FxHashMap<usize, String>, } impl AlphabetInfo { fn fr...
3b899aa0d44febf06c0f58620434b82e17ab8490183cd8fcc46115e7b991816b
Rust
11,870
310
use std::sync::Arc; use crate::dmr::bedmethyl::{aggregate_counts, BedMethylLine}; use crate::dmr::llr_model::{AggregatedCounts, ModificationCounts}; use crate::dmr::tabix::{ChromToSampleBMLines, MultiSampleIndex}; use crate::dmr::util::{DmrBatch, RegionOfInterest, RoiIter}; use crate::errs::{MkError, MkResult}; use cr...
102700b5030bd0602a7994eb858ca947b6c5fb48298bd0f2447f397bec1607a5
Rust
12,099
349
use crate::entropy::{EntropyCalculation, WindowEntropy}; use crate::errs::MkError; use crate::util::{Strand, TAB}; use anyhow::{anyhow, bail}; use indicatif::ProgressBar; use log::debug; use rustc_hash::FxHashMap; use std::collections::HashMap; use std::fs::File; use std::io::{stdout, BufWriter, Write}; use std::ops::A...
34f10b7c38794721ec5fcb7e4b02ad63d631c58a2d5a15ae7d340c8c42b8d392
Rust
12,215
358
use std::{collections::HashSet, path::Path}; use anyhow::bail; use bitvec::bitvec; use indexmap::IndexMap; use indicatif::MultiProgress; use itertools::Itertools; use log::debug; use rustc_hash::FxHashMap; use crate::{ dmr::{ bedmethyl::BedMethylLine, isoform::{ dirichlet_multinomial_l...
f8b17f9da2ab45dbbc6a3268cd0712afc61747686146c9962a18c0e5e538b12e
Rust
12,449
368
use std::path::PathBuf; use anyhow::{bail, Context}; use bitvec::bitvec; use bitvec::vec::BitVec; use itertools::Itertools; use log::debug; use rayon::prelude::*; use rust_htslib::faidx; use rustc_hash::FxHashMap; use substring::Substring; use crate::errs::{MkError, MkResult}; use crate::interval_chunks::FocusPositio...
ec3b9a97eb348603c19290c937db91bae959c56058b5a87810cf54ede0be4081
Rust
12,557
424
use std::fmt::{Display, Formatter}; use std::ops::Range; use anyhow::bail; use log_once::debug_once; const STATE_NUM: usize = 2usize; #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] #[repr(usize)] pub(crate) enum States { Same = 0, Different = 1, } impl Into<usize> for States { fn in...
4137f15375a1644590fd68c58754414bf2c6d7721c659ca78c0e1a1d8e5cc4f2
Rust
12,681
391
use std::path::PathBuf; use anyhow::anyhow; use indicatif::{MultiProgress, ProgressBar}; use itertools::Itertools; use log::debug; use prettytable::row; use rayon::prelude::*; use rust_htslib::bam::{self, Read}; use rustc_hash::FxHashMap; use crate::interval_chunks::{ ChromCoordinates, ReferenceIntervalBatchesFee...
e643d1c3e5de138029b50e0228908294fcaacc19b799f3ccda9acf736e93f6c7
Rust
12,804
374
use std::collections::{HashMap, HashSet, VecDeque}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::PathBuf; use anyhow::bail; use itertools::Itertools; use log::{debug, info}; use log_once::info_once; use rust_htslib::bam::{self, Read}; use rust_lapper as lapper; use rustc_hash::FxHashMap; use c...
842b2967e0c12e46037e8c26b19eec4afcf33784c8b07d25d4fef38b675c481e
Rust
13,674
437
use std::collections::{HashMap, HashSet}; use std::fmt::{Display, Formatter}; use anyhow::{anyhow, bail}; use itertools::Itertools; use log::debug; use rv::prelude::*; use crate::dmr::util::{cohen_h, CohenHResult, DmrInterval}; use crate::errs::{MkError, MkResult}; use crate::mod_base_code::ModCodeRepr; use crate::mo...
70e9cdc042f795dccb42ab4ccdeda610e07d96d522347dfcd5cf04e582073eb5
Rust
13,697
374
use std::collections::{BTreeMap, HashSet}; use std::fmt::Debug; use std::ops::Range; use anyhow::bail; use rayon::prelude::*; use rustc_hash::{FxHashMap, FxHashSet}; use crate::dmr::bedmethyl::{aggregate_counts2, BedMethylLine}; use crate::dmr::llr_model::AggregatedCounts; use crate::dmr::util::{n_choose_2, DmrBatch,...
92687825cae109b4ecf63d911133aec237502da24d4c7f0c6d511d5042983f6e
Rust
13,732
394
use std::path::PathBuf; use std::sync::Arc; use anyhow::{anyhow, bail, Context}; use clap::Args; use derive_new::new; use indicatif::{MultiProgress, ProgressBar}; use log::{debug, error, info, warn}; use rayon::prelude::*; use rust_htslib::bam::record::{Aux, AuxArray}; use rust_htslib::bam::{self, Read}; use rustc_has...
38eaccb0dbca1d7587b2a9c654dde8d4ee24a0c952aa67a75f8bdbe7ff1a0eb9
Rust
14,085
459
use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap}; use std::fmt::{Display, Formatter}; use std::str::FromStr; use crate::errs::{MkError, MkResult}; use crate::motifs::iupac::nt_bytes; use anyhow::{anyhow, bail}; use clap::ValueEnum; use common_macros::hash_map; use derive_new::new; use lazy_static::laz...
a048324c08f9a9ff4cefca527aa41c3fa3f8f65fb988b5193caf2522af512935
Rust
14,299
438
use anyhow::bail; use derive_new::new; use log::{debug, error, info}; use rayon::prelude::*; use rust_htslib::bam::record::{Aux, AuxArray}; use rust_htslib::bam::{self, Read}; use rustc_hash::{FxHashMap, FxHashSet}; use std::ops::AddAssign; use crate::errs::{MkError, MkResult}; use crate::mod_bam::{ format_mm_ml_t...
3ef38fefb5b364a95f4fcc6b79e43aeb40251ca072d07f95fc05658cbb12ec3b
Rust
14,638
483
use crate::common::{parse_mod_profile, run_simple_summary}; use anyhow::Context; use common::{check_legal_csv, run_modkit}; use mod_kit::mod_bam::RawModTags; use mod_kit::mod_base_code::{BaseState, DnaBase}; use rust_htslib::{bam, bam::Read}; use std::path::PathBuf; mod common; #[test] fn test_help() { let pileup...
95939f8d2a2dd62a4bcb20afd55914f4d3f8a594ac8aa462da97794505dd115c
Rust
14,828
452
use std::collections::HashMap; use std::fs::File; use std::io::{BufWriter, Cursor, Write}; use std::path::Path; use indicatif::MultiProgress; use crate::extract::util::ReadModsStatsRecord; use crate::mod_bam::BaseModCall; use crate::motifs::motif_bed::MotifPositionLookup; use crate::read_ids_to_base_mod_probs::{ ...
bbf7d1576f769040c2cdfc78709f0251600d1afff75649122245d532a451d32d
Rust
14,958
456
use std::collections::HashMap; use std::path::PathBuf; use anyhow::{anyhow, bail, Context}; use itertools::Itertools; use log::{debug, info, warn}; use rust_htslib::bam::{self, Header}; use crate::adjust::OverlappingRegexOffset; use crate::fasta::MotifLocationsLookup; use crate::mod_bam::{prob_to_qual, CollapseMethod...
6868192348b8417800c9083720d39c1be966747048ec99a585b11359d8ae5628
Rust
15,483
466
use crate::errs::MkError; use crate::mod_bam::{ CollapseMethod, EdgeFilter, MmTagInfo, ModBaseInfo, RawModTags, SkipMode, ML_TAGS, MM_TAGS, }; use crate::mod_base_code::{DnaBase, ModCodeRepr}; use crate::monoid::Moniod; use crate::position_filter::StrandedPositionFilter; use crate::reads_sampler::record_sampler...
923445b42d518bc7f9529d6ccc2fce25856405f1b859e2713755a67c404a5ec3
Rust
15,997
453
use std::collections::{HashMap, HashSet}; use std::fmt::Display; use anyhow::Context; use derive_new::new; use itertools::{Itertools, MinMaxResult}; use log_once::debug_once; use nom::character::complete::{multispace1, none_of}; use nom::combinator::map_res; use nom::multi::many1; use nom::IResult; use rustc_hash::{Fx...
1ec81c1712381683388ed9fe04ad4ef7973ecf2a4d112f17b6c4b1c3e6840d6e
Rust
16,797
429
use std::cmp::Ordering; use std::io::{BufWriter, Write}; use std::path::PathBuf; use anyhow::{bail, Context}; use burn::data::dataloader::batcher::Batcher; use burn::module::Module; use burn::prelude::Backend; use burn::record::{CompactRecorder, Recorder}; use burn::tensor::activation::softmax; use clap::{Args, Subcom...
1e25a3660aef58adaa372163117471978ae02253da91b48df136bec9b2ce2a3b
Rust
17,624
614
use crate::common::{ check_against_expected_text_file, parse_mod_profile, ModData, }; use anyhow::{anyhow, Context}; use common::{check_legal_csv, run_modkit, ExtractFullRecord}; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::BufRead; use std::io::BufReader; use std::path::{Path, PathBuf}...
1365cb7348ded81abc658e11d6270a95eb8f537f7ece1c0f28389765830d4163
Rust
18,873
488
use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use common_macros::hash_map; use derive_new::new; use indicatif::{MultiProgress, ParallelProgressIterator}; use log::{debug, error, info}; use rayon::prelude::*; use crate::mod_bam::{prob_to_qual, BaseModCall, CollapseMethod, EdgeFilter}; use crate::m...
9bed36b3a72c42fb519d17521b3833d3da8f66cd5622da67c630e82d1eeb90b7
Rust
19,248
482
use crate::mod_bam::{BaseModCall, BaseModProbs, SeqPosBaseModProbs, SkipMode}; use crate::mod_base_code::{DnaBase, ModCodeRepr}; use derive_new::new; use rustc_hash::FxHashMap; use std::collections::HashMap; #[derive(new, Clone)] pub struct MultipleThresholdModCaller { per_base_thresholds: HashMap<DnaBase, f32>, ...
e76e517a78a42da2ffbb5387cf3518196e1e09711c54a264b257d59f00aee9f8
Rust
20,123
646
use std::cmp::Ordering; use std::collections::VecDeque; use std::fmt::{Debug, Display, Formatter}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; use std::sync::Arc; use crate::dmr::llr_model::AggregatedCounts; use crate::dmr::tabix::MultiSampleIndex; use crate::genome_positions::{GenomePos...
8bddee4bd2fbaf34060afef43b055281d511c06443ace1016c04605672803a9a
Rust
20,190
539
use std::collections::HashSet; use log::{debug, error}; use log_once::info_once; use rust_htslib::bam; use rustc_hash::{FxHashMap, FxHashSet}; use crate::errs::{MkError, MkResult}; use crate::mod_bam::{ BaseModCall, CollapseMethod, DuplexModCall, EdgeFilter, ModBaseInfo, SeqPosBaseModProbs, SkipMode, }; use c...
a9ff613293034fac34971a9294ad1f0e80ccc95cf7d98f15680d6729c9cd27e4
Rust
20,975
518
use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; use anyhow::{bail, Context}; use clap::Args; use indicatif::MultiProgress; use log::{debug, error, info}; use rayon::prelude::*; use rustc_hash::FxHashMap; use modkit_logging::init_logging; use crate::command_utils::parse_per_mod_thresholds; ...
48a41ddc8722f807d25391b596a90b0cd4e7f3591b4d177b0dacf9935e8dcf22
Rust
22,120
681
use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::ops::ControlFlow; use anyhow::{anyhow, bail, Context}; use derive_new::new; use itertools::Itertools; use ndarray::{Array2, Axis}; use rayon::prelude::*; use rust_htslib::bam::pileup::Indel; use rust_htslib::bam::{self, FetchDefinition, Read}; use rustc_has...
836ca61678ee3f3b582251d13477decd5e6c131000a9a8c79f7ecb5fe15f59dc
Rust
23,413
700
use std::collections::{BTreeMap, BTreeSet, VecDeque}; use anyhow::{anyhow, bail}; use bitvec::bitvec; use bitvec::order::Lsb0; use bitvec::vec::BitVec; use derive_new::new; use itertools::Itertools; use log::debug; use rustc_hash::FxHashMap; use crate::errs::MkResult; use crate::fasta::MotifLocationsLookup; use crate...
b1d380c4177d2e8e947ff0272af563ef803b050f754ee7db5ff18f9aa8cdf8d1
Rust
24,445
808
use std::collections::{BTreeMap, HashMap}; use std::fmt::{Display, Formatter}; use std::path::PathBuf; use anyhow::{anyhow, bail, Context, Result as AnyhowResult}; use derive_new::new; use indicatif::{MultiProgress, ProgressIterator}; use itertools::Itertools; use log::{debug, info}; use rayon::prelude::*; use regex::...
b71feaaa537284e6b582b8384f5ecc30c67827f6679b8d2d8d63fbbc4d0aae25
Rust
28,956
794
use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::{stdout, BufRead, BufReader, BufWriter, Write}; use std::path::{Path, PathBuf}; use anyhow::{anyhow, bail, Context}; use bigtools::{ beddata::BedParserStreamingIterator, BigWigWrite, InputSortType, }; use clap::{Args,...
2722985e5f3c78dacba438c2dd883249f46c078c7581d78848f1ce7511c8a726
Rust
30,204
892
use anyhow::bail; use std::fmt::{Display, Formatter}; pub(crate) mod nt_bytes { pub const A: u8 = 65; pub const C: u8 = 67; pub const G: u8 = 71; pub const T: u8 = 84; pub const BASES: [u8; 4] = [A, C, G, T]; } pub(super) mod iupac_offsets { const A: usize = 0; const C: usize = 1; cons...
fe3673442ba0d90e6976b360d5df68ef0822800bc80734687f462b089e4531e3
Rust
31,237
1,018
use anyhow::Context; use itertools::Itertools; use rust_htslib::bam; use std::cmp::Ordering; use std::collections::HashMap; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::PathBuf; use common::{check_against_expected_text_file, run_modkit}; use mod_kit::dmr::bedmethyl::BedMethylLine; use mod_kit::...
73958a357e204ffaa7245ca3685f20238e6d4f4be5fcbaa30a711e68b7056583
Rust
32,299
868
use crate::errs::{MkError, MkResult}; use crate::extract::args::InputArgs; use crate::interval_chunks::{ ReferenceIntervalBatchesFeeder, TotalLength, WithPrevEnd, }; use crate::mod_bam::{CollapseMethod, EdgeFilter, TrackingModRecordIter}; use crate::mod_base_code::ModCodeRepr; use crate::monoid::Moniod; use crate::...
63ced8367b8c7a0ae5dcdc9d4b3db8570715979673034ab4506f04a5ade42d49
Rust
34,131
956
use anyhow::{anyhow, bail}; use bitvec::{order::Lsb0, view::BitView}; use derive_new::new; use memchr::{memchr, memchr_iter}; use rust_htslib::bam::{ self, ext::{BamRecordExtensions, IterAlignedPairs}, record::AuxArray, }; use crate::{ errs::MkResult, mod_base_code::{DnaBase, ModCodeRepr}, util...
9e43b1bfa8be7d60828700d522d867d5c8cd760d19c46c3b44a690b4630307ab
Rust
40,080
1,072
use std::cmp::Ordering; use std::collections::{HashMap, HashSet, VecDeque}; use std::fmt::{Display, Formatter}; use std::ops::Range; use std::path::{Path, PathBuf}; use anyhow::{anyhow, bail, Context}; use derive_new::new; use indexmap::IndexSet; use indicatif::{MultiProgress, ProgressIterator}; use itertools::Itertoo...
faeca1505239b134ec1422a47f2054b655e0f448cc9d296ce575d8abaef3fa98
Rust
40,310
1,134
use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap, HashSet}; use std::fmt::{Debug, Display, Formatter}; use std::fs::File; use std::io::{BufRead, BufReader, Write}; use std::path::PathBuf; use std::string::FromUtf8Error; use ansi_term::Style; use anyhow::{anyhow, bail}; use clap::Args; use derive_new::n...
f4b2c64d4516d44afe932ad306354f88ae22b5cf0ea4d1eb0075d6c3ebd142cb
Rust
40,901
1,131
use std::collections::HashMap; use std::path::PathBuf; use std::sync::RwLock; use anyhow::{anyhow, bail, Context}; use clap::{Args, Subcommand}; use common_macros::hash_map; use indicatif::{MultiProgress, ParallelProgressIterator}; use itertools::Itertools; use log::{debug, info}; use prettytable::{row, Table}; use ra...
8b1e1449d605fa76da6bc40dfaa2b974b9abf7cc9590d35783383cff411daa45
Rust
44,458
1,196
use itertools::Itertools; use rustc_hash::FxHashMap; use std::collections::{HashMap, HashSet}; use std::path::{Path, PathBuf}; use anyhow::{bail, Context}; use clap::{Args, Subcommand}; use common_macros::hash_map; use crossbeam_channel::bounded; use indicatif::{MultiProgress, ProgressIterator}; use log::{debug, error...
cd378f152382a18351aab6df344bdf9057fbdf373476226e4b9c6830370d9923
Rust
45,748
1,347
use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet, HashMap, VecDeque}; use std::fs::File; use std::io::{BufWriter, Write}; use std::ops::Range; use std::path::PathBuf; use std::sync::Arc; use anyhow::bail; use derive_new::new; use indicatif::{MultiProgress, ProgressBar}; use itertools::Itertools; use l...
e047ade7ab773d065bdd744ba5222f66c12c3bf372bdbe513263ca7776644243
Rust
47,992
1,518
use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::fmt::{Debug, Display, Formatter}; use std::hash::Hash; use std::io::{BufRead, BufReader}; use std::path::{Path, PathBuf}; use std::str; use anyhow::{anyhow, bail}; use anyhow::{Context, Result as AnyhowResult}; use bio::alphabets::dna::compleme...
baf4424ddb418b470e2b23a8c635c9fb554762feaa3c98c266dfb085462fa87c
Rust
49,863
1,375
use std::collections::{BTreeMap, HashMap, HashSet}; use std::ops::ControlFlow; use bio::alphabets::dna::revcomp; use derive_new::new; use indicatif::ParallelProgressIterator; use itertools::Itertools; use log::debug; use rayon::prelude::*; use rust_htslib::bam::ext::BamRecordExtensions; use rust_htslib::bam::record::C...
f6d529a063299cffacd290b29a4cab5fdf2785b692cbc1d3be7d8f17da9c6df9
Rust
51,031
1,475
use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap}; use std::fs::File; use std::io::{stdout, BufWriter, Cursor, Stdout, Write}; use std::path::{Path, PathBuf}; use anyhow::{anyhow, bail, Context, Result as AnyhowResult}; use bitvec::order::Lsb0; use bitvec::view::BitView; use charming::component::{ ...
4af3f4b65ddba7555e1e4c8f4a65e68753c2e98351908c37ebfb7c502a84a2fd
Rust
60,438
1,695
use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::ops::Range; use std::path::PathBuf; use std::sync::Arc; use anyhow::{anyhow, bail, Context}; use derive_new::new; use itertools::{Itertools, MinMaxResult}; use log::{debug, info}; use nom::chara...
877e157d9f39709eb71f3302a6990ebce951728f4eac40c34ead0e2dc69c7136
Rust
62,076
1,761
use std::{ collections::HashMap, marker::PhantomData, path::PathBuf, sync::Arc, usize, }; use anyhow::{anyhow, bail}; use bitvec::{order::Lsb0, view::BitView}; use derive_new::new; use indicatif::MultiProgress; use itertools::Itertools; use log::{debug, info, warn}; use log_once::{debug_once, warn_once}; use prett...
42c78e5c3cdee5a231660e5ea652e928443c10db7e70819161edd3a829c9af94
Rust
75,615
1,940
use std::collections::{BTreeMap, HashMap, HashSet}; use std::fs::File; use std::io::{BufRead, BufReader, BufWriter, Write}; use std::ops::Neg; use std::path::{Path, PathBuf}; use std::sync::Arc; use anyhow::{anyhow, bail, Context}; use clap::{Args, Subcommand}; use indexmap::IndexMap; use indicatif::{MultiProgress, Pr...
8d1d938d22ac862cfbc250d1d9ff4ba30b3d99824e5d5d80d533a215e01d465c
Rust
83,338
2,597
use std::{ collections::{HashMap, HashSet}, fmt::{Debug, Write}, fs::File, io::{BufRead, BufWriter, Write as IoWrite}, ops::Neg, path::{Path, PathBuf}, sync::Arc, }; use crate::{ dmr::isoform::{ gtf_reader::open_gtf_reader, pair::run_gene_dmr, scoring::{dirichlet...
2e9fde9991373abe6edbe143f0daae292c5636faa66eddf970792f725fd4b7c3
Rust
87,827
2,509
use std::{ cmp::Ordering, collections::HashMap, marker::PhantomData, ops::Range, path::PathBuf, }; use anyhow::{anyhow, bail}; use bitvec::slice::BitSlice; use common_macros::hash_map; use itertools::Itertools; use rustc_hash::{FxHashMap, FxHashSet}; use std::ops::BitOrAssign; use crate::{ errs::{MkError,...
ed28075b62c58c1e26be4f1a5dd6e9dfd816d9836e7142e606c8404d324d04ac
Rust
95,499
2,377
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::io::BufWriter; use std::path::{Path, PathBuf}; use std::sync::Arc; use anyhow::{anyhow, bail, Context}; use clap::Args; use common_macros::hash_set; use crossbeam_channel::bounded; use indicatif::{MultiProgress, ParallelProgressIterator}; use itert...
bb63958f35b468ac36c829c27fbe10cc53d09226095670f174d3370b73affe9f
Rust
99,212
2,475
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::num::ParseFloatError; use std::ops::AddAssign; use std::path::{Path, PathBuf}; use std::sync::Arc; use anyhow::{anyhow, bail, Context}; use clap::{Args, Subcommand, ValueEnum}; use indicatif::{MultiProgress, ParallelProgressIterator, ProgressDrawTa...
6a7a7f91ef9531bb7120b8ecd8adc95189927f3dbae5ccf995772e8fa137de0a
Rust
101,441
2,919
use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::fmt::{Debug, Display, Formatter}; use std::hash::Hash; use anyhow::bail; use derive_new::new; use itertools::{Itertools, PeekingNext}; use log::debug; use nom::bytes::complete::tag; use nom::character::complete::{digit1, multispace0}; use nom::...
985bd0f03a4e88e1f554836fa67828e04137a73fd4279c5d173b96a9dc4b4f65
Rust
124,555
3,651
use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap}; use std::fmt::{Display, Formatter}; use std::io::{BufRead, BufReader}; use std::ops::Range; use std::path::PathBuf; use std::sync::{Arc, RwLock}; use anyhow::{anyhow, bail, Context}; use bitvec::prelude::*; use derive_new::new; use indicatif::{MultiPro...
877ff8bc6565fd0a32042267f8a893c1ac6191d7643cd1a89673350ec9edd266
Shell
35
2
#!/bin/bash pip install rdkit-pypi
cb2ce8dfefb1c940fd612d0534d0cd65f509121210cca9056bcf377692c47c37
Shell
115
3
#!/bin/sh python custom/download_script.py python custom/task_execution.py --queue "custom-cpu" --concurrency "$1"
db05b755940751d385fe420a9e127605b2f2f1a31af8d210aec8375341668c70
Shell
115
3
#!/bin/sh python custom/download_script.py python custom/task_execution.py --queue "custom-gpu" --concurrency "$1"
41f8abc12ca5a20d69bc75d4df27b2ce4d86f32d577e46aa059b3a5a1f90296c
Shell
116
7
set -e rm -rf docs/generated/ black . isort . ruff . coverage run -m unittest sphinx-build -W docs docs/_build/html
334f7ba68de9f01151e6df8061249e29b9c5a53f3159891076e5bb7f92f79231
Shell
122
1
$PYTHON setup.py install --single-version-externally-managed --record=record.txt # Python command to install the script.
dae5b9c6184dde7fde86e40279359a2395c1f8409fd82d829791ab073991ee04
Shell
137
6
#!/usr/bin/env bash set -euo pipefail for b in 1 2 3 4; do bash scripts/02_run_batch.sh "$b" done bash scripts/04_check_bam_outputs.sh
a418ea9202a8232346f40695140fe32169bf3356affb660a84b5a46ba72d6989
Shell
152
1
docker run -d -p 1111:8787 -e USER=user -e PASSWORD=pw --name rstudio_docker -v /data/to/mount/:/home/user/data jsschrepping/r_docker:jss_R432_bioc318
2442cf1f2197a51f6d44694755c8f085879851e21528c8f9b96f090a4b9692ae
Shell
172
8
#!/usr/bin/env bash set -euo pipefail if grep -n '^RUN_TESTS_.*=0' tests/*.sh; then echo "Found disabled RUN_TESTS_ in test scripts. Set them to '=1'." exit 1 fi