Skip to content

Commit

Permalink
extra documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lskatz committed Oct 14, 2023
1 parent 96e1b91 commit 95b8e14
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
28 changes: 19 additions & 9 deletions src/bin/fasten_inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,30 @@
//!
//! ## Quick validation with stderr message
//! ```bash
//! cat file.fastq | fasten_validate > markedup.fastq
//! cat file.fastq | fasten_validate --paired-end > markedup-paired.fastq
//! cat file.fastq | fasten_inspect > markedup.fastq
//! cat file.fastq | fasten_inspect --paired-end > markedup-paired.fastq
//! ```
//!
//! The resulting marked-up fastq file will have deflines like
//!
//! ```text
//! @read0/1 id-at:1 seq-length:100 seq-invalid-chars: id-plus:1 qual-invalid-chars: avg-qual:20.93 qual-length:100 read-pair:1
//! ```
//!
//! # Usage
//!
//! ```text
//! Usage: fasten_validate [-h] [-n INT] [-p] [--verbose] [--version] [--paired-end]
//!fasten_inspect: Marks up your reads with useful information like read length
//!
//!Usage: fasten_inspect [-h] [-n INT] [-p] [--verbose] [--version]
//!
//!Options:
//! -h, --help Print this help menu.
//! -n, --numcpus INT Number of CPUs (default: 1)
//! -p, --paired-end The input reads are interleaved paired-end
//! --verbose Print more status messages
//! --version Print the version of Fasten and exit
//!
//! Options:
//! -h, --help Print this help menu.
//! -n, --numcpus INT Number of CPUs (default: 1)
//! -p, --paired-end The input reads are interleaved paired-end
//! --verbose Print more status messages
//! --version Print the version of Fasten and exit
//! ```
//!
//! The fields will be found on the defline of the sequence and include:
Expand Down Expand Up @@ -77,6 +86,7 @@ fn main(){
}
}

/// marks up reads from stdin
fn validate_reads(lines_per_read: u8, seq_regex: regex::Regex, qual_regex: regex::Regex) {
let my_file = File::open("/dev/stdin").expect("Could not open file");
let mut my_buffer = BufReader::new(my_file);
Expand Down
5 changes: 4 additions & 1 deletion src/bin/fasten_repair.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Repairs reads from fasten_inspect output
//!
//! # Examples
//!
//! ```bash
//! ./target/debug/fasten_inspect < testdata/four_reads.fastq | ./target/debug/fasten_repair
//! ./target/debug/fasten_inspect < testdata/four_reads.fastq | \
//! ./target/debug/fasten_repair --remove-info > repaired.fastq
//!
//! ```
//!
Expand Down Expand Up @@ -102,6 +104,7 @@ fn main(){
repair_reads(paired_end, min_length, min_qual, remove_info, &mode);
}

/// Repairs reads depending on the deflines by calling repair_one_read
fn repair_reads(paired_end:bool, min_length: usize, min_qual: f32, remove_info: bool, mode: &str) {
//behavior
let should_repair :bool = {
Expand Down

0 comments on commit 95b8e14

Please sign in to comment.