Function fasten_inspect::main [−][src]
pub(crate) fn main()
diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index b7fadf39..cd703e51 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -17,5 +17,8 @@ jobs: - uses: actions-rs/cargo@v1 with: command: build - args: --release --all-features + #args: --release --all-features + - name: tests + run: | + for i in tests/fasten_*.sh; do echo $i; echo ===; bash $i; echo; done; diff --git a/docs/fasten_inspect/fn.main.html b/docs/fasten_inspect/fn.main.html index d4a732e6..a18c21c0 100644 --- a/docs/fasten_inspect/fn.main.html +++ b/docs/fasten_inspect/fn.main.html @@ -1,4 +1,4 @@
pub(crate) fn main()
pub(crate) fn main()
marks up reads from stdin
+Marks up your reads with useful information like read length
-cat file.fastq | fasten_validate > markedup.fastq
-cat file.fastq | fasten_validate --paired-end > markedup-paired.fastq
Usage: fasten_validate [-h] [-n INT] [-p] [--verbose] [--version] [--paired-end]
+ Crate fasten_inspect
Version 0.6.0
Crate fasten_inspect[−][src]
Expand description
Marks up your reads with useful information like read length
+Examples
Quick validation with stderr message
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
+@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
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
+ -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:
key type example note
-id-at boolean (1 or 0) id-at:1
-seq-invalid-chars string seq-invalid-chars:‘$$%’
-qual-invalid-chars string qual-invalid-chars:‘[]’
+id-at boolean (1 or 0) id-at:1 Whether or not the @
was first character, first line
+seq-invalid-chars string seq-invalid-chars:$$%
+qual-invalid-chars string qual-invalid-chars:[<
seq-length int seq-length:100
-id-plus boolean id-plus:1 Whether or not the plus sign was found on 3rd line
+id-plus boolean id-plus:1 Whether or not the +
was first character, 3rd line
avg-qual float avg-qual:17.52
qual-length int qual-length:100 Length of the quality score line
Functions
-
marks up reads from stdin
+pub(crate) fn main()
pub(crate) fn main()
pub(crate) fn repair_one_read(
id: String,
seq: String,
plus: String,
qual: String,
should_repair: bool,
min_length: usize,
min_qual: f32,
remove_info: bool
) -> (String, bool, String)
Repair exactly one read
+pub(crate) fn repair_reads(
paired_end: bool,
min_length: usize,
min_qual: f32,
remove_info: bool,
mode: &str
)
Repairs reads depending on the deflines by calling repair_one_read
+Repairs reads from fasten_inspect output
-./target/debug/fasten_inspect < testdata/four_reads.fastq | ./target/debug/fasten_repair
+ Crate fasten_repair
Version 0.6.0
Crate fasten_repair[−][src]
Expand description
Repairs reads from fasten_inspect output
+Examples
./target/debug/fasten_inspect < testdata/four_reads.fastq | \
+ ./target/debug/fasten_repair --remove-info > repaired.fastq
If remove-info is given, then extra header information from fasten_inspect will be removed.
Usage
Usage: fasten_repair [-h] [-n INT] [-p] [--verbose] [--version] [--min-length INT] [--min-quality FLOAT] [--remove-info] [-m STRING]
@@ -21,6 +22,8 @@ Usage
If you choose --mode repair
, then this is the expected behavior
- Mismatched seq and qual lengths: seq or qual length will be truncated
+- R1 or R2 not passing: then the other (R1 or R2) will also not pass and they will not be
+printed.
Panic
If the sequences are not repaired but there is still an issue, the program might still panic:
@@ -34,5 +37,6 @@ Panic
Functions
+Repairs reads depending on the deflines by calling repair_one_read
+
//! Marks up your reads with useful information like read length
//!
//! # Examples
//!
//! ## 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:
//!
-//! | key | type | example | note |
-//! | --- | --- | --- | ----- |
-//! | id-at | boolean (1 or 0) | id-at:1 | |
-//! | seq-invalid-chars | string | seq-invalid-chars:'$$%' | |
-//! | qual-invalid-chars | string | qual-invalid-chars:'[]' | |
-//! | seq-length | int | seq-length:100 | |
-//! | id-plus | boolean | id-plus:1 | Whether or not the plus sign was found on 3rd line |
-//! | avg-qual | float | avg-qual:17.52 | |
-//! | qual-length | int | qual-length:100 | Length of the quality score line |
+//!| key | type | example | note |
+//!| --- | ----- | ------- | ------ |
+//!| id-at | boolean (1 or 0) | id-at:1 | Whether or not the `@` was first character, first line |
+//!| seq-invalid-chars | string | seq-invalid-chars:$$% | |
+//!| qual-invalid-chars | string | qual-invalid-chars:[< | |
+//!| seq-length | int | seq-length:100 | |
+//!| id-plus | boolean | id-plus:1 | Whether or not the `+` was first character, 3rd line |
+//!| avg-qual | float | avg-qual:17.52 | |
+//!| qual-length | int | qual-length:100 | Length of the quality score line |
+//!
//!
// TODO add points that were validated into the sequence deflines: length, is-paired, seq-regex=1, and anything else
@@ -247,6 +268,7 @@
}
}
+/// 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);
diff --git a/docs/src/fasten_repair/fasten_repair.rs.html b/docs/src/fasten_repair/fasten_repair.rs.html
index ae4a6220..4ded83c9 100644
--- a/docs/src/fasten_repair/fasten_repair.rs.html
+++ b/docs/src/fasten_repair/fasten_repair.rs.html
@@ -309,11 +309,18 @@
307
308
309
+310
+311
+312
+313
+314
//! 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
//!
//! ```
//!
@@ -343,6 +350,8 @@
//! If you choose `--mode repair`, then this is the expected behavior
//!
//! * Mismatched seq and qual lengths: seq or qual length will be truncated
+//! * R1 or R2 not passing: then the other (R1 or R2) will also not pass and they will not be
+//! printed.
//!
//! # Panic
//!
@@ -413,6 +422,7 @@
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 = {
diff --git a/src/bin/fasten_inspect.rs b/src/bin/fasten_inspect.rs
index 5ae10630..5b42470e 100644
--- a/src/bin/fasten_inspect.rs
+++ b/src/bin/fasten_inspect.rs
@@ -32,15 +32,16 @@
//!
//! The fields will be found on the defline of the sequence and include:
//!
-//! | key | type | example | note |
-//! | --- | --- | --- | ----- |
-//! | id-at | boolean (1 or 0) | id-at:1 | |
-//! | seq-invalid-chars | string | seq-invalid-chars:'$$%' | |
-//! | qual-invalid-chars | string | qual-invalid-chars:'[]' | |
-//! | seq-length | int | seq-length:100 | |
-//! | id-plus | boolean | id-plus:1 | Whether or not the plus sign was found on 3rd line |
-//! | avg-qual | float | avg-qual:17.52 | |
-//! | qual-length | int | qual-length:100 | Length of the quality score line |
+//!| key | type | example | note |
+//!| --- | ----- | ------- | ------ |
+//!| id-at | boolean (1 or 0) | id-at:1 | Whether or not the `@` was first character, first line |
+//!| seq-invalid-chars | string | seq-invalid-chars:$$% | |
+//!| qual-invalid-chars | string | qual-invalid-chars:[< | |
+//!| seq-length | int | seq-length:100 | |
+//!| id-plus | boolean | id-plus:1 | Whether or not the `+` was first character, 3rd line |
+//!| avg-qual | float | avg-qual:17.52 | |
+//!| qual-length | int | qual-length:100 | Length of the quality score line |
+//!
//!
// TODO add points that were validated into the sequence deflines: length, is-paired, seq-regex=1, and anything else
diff --git a/src/bin/fasten_repair.rs b/src/bin/fasten_repair.rs
index 9cd52f30..ce30c319 100644
--- a/src/bin/fasten_repair.rs
+++ b/src/bin/fasten_repair.rs
@@ -31,20 +31,22 @@
//!
//! # Methods of repair
//!
+//! # Repair mode
+//!
//! If you choose `--mode repair`, then this is the expected behavior
//!
//! * Mismatched seq and qual lengths: seq or qual length will be truncated
+//! * R1 or R2 not passing: then the other (R1 or R2) will also not pass and they will not be
+//! printed.
//!
-//! # Panic
-//!
-//! If the sequences are not repaired but there is still an issue, the program might still panic:
+//! # Panic mode
//!
-//! * seq length < min length (TODO when implementing PE reads)
-//! * avg qual < min qual (TODO when implementing PE reads)
-//! * invalid characters in seq (TODO when implementing PE reads)
-//! * invalid characters in qual (TODO when implementing PE reads)
-//! * `@` not present in first character of the entry (TODO when implementing PE reads)
-//! * `+` not present in the first character of the third line (TODO when implementing PE reads)
+//! * seq length < min length
+//! * avg qual < min qual
+//! * invalid characters in seq
+//! * invalid characters in qual
+//! * `@` not present in first character of the entry
+//! * `+` not present in the first character of the third line
//!
extern crate getopts;