Dataset Viewer
Auto-converted to Parquet Duplicate
repo_name
stringclasses
1 value
path
stringlengths
27
72
content
stringlengths
19
51.7k
license
stringclasses
1 value
rust-bio-tools
./rust-bio-tools/tests/lib.rs
use bio::io::fastq;\nuse rust_htslib::bam;\nuse rust_htslib::bam::Read;\nuse std::fs;\nuse std::process::Command;\n\n/// Compare an output file to the expected output and delete the output file.\nfn test_output(result: &str, expected: &str) {\n assert!(Command::new('cmp')\n .arg(result)\n .arg(expected...
mit
rust-bio-tools
./rust-bio-tools/src/bam/depth.rs
//! Compute the depth of coverage in a BAM file for a list of reference sequences and positions.\n//!\n//! ## Input:\n//! A BAM file and a positions file.\n//! The positions file contains the name of one reference sequence and one position per line (tab separated).\n//! Example:\n//! ```\n//! 16 1\n//! 17 1\n//! ...
mit
rust-bio-tools
./rust-bio-tools/src/bam/plot/plot_bam.rs
use crate::bcf::report::table_report::create_report_table::create_report_data;\nuse crate::bcf::report::table_report::create_report_table::manipulate_json;\nuse crate::common::Region;\nuse anyhow::Result;\nuse chrono::{DateTime, Local};\nuse itertools::Itertools;\nuse std::io;\nuse std::io::Write;\nuse std::path::Path;...
mit
rust-bio-tools
./rust-bio-tools/src/bam/plot/mod.rs
pub mod plot_bam;\n
mit
rust-bio-tools
./rust-bio-tools/src/bam/anonymize_reads.rs
use anyhow::Result;\nuse bio::io::fasta;\nuse rand::prelude::{SliceRandom, ThreadRng};\nuse rand::seq::IteratorRandom;\nuse rust_htslib::bam;\nuse rust_htslib::bam::Read;\nuse std::collections::HashMap;\nuse std::ops::Range;\nuse std::path::Path;\nuse uuid::Uuid;\n\npub fn anonymize_reads<P: AsRef<Path> + std::fmt::Deb...
mit
rust-bio-tools
./rust-bio-tools/src/bam/collapse_reads_to_fragments/calc_consensus.rs
use crate::common::CalcConsensus;\nuse bio::io::fastq;\nuse bio::stats::probs::LogProb;\nuse bio_types::sequence::SequenceRead;\nuse bio_types::sequence::SequenceReadPairOrientation;\nuse derive_new::new;\nuse itertools::Itertools;\nuse rust_htslib::bam;\nuse rust_htslib::bam::record::Aux;\nuse std::collections::{HashM...
mit
rust-bio-tools
./rust-bio-tools/src/bam/collapse_reads_to_fragments/pipeline.rs
use super::calc_consensus::{CalcNonOverlappingConsensus, CalcOverlappingConsensus};\nuse super::unmark_record;\nuse anyhow::Result;\nuse bio::io::fastq;\nuse derive_new::new;\nuse rust_htslib::bam;\nuse rust_htslib::bam::record::Aux;\nuse rust_htslib::bam::Read;\nuse std::cmp::Ordering;\nuse std::collections::{BTreeMap...
mit
rust-bio-tools
./rust-bio-tools/src/bam/collapse_reads_to_fragments/mod.rs
mod calc_consensus;\nmod pipeline;\n\nuse anyhow::Result;\nuse bio::io::fastq;\nuse log::info;\nuse pipeline::CallConsensusRead;\nuse rust_htslib::bam;\nuse rust_htslib::bam::{Format, Header, Read};\nuse std::path::Path;\n\npub fn call_consensus_reads_from_paths<P: AsRef<Path>>(\n bam_in: P,\n fq1: P,\n fq2: P...
mit
rust-bio-tools
./rust-bio-tools/src/bam/mod.rs
//! Tools that work on BAM files\npub mod anonymize_reads;\npub mod collapse_reads_to_fragments;\npub mod depth;\npub mod plot;\n
mit
rust-bio-tools
./rust-bio-tools/src/common.rs
use anyhow::Context;\nuse approx::relative_eq;\nuse bio::stats::probs::{LogProb, PHREDProb};\nuse bio_types::sequence::SequenceRead;\nuse itertools::Itertools;\nuse ordered_float::NotNaN;\nuse std::cmp;\nuse std::collections::HashMap;\nuse std::str::FromStr;\n\nconst PROB_CONFUSION: LogProb = LogProb(-1.098612288668109...
mit
rust-bio-tools
./rust-bio-tools/src/fastq/split.rs
//! Split reads from stdin up into the given files.\n//!\n//! ## Usage:\n//!\n//! Distribute reads from `test.fastq` into the files `A.fastq` and `B.fastq`.\n//! ```bash\n//! $ rbt fastq-split A.fastq B.fastq < test.fastq\n//! ```\n//!\nuse anyhow::Result;\nuse bio::io::fastq;\nuse bio::io::fastq::FastqRead;\nuse log::...
mit
rust-bio-tools
./rust-bio-tools/src/fastq/collapse_reads_to_fragments/calc_consensus.rs
use crate::common::CalcConsensus;\nuse bio::io::fastq;\nuse bio::stats::probs::LogProb;\nuse derive_new::new;\nuse itertools::Itertools;\n\nconst ALLELES: &[u8] = b'ACGT';\n\n/// Compute a maximum likelihood fragment sequence for a collection of FASTQ reads.\n///\n/// For each position, compute the likelihood of each a...
mit
rust-bio-tools
./rust-bio-tools/src/fastq/collapse_reads_to_fragments/pipeline.rs
use anyhow::Result;\nuse bio::io::fastq;\nuse bio::io::fastq::{FastqRead, Record};\nuse bio::stats::probs::LogProb;\nuse derive_new::new;\nuse ordered_float::NotNaN;\nuse rgsl::randist::gaussian::ugaussian_P;\nuse rocksdb::DB;\nuse std::io;\nuse std::io::Write;\nuse std::mem;\nuse std::process::{Command, Stdio};\nuse s...
mit
rust-bio-tools
./rust-bio-tools/src/fastq/collapse_reads_to_fragments/mod.rs
//! Tool to merge sets of reads in paired FASTQ files that share the UMI and have similar read sequence.\n//! The result is a maximum likelihood fragment sequence per set.\n//!\n//! This tool takes two FASTQ files (forward and reverse)\n//! and returns two FASTQ files in which all PCR duplicates\n//! have been merged i...
mit
rust-bio-tools
./rust-bio-tools/src/fastq/mod.rs
//! Tools that work on FASTQ files\npub mod collapse_reads_to_fragments;\npub mod filter;\npub mod split;\n
mit
rust-bio-tools
./rust-bio-tools/src/fastq/filter.rs
//! Filter reads matching names in a text file into a new FASTQ file.\n//!\n//! ## Usage:\n//!\n//! Extract the read with identifier `A` from `test.fastq` into a new file `filtered.fastq`\n//! ```bash\n//! $ cat ids.txt\n//! A\n//!\n//! $ cat test.fastq\n//! @A\n//! ACTCTATCTA\n//! +\n//! !!!!!!!!!!\n//! @B\n//! CTCTAT...
mit
rust-bio-tools
./rust-bio-tools/src/sequences_stats.rs
//! Compute statics on sequences from stdin:\n//! - min: length of shortest sequence\n//! - max: length of longest sequence\n//! - average: average length of sequence\n//! - median: median length of sequence\n//! - nb_reads: number of reads\n//! - nb_bases: number of bases\n//! - n50: N50 of sequences\n//...
mit
rust-bio-tools
./rust-bio-tools/src/cli.rs
use crate::common::Region;\nuse std::path::PathBuf;\nuse structopt::StructOpt;\n\n#[derive(StructOpt)]\n#[structopt(\n about = 'A set of ultra-fast command line utilities for bioinformatics tasks based on Rust-Bio.',\n author = 'Johannes Köster <johannes.koester@tu-dortmund.de>',\n name = 'Rust-Bio-Tools'\n)]\...
mit
rust-bio-tools
./rust-bio-tools/src/csv/report.rs
use crate::bcf::report::oncoprint::WriteErr;\nuse anyhow::Context as AnyhowContext;\nuse anyhow::Result;\nuse chrono::{DateTime, Local};\nuse derive_new::new;\nuse itertools::Itertools;\nuse lz_str::compress_to_utf16;\nuse serde_derive::Serialize;\nuse serde_json::json;\nuse std::collections::{HashMap, HashSet};\nuse s...
mit
rust-bio-tools
./rust-bio-tools/src/csv/mod.rs
//! Tools that work on CSV files.\npub mod report;\n
mit
rust-bio-tools
./rust-bio-tools/src/main.rs
//! Documentation for Rust Bio Tools\nuse anyhow::{Context, Result};\nuse itertools::Itertools;\nuse log::LevelFilter;\nuse rayon::prelude::*;\nuse std::collections::HashMap;\nuse std::fs;\nuse std::path::Path;\nuse structopt::StructOpt;\n\nuse cli::Command::*;\n\npub mod bam;\npub mod bcf;\nmod cli;\npub mod common;\n...
mit
rust-bio-tools
./rust-bio-tools/src/bcf/split.rs
use std::collections::HashMap;\nuse std::path::Path;\n\nuse anyhow::Context;\nuse anyhow::Result;\nuse itertools::Itertools;\nuse rust_htslib::bcf;\nuse rust_htslib::bcf::Read;\n\npub fn split<P: AsRef<Path>>(input_bcf: P, output_bcfs: &[P]) -> Result<()> {\n let n_records = bcf::Reader::from_path(input_bcf.as_ref()...
mit
End of preview. Expand in Data Studio
git clone https://github.com/rust-bio/rust-bio-tools

rm -f RustBioGPT-validate.csv && for i in `find . -name "*.rs"`;do paste -d "," <(echo "rust-bio-tools"|perl -pe "s/(.+)/\"\1\"/g") <(echo $i|perl -pe "s/(.+)/\"\1\"/g") <(perl -pe "s/\n/\\\n/g" $i|perl -pe s"/\"/\'/g" |perl -pe "s/(.+)/\"\1\"/g") <(echo "mit"|perl -pe "s/(.+)/\"\1\"/g") >> RustBioGPT-validate.csv; done

sed -i '1i "repo_name","path","content","license"' RustBioGPT-validate.csv
Downloads last month
9