sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
2c9f5bdb9e69caf19c70542a22328905ddf862a1c747f8551ba933642eed706a
Rust
14,152
403
// This file is @generated by prost-build. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AnnotationFeature { /// chain type of the reference record, e.g. TRA #[prost(enumeration = "VdjChain", tag = "1")] pub chain: i32, /// same as gene_name #[prost(string, tag = "2")] pub d...
98f563d084fc5aaa97a90e4ce8ba810e5e6ecf0a920d5561af20239d53f8d3e9
Rust
14,402
348
//! Martian stage GENERATE_CAS_WEBSUMMARY //! Dump vega plots into cell annotation websummary #![deny(missing_docs)] use crate::HtmlFile; use crate::cell_annotation_ws_parameters::{ CellAnnotationMetrics, CellTypeWebSummaryBundle, CellTypeWebSummaryBundleValue, WebSummaryCellTypeInputs, generate_cas_bc_mismatch...
af8b707510d3bdc20cc91d95b0687d6d269edc290b9f9f5d3c9897064749681f
Rust
14,412
419
//! Reading/Writing the vdj contig proto file which is used for VDJ aggr. This file contains //! metadata about the VDJ analysis, the VDJ reference and a list of annotated contigs. //! //! The messages are defined in `types.proto`. The file format is as follows //! ```text //! //! +-------------------------+ //! | Numb...
a5775fe02afb273535dc31a02bd88ccded12a735a9509e01f094be3f3fb4ef0d
Rust
14,634
514
#![deny(missing_docs)] use nom::branch::alt; use nom::bytes::complete::{tag, take_till}; use nom::character::complete::char; use nom::combinator::peek; use nom::error::{ErrorKind, make_error}; use nom::multi::{many_till, many0, many1}; use nom::sequence::{delimited, preceded, terminated}; use nom::{Err, IResult, InputT...
20f6de81423efca9dfdefddd637aa52fa7b55413639c9ace0b4e99467c849f44
Rust
14,704
348
//! Filter B cells based on UMI counts. // Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] use crate::core::barcode_fate::BarcodeFate; use crate::core::defs::{CloneInfo, EncloneControl, ExactClonotype}; use crate::core::enclone_structs::{BarcodeFates, CandidateClonotype}; use itertool...
46a0973c07a213073f5856be7fcd41b3af0a21db40e5bb9c1b4d3787c9d5c4b6
Rust
14,878
405
#![expect(missing_docs)] use crate::constants::UmiType; use bio; use bio::alignment::{Alignment, AlignmentOperation}; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; use std::cmp; pub type Scoring = bio::alignment::pairwise::Scoring<bio::alignment::pairwise::MatchParams>; const MAX_OUT_QUAL: u8 = 60...
4f4e7eef71bc295031bd816c3213a7967eb38158a10a0527395283bf940c8a79
Rust
14,888
383
#![expect(missing_docs)] use crate::constants::{ReadType, UmiType}; use crate::sw; #[cfg(test)] use crate::{bam_utils, utils}; use debruijn::dna_string::DnaString; #[cfg(test)] use rust_htslib::bam; use serde::{Deserialize, Serialize}; /// A macro creating methods for flag access. /// Copied from rust_htslib. macro_ru...
d2b77fbb217e2d87256fb0af4a9d90f1aafdb273b68ba633a2ddf5c2f17de136
Rust
14,938
445
//! Martian stage MULTI_PREFLIGHT //! Run pre-flight checks. #![deny(missing_docs)] use crate::MultiParams; use crate::preflight::{ check_crispr_target_genes, check_resource_limits, check_vdj_inner_enrichment_primers, check_vdj_known_enrichment_primers, hostname, validate_target_panel, }; use anyhow::{Context,...
deab223caec537c8c493f542e0b450ff6a5d6799843084cf34a368320f979b0b
Rust
15,354
429
//! Identify duplicate reads originating from the same molecule. #![expect(missing_docs)] use crate::read::{AnnotationInfo, ReadAnnotations, RecordAnnotation}; use bytes::Bytes; use cr_types::probe_set::ProbeSetReference; use cr_types::reference::feature_reference::FeatureReference; use cr_types::rna_read::RnaChunk; u...
4e82aed4e5455ba0388f463d178bca25cb19ef4e0a846268f2cd7b6af97dd1c8
Rust
15,387
419
//! Martian stage WRITE_BARCODE_SUMMARY //! Write the file barcode_summary.h5. #![deny(missing_docs)] use crate::BarcodeMetricsShardFile; use crate::align_metrics::{ BarcodeKind, BarcodeMetrics, GenomeMapping, LibFeatThenBarcodeOrder, MULTI_GENOME, MappingRegion, }; use crate::utils::estimate_mem::barcode_mem_...
7a9bd03e8eb148a93e6e908b7a8688276d1895b1d80f674a20db4a5b5a1febea
Rust
15,489
411
//! Martian stage BUILD_PER_SAMPLE_VDJ_WS_CONTENTS #![deny(missing_docs)] use crate::SequencingMetricsFormat; use crate::stages::parse_multi_config::VdjGenInputs; use anyhow::Result; use cr_types::{ BarcodeMultiplexingType, CellLevel, CrMultiGraph, LibraryType, MetricsFile, ReadLevel, SampleAssignment, Sequenc...
1121846b3a3a4e8081ec183ea76d77001f1ff3e6a372ceafaa6a3490d565f4da
Rust
15,757
568
//! cr_websummary #![expect(missing_docs)] mod alert; pub mod multi; mod value; pub use alert::{AlertContext, AlertLevel, AlertSpec}; extern crate self as cr_websummary; use alert::Alert; use anyhow::Result; use metric::{PercentMetric, TxHashMap}; use plotly::Layout; use plotly::common::Anchor; use plotly::layout::{...
bdc7a3ab0e6a849d4cef81ab92f36d11ec6178278d11d0fb3a086a289ca02800
Rust
15,839
377
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] // This file provides the single function graph_filter. use super::BarcodeFilter; use crate::core::barcode_fate::BarcodeFate; use crate::core::defs::BarcodeContigs; use graph_simple::GraphSimple; use io_utils::fwriteln; use petgraph:...
7e6fff3957f40ea46943cb0981d9c1a0071b506451f61a8e5ed1e582757205a4
Rust
16,025
434
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] use crate::core::defs::{CloneInfo, EncloneControl, ExactClonotype, PotentialJoin}; use crate::core::join_one::join_one; use equiv::EquivRel; use qd::Double; use std::cmp::max; use std::collections::HashMap; use vdj_ann::refx::RefData;...
afe24dfcfa96670d88c8e360eb30e6ec1015305942b561fe1cf978f81dc8bb6d
Rust
16,065
461
#![deny(missing_docs)] use anyhow::{Result, anyhow}; use core::iter::IntoIterator; use cr_types::in_flight::{InFlightPool, Reservation}; use cr_types::spill_vec::SpillVec; use crossbeam_channel::unbounded; use crossbeam_utils::thread::{Scope, ScopedJoinHandle}; use itertools::Itertools; use martian_filetypes::LazyFile...
e4953462562dca3827ff10d7b1b55445e10cc893b1a42f42296b513dd7ab891a
Rust
16,120
383
#![expect(missing_docs)] use crate::{ChartWithHelp, PlotlyChart, RawChartWithHelp, TitleWithHelp}; use cr_types::{GenomeName, LibraryType, TargetingMethod}; use metric::{AsMetricPrefix, TxHashMap, TxHashSet}; use plotly::Layout; use plotly::common::{Anchor, Line, Mode}; use plotly::layout::{Axis, HoverMode, Legend, Mar...
d7265db68add51e51024522423c155d565d2e3e08a4635eeb6498bfc0a6d8d80
Rust
16,421
458
#![expect(missing_docs)] use crate::config::csv::CsvParser; use crate::config::parse::{Parse, ParseCtx}; use crate::config::scsv::{Section, Span, XtraData, plain_csv}; use crate::config::{Ident, MultiConfigCsv, SampleBarcodeColumn, multiconst}; use anyhow::{Context, Result, anyhow, bail, ensure}; use cr_types::{Barcode...
111cc45e2126b12e5c37ddf6e329fb74cdc10ea851619be392b30ea95bdc86ac
Rust
16,446
504
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![expect(missing_docs)] use debruijn::dna_string::DnaString; use itertools::Itertools; use martian_derive::MartianStruct; use martian_filetypes::json_file::JsonFile; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use vdj_ann::annotate::{Annot...
5eb1759d6ab96d53ae8cadb046262c41f08383c1eec56f550808bccd27d74b68
Rust
16,509
466
//! Martian stage COLLATE_METRICS //! This stage receives per barcode metrics from ALIGN_AND_COUNT and creates the summary JSON. #![deny(missing_docs)] use crate::AggregateBarcode; use crate::align_metrics::{BarcodeKind, BarcodeMetrics, LibFeatThenBarcodeOrder, VisitorMetrics}; use crate::types::BarcodeMetricsShardFile...
70d4cd3845b6fd014e1e7f784b349b35dd9ebe1f9f2e2661d5aadcbdf74ce97f
Rust
16,569
485
//! Utilities for finding groups of FASTQ produced by `bcl2fastq` from Illumina. #![expect(missing_docs)] use crate::filenames::{LaneMode, LaneSpec}; use crate::read_pair_iter::FastqSet; use anyhow::{Context, Result}; use itertools::Itertools; use lazy_static::lazy_static; use regex::Regex; use serde::{Deserialize, Se...
0bbe145171ffa37a8e140c7f07d90457986dfba7ee606ae89fc2556753346ee1
Rust
16,700
456
//! Probe set reference CSV #![deny(missing_docs)] use crate::probe_set::{Probe, ProbeRegion, ProbeType}; use crate::reference::feature_reference::get_genome_from_feature_id; use crate::reference::reference_info::ReferenceInfo; use crate::{FeatureID, FeatureName}; use anyhow::{Context, Result, bail, ensure}; use itert...
b989d166d35fb8f152b50313bcbac0e200fbb621be9a7c41c37ca75a68e73e7c
Rust
16,811
541
// Copyright (c) 2021 10x Genomics, Inc. All rights reserved. #![expect(missing_docs)] // This file contains functions that take as input an amino acid reference sequence for a V // segment, along with its chain type (IGH, IGK, IGL, TRA or TRB), and attempt to find features in // the sequence. // // These functions ca...
3ef69ef7909c2996a397da9fd717c70c52f8f61196ffa61155e671ce573bf5ed
Rust
16,965
539
#![expect(missing_docs)] use anyhow::{Context, Result, bail}; use cr_types::reference::feature_reference::{ FeatureDef, FeatureReference, FeatureType, REQUIRED_FEATURE_TAGS, TargetSet, }; use fastq_set::read_pair::WhichRead; use hdf5::Group; use hdf5::types::FixedAscii; use itertools::Itertools; use std::borrow::Co...
070e5621c1a07db980fe522c91ad5fab5f4a068c42a42b581e8dcbda603aca43
Rust
17,061
476
//! Souporcell source code //! //! MIT License //! //! Copyright (c) 2019 Haynes Heaton //! //! Permission is hereby granted, free of charge, to any person obtaining a copy //! of this software and associated documentation files (the "Software"), to deal //! in the Software without restriction, including without limita...
74ed131e3a1a14a68c4545c160f117cebc0627e6fe3096dc48d8256b8d21e5b9
Rust
17,932
469
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] // // This set of functions writes a protobuf data structure that // Loupe uses to access clonotype data. use self::refx::RefData; use crate::core::defs::{AltRef, ColInfo, EncloneControl, ExactClonotype}; use crate::core::join_one::{R...
bc9e26c40ffa757e3b44c56ab6532cab4a49b130371ad590af3119345819629c
Rust
17,981
578
use crate::aggregation::GeneAggregation; use anyhow::{bail, Result}; use csv::ReaderBuilder; use ndarray::{Array1, Array2, Axis}; use regex::Regex; use std::collections::{HashMap, HashSet}; use std::{ fs::File, io::{BufRead, BufReader}, }; type Record = HashMap<String, String>; pub struct SimpleFrame { he...
a51a70ec6c80dbc3c470a4d28eb621151e39d867e9e8970c0288539f327086fc
Rust
18,525
538
//! I/O HDF5 helper functions #![deny(missing_docs)] use crate::types::{ ClusteringKey, ClusteringResult, ClusteringType, EmbeddingResult, EmbeddingType, H5File, PcaResult, ReductionType, clustering_key, }; use anyhow::{Context, Result}; use cr_types::reference::feature_reference::FeatureType; use itertools::F...
110293cfb244c52a7ef3689228739a0638184474a70524b57284488ba6bd643e
Rust
18,702
469
//! Martian stage DETECT_VDJ_RECEPTOR #![deny(missing_docs)] use crate::detect_chemistry::chemistry_filter::detect_chemistry_units; use anyhow::{Context, Result, anyhow, bail}; use cr_types::reference::feature_reference::{BeamMode, FeatureConfig, FeatureReferenceFile}; use cr_types::sample_def::SampleDef; use cr_types...
b8d18cba6cc7ec51ddb61780594eee96008447ab4c6d8eff08dd79470869d773
Rust
19,263
596
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. //! See README for documentation. #![deny(missing_docs)] use crate::Dataset; use crate::core::barcode_fate::BarcodeFate; use crate::core::defs::{AltRef, CloneInfo, EncloneControl}; use crate::core::enclone_structs::{BarcodeFates, CandidateClonotype, Enclone...
eaf211b0747cd542e3a7a4f5d142ccce7835348b30b3dbdd07539c01bef7c40a
Rust
19,464
541
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] use self::annotate::Annotation; use self::refx::RefData; use crate::core::barcode_fate::BarcodeFate; use crate::core::defs::{BarcodeContigs, Contig, EncloneControl}; use crate::core::enclone_structs::BarcodeFates; use crate::enclone::...
332a1001ebeb81351bfb2ec9b830c6006dcc0b3f656c8d838218a597adf564aa
Rust
19,793
440
//! Martian stage WRITE_CONTIG_OUTS #![expect(missing_docs)] use crate::BarcodeDataBriefFile; use crate::assembly_types::{FastaFile, FastqFile}; use anyhow::Result; use cr_types::MetricsFile; use json_report_derive::JsonReport; use martian::prelude::*; use martian_derive::{MartianStruct, make_mro, martian_filetype}; u...
d64539f19b3ae8419d6c25c124a8c4b4182e808b1e380e5b2dae1c15a0b8bddf
Rust
19,854
526
//! - Converting from crate::types to vdj_types //! - Additional functions to auto derived structs #![expect(missing_docs)] use crate::types::vdj_proto_message::MessageContent; use crate::types::{ AsmData, GexData, MetricsSummary, VdjMetadata, VdjProtoMessage, VdjReferenceRaw, }; use anyhow::Result; use itertools:...
07a0c38aa73fb57be9bf6ae589a16694093a4e3256ea8bd493d26c7fc13f0e6c
Rust
20,133
491
// Copyright (c) 2020 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] // This file provides functions to find alternate alleles and substitute them into references. use self::refx::RefData; use crate::core::defs::{AltRef, CloneInfo, ExactClonotype}; use crate::core::join_one::REF_V_TRIM; use debruijn::...
ac3e615cf1abf67078f15860c6904f88a31407652e7548a9a63a9c1b1ff2ef24
Rust
20,345
486
#![deny(missing_docs)] use crate::fit_piecewise_linear_model::{EstimatedModel, PiecewiseLinearData}; use crate::probe_barcode_matrix::ProbeCounts; use anyhow::Result; use barcode::Barcode; use cr_h5::molecule_info::MoleculeInfoIterator; use cr_types::probe_set::{ProbeRegion, ProbeSetReference}; use cr_types::reference:...
06d9eeae56d73f798e0a3e9748c5fc01ccc9594bfa27548651da8d18637330e5
Rust
20,372
569
//! Martian stage WRITE_POS_BAM #![deny(missing_docs)] use crate::{BamFile, env}; use anyhow::{Result, bail}; use barcode::Barcode; use cr_bam::bam::{BamPosSort, estimate_memory_for_range_gib}; use cr_types::rna_read::{RnaChunk, make_library_info}; use cr_types::types::{SampleAssignment, SampleBarcodes}; use cr_types:...
93e13bac531d0413b315a5d8cbd3852717fed3c9887d6fdb4495155a3fa7ca5b
Rust
20,547
610
//! Process a specification file into a metrics ETL operation. //! //! ETL = Extract, Transform, Load //! In this case, we extract metrics from the pipestance scope, transform their //! data types and process possible alerts, then load them into output data //! structures. #![deny(missing_docs)] use super::websummary:...
c4ea51fb0b1143c294f02635260812089278be428bcf1af780af6380a184e755
Rust
20,761
562
#![expect(missing_docs)] use crate::Gene; use crate::parse_gtf::{parse_gtf_line, validate_gtf_line}; use anyhow::{Context, Result, anyhow, bail, ensure}; use bio::io::fasta::IndexedReader; use bio_types::strand::ReqStrand; use flate2::read::MultiGzDecoder; use std::collections::hash_map::Entry; use std::collections::{B...
3bee33c854ca823a59cf0c0c33e21132f8e85cb479454482a4a771a7f88244be
Rust
21,047
575
// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![deny(missing_docs)] use super::defs::{CloneInfo, EncloneControl, ExactClonotype, PotentialJoin}; use debruijn::Mer; use debruijn::dna_string::ndiffs; use itertools::zip_eq; use qd::{Double, dd}; use std::cmp::min; use std::collections::HashMap; use strin...
08b59db21d55331ae11c12e8e8c47ccdee2b018cac5c1bdd852b9cda700c3612
Rust
21,094
514
//! Martian stage CHECK_BARCODES_COMPATIBILITY_VDJ #![deny(missing_docs)] use super::sample_valid_barcodes; use anyhow::{Result, ensure}; use barcode::BcSegSeq; use cr_types::chemistry::{ChemistryDef, ChemistryDefs, ChemistryName}; use cr_types::sample_def::SampleDef; use cr_types::{ERROR_CODE_INFO, LibraryType}; use ...
da7b07737521b0071e94732d9fae2adbad60cb949f60ccbd6ff98ca3f29a1406
Rust
21,179
547
#![deny(missing_docs)] use crate::SequencingMetrics; use crate::barcode_sort::ReadTrimmingMetrics; use anyhow::Result; use barcode::{BarcodeConstruct, BarcodeConstructMetric, BcSegSeq}; use cr_types::SequencingPlatform; use cr_types::chemistry::ChemistryDef; use cr_types::reference::feature_extraction::FeatureExtracto...
6cbbc4de0c5bb519e1d744f2f86b43c09c6bd023a11a2dc404ef663bb9d0f6f6
Rust
21,263
603
#![expect(missing_docs)] /// /// Types for dealing with 10x barcodes /// use crate::{LibraryType, hardlink_with_fallback}; use anyhow::{Result, format_err}; use barcode::Barcode; use itertools::Itertools; use martian::{AsMartianBlanketType, AsMartianPrimaryType, MartianBlanketType}; use martian_derive::{MartianStruct, ...
79f27eddeed34d413af27e22dcca905be8676305dddad814a5831041a4dfc20b
Rust
22,731
623
//! Martian stage MERGE_MOLECULES #![expect(missing_docs)] use anyhow::Result; use barcode::BarcodeContent; use cr_h5::molecule_info::{ BarcodeIdxType, LibraryIdxType, MoleculeInfoIterator, MoleculeInfoReader, MoleculeInfoWriter, bin_barcodes, open_for_modification, trim_barcodes, }; use cr_types::aggr::CountA...
36fc9768abfda3be095f41693e92b5f6a971a0e178ea5a3cf353dba240fa505e
Rust
22,868
717
// Copyright (c) 2018 10x Genomics, Inc. All rights reserved. #![expect(missing_docs)] //! Sized, stack-allocated container for a short DNA sequence. use crate::array::{ArrayContent, ByteArray}; use itertools::Itertools; use std::iter::Iterator; use std::str; const UPPER_ACGTN: &[u8; 5] = b"ACGTN"; const N_BASE_INDE...
b5baa1962ccbb4c95628a35145ef75e4bc17128bdc4fdb5f935629841d7c7190
Rust
23,237
657
//! A hacked-up version of the aligner from rust-bio to allow injecting custom //! scoring penalties. // Copyright 2014-2015 Johannes Köster, Vadim Nazarov, Patrick Marks // Licensed under the MIT license (http://opensource.org/licenses/MIT) // This file may not be copied, modified, or distributed // except according t...
32b69c55239f213e420146d60ce178140cfadd38434095abc898205b9063a467
Rust
23,730
653
#![expect(missing_docs)] use crate::filter_log::{AsmCellFilter, FilterLogEntry, FilterLogger, LowConfidenceReason}; use crate::pack_dna::pack_bases_80; use anyhow::Result; use arrayref::array_ref; use barcode::BcSegSeq; use barcode::whitelist::BarcodeId; use bio::alignment::distance::simd::hamming; use cr_types::chemis...
6d23219eafe79b7617ae6fbaa48c3195785ddff68094c35de1788f03a1814fdb
Rust
24,033
704
#![expect(missing_docs)] use crate::rna_read::AdapterTrimmingParameters; use crate::{AlignerParam, LibraryType}; use anyhow::{Ok, Result, bail, ensure}; use fastq_set::SSeq; use fastq_set::filenames::bcl_processor::SampleIndexSpec; use fastq_set::filenames::bcl2fastq::{self, SampleNameSpec}; use fastq_set::filenames::f...
3c558e392848c8c073f206f7b4cf85cd5d6538309657378297460bb6ab57fccf
Rust
24,220
588
//! Martian stage CHECK_BARCODES_COMPATIBILITY //! //! This stage checks that barcodes from different libraries are compatible. //! //! ## What is the meaning of compatibility? //! //! A set of cells processed through a single 10x gem well could be used to create multiple sequencing //! libraries (GEX, Ab etc.). In ord...
16ab7fc6edefb8af010588d55708d81caeaf91a0e740e3f4456faab315112d43
Rust
24,697
633
//! hyperbase // Copyright (c) 2018 10X Genomics, Inc. All rights reserved. #![expect(missing_docs)] // This file defines a HyperBasevector structure, and a Hyper structure, which // is a HyperBasevector plus an involution and read ids for each edge. use debruijn::compression::{SimpleCompress, compress_kmers}; use de...
2de9bc511e73b4853ed860601a852c0838079221e36a1f4af2c4f92c9c05ca27
Rust
25,167
517
// This file is @generated by prost-build. /// Evidence that a given cell is iNKT or MAIT. Each ExactSubclonotype has one /// instantiation of this structure for iNKT and one for MAIT. #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, PartialEq, :...
74a2e34f869b5624bd576b55bbba18345a027b8d3ef49616e148a70d8cf13c01
Rust
25,398
672
//! Martian stage COMPUTE_SUBSEQ_METRICS //! //! Compute distinct-subsequence metrics over cell-associated gel-bead barcodes. #![deny(missing_docs)] use anyhow::{Result, bail}; use barcode::{BcSegSeq, WhitelistSpec}; use cr_types::LibraryType; use cr_types::chemistry::{BarcodeReadComponent, ChemistryDef, ChemistryDefs...
d7ec6970f8ead69848bf58e72362b8da59b98a0815c0c54bd7c0ea5f5f55d4a6
Rust
25,743
584
//! Martian stage SPLIT_PERTURBATION_MATRIX //! //! Stream the filtered feature-barcode matrix once and emit, for the two downstream //! `MEASURE_PERTURBATIONS` instances (by-feature and by-target), everything they need WITHOUT ever //! materializing a per-chunk feature×cell matrix: //! //! - **Sufficient statistics*...
7fdbc0d1a03a43bb7f8d67c775746d559574eb9928c7e73a2cb39034f7bdaa97
Rust
26,141
689
//! JIBES implemented in Rust, this code is a mirror of the python code in cellranger.analysis.jibes //! with the regression and model fitting steps optimized to use significantly less memory and run //! a lot faster. Any changes here should be reflected in the python code and vice-versa. #![deny(missing_docs)] use n...
47a50f69aa9ef2a4e144fb738b5e8fd72db8648a6ad42a10c920e2f515a9675c
Rust
26,380
744
#![deny(missing_docs)] use crate::make_shard_metrics::{MakeShardMetricProc, MakeShardMetricsAccum}; use anyhow::Result; use barcode::{Barcode, BarcodeConstructMetric}; use cr_bam::constants::{ALN_BC_DISK_CHUNK_SZ, ALN_BC_ITEM_BUFFER_SZ}; use cr_types::chemistry::ChemistryDef; use cr_types::rna_read::{RnaChunk, RnaProc...
6b0fb45a46729ac71b080d6f00bab285194c8b7d58a7fdab7100467f62ecc946
Rust
26,726
673
//! Martian stage MAKE_SHARD #![deny(missing_docs)] use crate::SequencingMetricsFormat; use crate::barcode_correction_metrics::{BarcodeCorrectionMetrics, BarcodeCorrectionMetricsFormat}; use crate::barcode_sort::{BarcodeSortResults, execute_barcode_sort_with_visitor}; use crate::make_shard_metrics::{ MakeShardHist...
62d6a553c784ee469ecb0421371a6115843c07fc3e81fb77f2a4b9b2ab4831e2
Rust
26,734
660
//! Martian stage CALL_TAGS_READ_LEVEL //! Assign cells to samples using their sample barcode sequence. #![deny(missing_docs)] use crate::barcode_overlap::{ FRPGemBarcodeOverlapRow, GelBeadBarcodesPerProbeBarcode, ProbeBarcodeGelBeadGrouper, calculate_frp_gem_barcode_overlap, }; use crate::detect_chemistry::pr...
43ef90378f8ed9e22d5109dfcf4215370bbd31dbebf7410ad6f295a3e46e9aa1
Rust
26,774
913
//! This module defines structures useful in keeping track of distributions. //! The following structs are defined //! * `SimpleHistogram<K>` : Histogram to keep track of counts of different items #![deny(missing_docs)] use crate::{CountMetric, JsonReport, JsonReporter, Metric, TxHashMap}; use itertools::Itertools; use...
fd8de8c56599d5fe93ad17c471f7588d77b244b181dca6c17bd26bb3b7693b46
Rust
27,084
706
//! Martian stage WRITE_MOLECULE_INFO #![deny(missing_docs)] use super::parse_multi_config::CellCalling; use crate::BcUmiInfoShardFile; use crate::probe_barcode_matrix::ProbeCounts; use crate::stages::SampleMetrics; use crate::stages::parse_multi_config::CellCallingParam; use crate::utils::estimate_mem::get_total_barc...
a2f2eae3bced6f5a07444237ae44c0186b085cc61008b871a17b6bec7dac2101
Rust
27,120
784
#![expect(missing_docs)] use super::feature_reference::FeatureType; use crate::constants::ILLUMINA_QUAL_OFFSET; use crate::reference::feature_reference::{FeatureDef, FeatureReference}; use crate::rna_read::RnaRead; use anyhow::{Result, anyhow, bail}; use fastq_set::read_pair::WhichRead; use itertools::Itertools; use re...
ae38ee42d508ad3ba0fa1571e73de08ab4f2cfe67530fc79961eb7673b0e1d05
Rust
27,172
856
//! This crate defines a number of data structures used for tracking //! various metrics in a pipeline. `Metric` trait forms the core of this //! crate and all the data structure which represents a metric implements //! this trait. The crate `metric_derive` allows one to derive the `Metric` //! trait. The data structur...
b85948c1d6e57f1db382a5221137e78cbba58f90137aa51f13f17edfc2554e49
Rust
27,437
673
//! Martian stage BARCODE_CORRECTION #![deny(missing_docs)] use crate::barcode_correction_metrics::{ BarcodeCorrectionMetrics, BarcodeCorrectionMetricsFormat, BarcodeDiversityMetrics, }; use crate::barcode_sort::BarcodeOrder; use crate::stages::make_correction_map::CorrectionMapFormat; use crate::types::ReadShardF...
e4e154bd407383c56702558e9d26a4bb90cd698432bce7462e14cd8c1d843825
Rust
28,008
626
// Cell Annotation Web Summary Parameters used across multi, count, and spatial #![deny(missing_docs)] use anyhow::{Ok, Result}; use martian_derive::MartianStruct; use martian_filetypes::FileTypeRead; use martian_filetypes::json_file::JsonFile; use metric::TxHashMap; use serde::{Deserialize, Serialize}; use serde_json:...
5602ed0c76625b6e3bcc2586ab410e21d000c0c8eb4011094aa74e6ca07a149a
Rust
28,963
722
#![deny(missing_docs)] use anyhow::{Context, Result}; use diff_exp::diff_exp::{DiffExpResult, SSeqParams, sseq_de_from_sums, sseq_params_from_moments}; use diff_exp::stat::Statistics; use diff_exp::{NbExactBackend, compute_sseq_params, sseq_differential_expression_backend}; use ndarray::Array1; use numpy::{Element, In...
ac5751c79a4ddc8372ef1fb0c058f7ae2504adf44b8cc01d97877ec09e7e981c
Rust
29,378
853
#![deny(missing_docs)] use crate::align_homopolymer::count_homopolymer_matches; use crate::minimap2::{MinimapAligner, new_record}; use anyhow::Result; use barcode::{Barcode, BarcodeContent}; use cr_types::chemistry::ChemistryName; use cr_types::constants::ILLUMINA_QUAL_OFFSET; use cr_types::probe_set::ProbeSetReferenc...
55b08e73bf9843a72c80b8a2ef8542be13b3e4e8b25be41845ad422022a3e61f
Rust
29,773
868
//! Data structure for parsing the VDJ reference and other helper function #![expect(missing_docs)] use anyhow::{Result, bail}; use bio::io::fasta::{self, Record}; use errors::{ErrorContext, HeaderErrors, VdjReferenceErrors}; use martian_derive::MartianType; use serde::{Deserialize, Serialize}; use std::collections::H...
9c07188ba1f461e6ec0915313a247daa38a7c1b14d93440f90c9df6944060ab5
Rust
29,960
811
#![expect(missing_docs)] use crate::binned::SquareBinRowOrColumnIndex; use crate::{BarcodeSegment, BarcodeSegmentContent, BcSegSeq, io_utils}; use anyhow::{Context, Result, bail}; use barcodes_folder::find_whitelist; pub use barcodes_folder::{find_atac_whitelist, find_slide_design}; use itertools::Itertools; use martia...
ae333e111a1a2f1dbc6e2a6bd812607a0aed2f601a74c05870a7ad1a670c9be9
Rust
30,722
820
//! A feature-barcode count matrix. #![expect(missing_docs)] use crate::iter::{H5Iterator, ThreadedH5Iterator}; use crate::{ ChunkedWriter, ColumnAction, extend_dataset, feature_reference_io, make_column_ds, scalar_attribute, write_column_ds, }; use anyhow::{Context, Result, bail}; use barcode::{Barcode, MAX_B...
4a5da6ebd9e33aa9aa20c959a5fe56ff7c0fd82a6f704c949217978c7b23bbc1
Rust
31,914
781
// TODO: fix these. #![expect(missing_docs)] #![allow(clippy::needless_range_loop)] use crate::filter_barcode_level::BarcodeCellInfo; use crate::filter_log::{ AsmCellFilter, FilterLogEntry, FilterLogger, FilterSwitch, IndelErrorMode, }; use crate::pack_dna::unpack_bases_80; use barcode::{Barcode, BcSeq}; use debru...
eeec9af2174b9711bf0396be2c9794d556732e377db9fc34c2993a5dc0a73453
Rust
32,235
844
#![deny(missing_docs)] use anyhow::{Context, Result, bail, ensure}; use bio::alphabets::dna::revcomp; use cr_h5::probe_reference_io::PROBE_DATA_LEN; use cr_types::probe_set::ProbeSetReferenceMetadata; use cr_types::reference::feature_reference::{FeatureReference, FeatureType}; use cr_types::reference::probe_set_refere...
0721dfea696c58358e6e5c483c1d3e3b9262ee61098611b32e8d2a0f3c73b9d1
Rust
33,091
956
//! Read a set of FASTQs, convert into an Iterator over ReadPairs. // Copyright (c) 2018 10x Genomics, Inc. All rights reserved. #![expect(missing_docs)] use crate::ERROR_CODE_INFO; use crate::read_pair::{MutReadPair, ReadHeader, ReadPair, ReadPairStorage, ReadPart, WhichRead}; use anyhow::{Context, Result, anyhow, ba...
7ee1f391d0dfcbebed5369c509a0ee5978c38ed2c1331de4e45b4f34d30ca322
Rust
35,024
1,010
//! cellranger #![deny(missing_docs)] use anyhow::{Context, Result, bail, ensure}; use clap::{self, Parser}; use cr_types::cell_annotation::CellAnnotationModel; use cr_types::sample_def::SampleDef; use cr_types::types::FileOrBytes; use cr_types::{LibraryType, TargetingMethod}; use cr_wrap::annotate::AnnotateMro; use c...
074eec53b9060d540424cf6804f1d2071c7562249dc2e55aa94d7bee44a90448
Rust
35,152
941
//! This captures and analyzes data about barcodes. #![expect(missing_docs)] use crate::constants::{CHAIN_TYPES, CHAIN_TYPESX, PRIMER_EXT_LEN}; use crate::reverse_complement; use io_utils::{fwrite, fwriteln}; use itertools::Itertools; use metric::{Histogram, JsonReporter, PercentMetric, SimpleHistogram, TxHashMap}; us...
4bf8f2e6ca86a8e70d2dffed11de4ead52c2c046b3d25cc354b819a3077f7838
Rust
35,473
1,105
//! Crate for VarTrix. //! //! Computes allele counts given alignment shards and a barcode list. #![deny(missing_docs)] use anyhow::{Context, Result, bail}; use barcode::Barcode; use bio::alignment::Alignment; use bio::alignment::pairwise::banded::Aligner; use bio::io::fasta; use cr_types::{BamContigInfo, BarcodeIndex}...
d0326844cb762b3e3418bea7716fdb3f65eb52d96b18ba3357fe28142cce3b78
Rust
39,971
1,003
//! Martian stage PARSE_MULTI_CONFIG #![deny(missing_docs)] use super::setup_reference_info::get_reference_info; use crate::preflight::hostname; use crate::{MultiParams, index_schemes_to_custom_chemistry_defs}; use anyhow::{Result, anyhow, bail}; use base64::Engine; use base64::prelude::BASE64_STANDARD; use cr_types::...
e222a56febb7333d1a1f55afbb799a52e399be7be2ff7dc0215464b31352ef02
Rust
40,194
1,116
//! Trim adapters from reads using a combination of //! k-mer matches, sparse alignment and banded alignment. //! Inspired by the [cutadapt](https://cutadapt.readthedocs.io/) tool. //! //! # Features/Limitations //! * Supports regular, anchored and non-internal, 3' and 5' adapter trimming //! * Linked adapters are not ...
aa320977832aa2548bdc3452e4b126b00ec0ad01b542a66f8c63b5968aa4ee04
Rust
41,521
1,215
//! The file contains reference-free code for finding paths in a graph and //! simplifying it. #![deny(missing_docs)] #![expect(clippy::many_single_char_names)] use graph_simple::GraphSimple; use hyperbase::Hyper; use std::cmp::max; use std::iter::zip; use std::mem::swap; use vector_utils::{ bin_member, bin_positi...
3e72a926d35b7e745ee90004e43208afddb31a96f43a8e3e51b07e265271b5ac
Rust
41,870
1,167
#![deny(missing_docs)] use crate::aligner::BarcodeSummary; use anyhow::Result; use barcode::Barcode; use cr_types::probe_set::{ MAPQ_GAP_MAPPED_NOT_WITHIN_MAX_ERR, MAPQ_HALF_MAPPED, MAPQ_SPLIT_MAPPED, }; use cr_types::rna_read::RnaRead; use cr_types::{GenomeName, LibraryType}; use itertools::Itertools; use json_re...
6f227b82342b87994f73ceba0fba9fa87c094b335f13eb8cdffca19e0985670a
Rust
42,095
1,145
//! Martian stage SUMMARIZE_VDJ_FILTERS #![expect(missing_docs)] use crate::matrix::{H5File, gex_umi_counts_per_barcode}; use anyhow::Result; use cr_lib::parquet_file::{ParquetFile, ParquetWriter, PerBarcodeFilter}; use enclone_process::BarcodeFate; use itertools::Itertools; use martian::prelude::*; use martian_derive...
d9fb9d40163b8530d214ab7d9d5c29f44a0ccc9e8c0166528cb098584ee31060
Rust
42,631
1,052
//! Identifies canonical adapter configurations in long-read sequencing data //! and uses flanking adapters to extract 10x library constructs. use crate::WhichRead; use crate::adapter_trimmer::{Adapter, AdapterTrimmer}; use crate::adapters::AdapterKind; use crate::read_pair::{ MAX_READ_HEAD, MAX_READ_LEN, MutReadPa...
2aeaa5d5ac58ff1d0b01ecb7d7117fd46e2d17ad1f404cf06045c549c6ef9478
Rust
44,177
1,282
#![expect(missing_docs)] use anyhow::{Context, Result}; use barcode::whitelist::ReqStrand; use cr_types::reference::genome_of_chrom::genome_of_chrom; use cr_types::{AlignerParam, GenomeName, utils}; use fastq_set::WhichEnd; use martian_filetypes::FileTypeRead; use martian_filetypes::tabular_file::TsvFileNoHeader; use m...
58a77d068ccf2dad5eb911881e4c3d5135bca4832b3ba4ccd63aed627f6b8440
Rust
44,205
1,400
#![expect(missing_docs)] use crate::reference::feature_reference::FeatureReference; use anyhow::{Context, Result, bail, ensure}; use barcode::{Barcode, BarcodeConstruct, BarcodeFromString, BcSegSeq}; use itertools::Itertools; use martian::{AsMartianPrimaryType, MartianFileType, MartianPrimaryType}; use martian_derive::...
e69e9e5949f44850c1b51f463aa9b81165b6988faf4f0dc1a803fd30b8834bdd
Rust
45,427
1,356
//! Crate for dealing with 10x barcodes. //! //! Contains tools for loading barcode whitelists, check barcodes against the whitelist //! and correcting sequencing errors in barcodes. #![expect(missing_docs)] use std::fmt; use std::iter::{self, FromIterator}; use std::ops::Deref; use std::str::FromStr; pub mod binned;...
3f35f18bee0e0ee0050294672e9558c2f6a262bd5de716858d1ecc48315d40af
Rust
46,116
1,296
// Copyright (c) 2018 10x Genomics, Inc. All rights reserved. #![expect(missing_docs)] //! Container for the FASTQ data from a single sequencing 'cluster', //! including the primary 'R1' and 'R2' and index 'I1' and 'I2' reads. use crate::read_pair_iter::RecordCount; use crate::{ERROR_CODE_INFO, WhichEnd}; use anyhow:...
e75464c236cdeb1cafea24ec545bbcd8175ff9ac2de76cdaa18884f7f96a2d57
Rust
47,756
1,246
//! Create the web summary and metrics. #![expect(missing_docs)] #![allow(clippy::wildcard_imports)] use super::metrics::MetricTier; use super::websummary_vdj::*; use crate::alert::AlertLevel; use crate::{ Alert, AlertContext, AlertSpec, ChartWithHelp, GenericTable, MakePretty, RawChartWithHelp, Tab, TableRow,...
c6278093239011e01431a6f669304720998cf85d117f4a84a1e56a9faeb9c686
Rust
49,607
1,238
#![expect(missing_docs)] use super::probe_set_reference::TargetSetFile; use crate::probe_set::{ProbeSetReferenceMetadata, is_deprecated_probe, strip_deprecated_prefix}; use crate::reference::reference_info::ReferenceInfo; use crate::{FeatureBarcodeType, FeatureID, FeatureName, GenomeName, LibraryType}; use anyhow::{Con...
b923f86815003586fc56d014c3e21411c854f2e0432cf604016f11d37ed48692
Rust
50,649
1,303
//! Martian stage ALIGN_AND_COUNT #![deny(missing_docs)] use super::write_minimap_index::MinimapIndex; use crate::BcUmiInfoShardFile; use crate::align_and_count_metrics::StageVisitor; use crate::align_metrics::{BarcodeMetrics, LibFeatThenBarcodeOrder}; use crate::aligner::{Align, Aligner, AlignmentOptions, BarcodeSumm...
19fab2ba8722c059487be82ea83d2bb0ab37285a99c9a670ffcf77e58d4635d3
Rust
51,430
1,332
// This is code for a rust-only implementation of stage ASSEMBLE_VDJ. #![expect(missing_docs)] // // ◼ The way we generate a bam file here doesn't make sense. In the current // ◼ implementation, we build sorted bam files, then merge them, which involves // ◼ interweaving the files. It seems like we could avoid the in...
83c9d7a085ddd96d6c42d178f58d9b9f7a97bd3fd6f1478c0d819a9a9ff56bf0
Rust
52,162
1,387
#![expect(missing_docs)] use super::{ AntigenSpecificityRow, FunctionalMapRow, Library, MultiConfigCsv, ProbeBarcodeIterationMode, SampleBarcodeColumn, SampleRow, create_feature_config, multiconst, }; use crate::cmo_set::load_default_cmo_set; use crate::config::{ChemistrySet, PROBE_BARCODE_ID_GROUPING, get_def...
e7fd65e220528293e24cff41ad36b83dd5eafb8c6f464d35e86ebf8a6a073bd6
Rust
54,932
1,575
//! This file contains code to make contigs. #![deny(missing_docs)] #![expect(clippy::many_single_char_names)] // TODO: fix these. #![expect(clippy::needless_range_loop)] use self::equiv::EquivRel; use self::graph_simple::GraphSimple; use self::hyperbase::Hyper; use self::kmer_lookup::make_kmer_lookup_20_single; use c...
e4de03ce619cc33bf60f075ddc7a5b1c22ee04246a7dbb01a6c47a7c33db6d0a
Rust
56,223
1,586
#![expect(missing_docs)] use crate::iter::H5Iterator; use crate::probe_reference_io::ProbeMaybeWithFiltering; use crate::{ ChunkedWriter, ColumnAction, feature_reference_io, probe_reference_io, scalar_attribute, }; use anyhow::{Context, Result, bail}; use barcode::{Barcode, BarcodeContent, MAX_BARCODE_LENGTH}; use ...
d02602b19a02789f2c65d1e00aa53de39ac21d0e69a1d9bca0853d44d0d78cca
Rust
58,832
1,656
//! This file contains code to process a barcode. #![expect(missing_docs)] #![expect(clippy::many_single_char_names)] use crate::barcode_data::BarcodeData; use crate::constants::{CHAIN_NONE_POS, CHAIN_TYPES, CHAIN_TYPESX, PRIMER_EXT_LEN}; use crate::contigs::{MakeContigsResult, make_contigs}; use crate::heuristics::He...
711b13d166014c1e7485a72ae79799f107c97b6d5d9318c0603d8cb7a327d4af
Rust
60,397
1,631
#![expect(missing_docs)] use crate::mark_dups::DupInfo; use crate::transcript::{ AnnotationData, AnnotationParams, AnnotationRegion, PairAnnotationData, TranscriptAnnotator, }; use anyhow::Result; use barcode::BcSeq; use barcode::whitelist::ReqStrand; use cr_bam::bam_tags::{ ANTISENSE_TAG, EXTRA_FLAGS_TAG, Extr...
7545c318864d0114c47e9d6ce28ad4387a96550a218882c4c387041e2a011925
Rust
61,360
1,693
//! Mappings from symbol sample index set names to sample index sequences //! for official 10x sample index plate products. #![expect(missing_docs)] use lazy_static::lazy_static; use std::collections::HashMap; lazy_static! { pub static ref SAMPLE_INDEX_MAP: HashMap<&'static str, [&'static str; 4]> = { let...
89a320990350268d204f101eee1d16b8aba399c58108a26774d53f1fb0f5aea9
Rust
65,630
1,904
//! Martian stage PARSE_AGGR_CSV #![expect(missing_docs)] use crate::errors::{FieldResolutionErrors, ParseAggrCsvErrors}; use anyhow::{Context, Result, bail}; use cr_types::csv_parser::CsvParser; use itertools::Itertools; use martian::prelude::*; use martian_derive::{MartianStruct, MartianType, make_mro}; use martian_...
e384504d1dfc09d846a5ba9669a9b7bc546578e79d45ca7b50ab564668d2f573
Rust
71,955
1,938
//! ReadPair wrapper object for RNA reads from Single Cell 3' and Single Cell 5' / VDJ ibraries. //! Provides access to the barcode and allows for dynamic trimming. #![expect(missing_docs)] use crate::chemistry::{ BarcodeExtraction, BarcodeReadComponent, ChemistryDef, ChemistryName, UmiReadComponent, }; use crate::...
7af3a22e700da3c94b4a411ca37eae7baeb123eda63e62abb83014f55a654c79
Rust
78,988
2,207
#![expect(missing_docs)] use crate::reference::probe_set_reference::{ PROBE_SET_FILE_FORMAT, PROBE_SET_HEADER, TargetSetFile, }; use crate::reference::reference_info::{MULTI_GENOME_SEPARATOR, ReferenceInfo}; use crate::types::{AlignerParam, GenomeName}; use anyhow::{Context, Result, anyhow, bail, ensure}; use bio:...
4777e19aa037e64832efc4b170d4f8197c61c6e01b2edfdfdbc5861e5fda02ee
Rust
84,318
2,530
//! Specification of analysis chemistries. #![deny(missing_docs)] pub mod adapter; mod chemistry_defs; use crate::LibraryType; use anyhow::{Result, bail, ensure}; use barcode::whitelist::{BarcodeId, ReqStrand}; use barcode::{BarcodeConstruct, BcSegSeq, Segments, Whitelist, WhitelistSource, WhitelistSpec}; use chemist...
6bea02dc6d763a3614111e9d76398e005ab0fc162e3d259d859077d6d10f31e2
Rust
105,163
2,699
//! Martian stage DETECT_CHEMISTRY #![deny(missing_docs)] use crate::barcode_overlap::FRPGemBarcodeOverlapRow; use crate::detect_chemistry::adapter_filter::preprocess_units; use crate::detect_chemistry::chemistry_filter::{ ChemistryFilter, DetectChemistryCandidates, DetectChemistryUnit, LoadedUnit, UnitsPerLibrary...
502d27d0b74b44e754374710c06cb87dfdca58b80ca6e564db1c33c7834e09b7
Rust
106,801
2,735
//! Martian stage WRITE_MULTI_WEB_SUMMARY //! Write HTML files for websummaries. #![deny(missing_docs)] use super::parse_multi_config::CellCalling; use crate::cell_annotation_ws_parameters::{ CellAnnotationMetrics, CellTypeWebSummaryBundleValue, WebSummaryCellTypeInputs, generate_cell_type_barchart_from_value,...
b3c9d217f4af6e9881fd31f774febdc79bb0949843d193da0f7ae54948daa878
Rust
132,355
3,641
//! This file contains code to annotate a contig, in the sense of finding alignments //! to VDJ reference contigs. Also to find CDR3 sequences. And some related things. // Copyright (c) 2021 10X Genomics, Inc. All rights reserved. #![expect(missing_docs)] use crate::align::affine_align; use crate::refx::RefData; use...
6e52992a803d86188473c685686fd89758f8ee61bd0e466248b90f2547affe7b
Rust
191,740
5,363
//! Multi config CSV #![deny(missing_docs)] pub(super) mod csv; pub(super) mod parse; pub mod preflight; pub(super) mod scsv; use self::csv::CsvParser; use self::multiconst::FUNCTIONAL_MAP; use self::parse::{ Parse, ParseCtx, parse_prefixed_plate_range, parse_prefixed_range, parse_range, parse_vec, }; use self::p...