diff --git a/Cargo.lock b/Cargo.lock index 16b97bd..ed5a0b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -544,7 +544,7 @@ dependencies = [ ] [[package]] -name = "yarcd" +name = "yacrd" version = "0.3.0" dependencies = [ "bio 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 06476b6..9edfde5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,23 @@ [package] -name = "yarcd" +name = "yacrd" version = "0.3.0" authors = ["Pierre Marijon "] +exclude = ["image/*", "validation/*", "tests/*"] + +description = "Using all-against-all read mapping, yacrd performs: computation of pile-up coverage for each read and detection of chimeras" +#documentation = "https://github.com/natir/yacrd" +homepage = "https://github.com/natir/yacrd" +repository = "https://github.com/natir/yacrd" +readme = "Readme.md" +license = "MIT" +keywords = ["bioinformatics", "chimera", "long-read"] + +[badges] +travis-ci = { repository = "natir/yacrd", branch = "master" } + [dependencies] -bio = "*" +bio = "0.21" csv = "1" xz2 = "0.1" clap = "2.31.2" @@ -14,3 +27,7 @@ flate2 = "1.0" rust-lzma = "0.2" lazy_static = "1.0" serde_derive = "1.0" + +[[bin]] +name = "yacrd" +path = "src/main.rs" diff --git a/Readme.md b/Readme.md index 306bef3..92c2899 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,7 @@ # Yet Another Chimeric Read Detector for long reads +[![Build Status](https://travis-ci.org/natir/yacrd.svg?branch=master)](https://travis-ci.org/natir/yacrd) + ![yacrd pipeline presentation](image/pipeline.svg) Using all-against-all read mapping, yacrd performs: @@ -21,7 +23,7 @@ DAStrim (from the [DASCRUBBER suite](https://github.com/thegenemyers/DASCRUBBER) ## Input -Any set of long reads (PacBio, Nanopore, anything that can be given to [https://github.com/lh3/minimap2](minimap2) ). +Any set of long reads (PacBio, Nanopore, anything that can be given to [minimap2](https://github.com/lh3/minimap2) ). yacrd takes the resulting PAF (Pairwise Alignement Format) from minimap2 or MHAP file from some other long reads overlapper as input. ## Requirements @@ -30,9 +32,17 @@ yacrd takes the resulting PAF (Pairwise Alignement Format) from minimap2 or MHAP ## Instalation +### With cargo + +If you have a rust environment setup you can run : + +``` +cargo install yacrd +``` + ### With conda -yacrd are avaible in [bioconda channel](https://bioconda.github.io/) +yacrd is avaible in [bioconda channel](https://bioconda.github.io/) if bioconda channel is setup you can run : @@ -58,7 +68,7 @@ cargo install 2) ``` -yacrd 0.3 Mew +yacrd 0.3 Ninetales Pierre Marijon Yet Another Chimeric Read Detector @@ -81,7 +91,7 @@ OPTIONS: Mapping input file in PAF or MHAP format (with .paf or .mhap extension), use - for read standard input (no compression allowed, paf format by default) [default: -] -o, --output - Path where yacrd report are write, use - for write in standard output same compression as input or use + Path where yacrd report are writen, use - for write in standard output same compression as input or use --compression-out [default: -] -f, --filter ... File containing reads that will be filtered (fasta|fastq|mhap|paf), new file are create like @@ -91,7 +101,7 @@ OPTIONS: Overlap depth threshold below which a gap should be created [default: 0] -n, --not-covered-threshold - Coverage depth threshold above which a read are mark as not covered [default: 0.80] + Coverage depth threshold above which a read are marked as not covered [default: 0.80] --filtered-suffix Change the suffix of file generate by filter option [default: _filtered] diff --git a/src/main.rs b/src/main.rs index f80e614..f38408c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ use std::collections::HashSet; fn main() { let matches = App::new("yacrd") - .version("0.3 Mew") + .version("0.3 Ninetales") .author("Pierre Marijon ") .about("Yet Another Chimeric Read Detector") .usage("yacrd [-i|--input] [-o|--output] [-f|--filter] @@ -75,7 +75,7 @@ fn main() { .display_order(2) .takes_value(true) .default_value("-") - .help("Path where yacrd report are write, use - for write in standard output same compression as input or use --compression-out") + .help("Path where yacrd report are writen, use - for write in standard output same compression as input or use --compression-out") ) .arg(Arg::with_name("filter") .short("f") @@ -107,7 +107,7 @@ fn main() { .takes_value(true) .default_value("0.80") .long("not-covered-threshold") - .help("Coverage depth threshold above which a read are mark as not covered") + .help("Coverage depth threshold above which a read are marked as not covered") ) .arg(Arg::with_name("filtered-suffix") .display_order(7) diff --git a/tests/data/test.yacrd b/tests/data/test.yacrd deleted file mode 100644 index 8b3cdda..0000000 --- a/tests/data/test.yacrd +++ /dev/null @@ -1,2 +0,0 @@ -Chimeric 1 10000 2000,0,2000;1000,4500,5500;2000,8000,10000 -Chimeric 4 6000 1000,2500,3500 diff --git a/tests/data/test.yacrd.gz b/tests/data/test.yacrd.gz deleted file mode 100644 index f8d0cd5..0000000 Binary files a/tests/data/test.yacrd.gz and /dev/null differ diff --git a/tests/data/test_filtered.fasta b/tests/data/test_filtered.fasta deleted file mode 100644 index a63f987..0000000 --- a/tests/data/test_filtered.fasta +++ /dev/null @@ -1,2 +0,0 @@ ->5 -ACTG diff --git a/tests/not_run.rs b/tests/not_run.rs index 27ebdbb..63bcabd 100644 --- a/tests/not_run.rs +++ b/tests/not_run.rs @@ -22,7 +22,7 @@ SOFTWARE. use std::process::Command; -static HELP_MESSAGE: &'static str = "yacrd 0.3 Mew +static HELP_MESSAGE: &'static str = "yacrd 0.3 Ninetales Pierre Marijon Yet Another Chimeric Read Detector @@ -45,7 +45,7 @@ OPTIONS: Mapping input file in PAF or MHAP format (with .paf or .mhap extension), use - for read standard input (no compression allowed, paf format by default) [default: -] -o, --output - Path where yacrd report are write, use - for write in standard output same compression as input or use + Path where yacrd report are writen, use - for write in standard output same compression as input or use --compression-out [default: -] -f, --filter ... File containing reads that will be filtered (fasta|fastq|mhap|paf), new file are create like @@ -55,7 +55,7 @@ OPTIONS: Overlap depth threshold below which a gap should be created [default: 0] -n, --not-covered-threshold - Coverage depth threshold above which a read are mark as not covered [default: 0.80] + Coverage depth threshold above which a read are marked as not covered [default: 0.80] --filtered-suffix Change the suffix of file generate by filter option [default: _filtered] @@ -72,18 +72,18 @@ mod not_run { #[test] fn version() { - let output = Command::new("./target/debug/yarcd") + let output = Command::new("./target/debug/yacrd") .arg("-V") .output() .expect("Could not run yacrd"); - assert_eq!(output.stdout, b"yacrd 0.3 Mew\n"); + assert_eq!(output.stdout, b"yacrd 0.3 Ninetales\n"); println!("{:?}", output); } #[test] fn help() { - let output = Command::new("./target/debug/yarcd") + let output = Command::new("./target/debug/yacrd") .arg("-h") .output() .expect("Could not run yacrd"); @@ -93,7 +93,7 @@ mod not_run { #[test] fn no_argument() { - let output = Command::new("./target/debug/yarcd") + let output = Command::new("./target/debug/yacrd") .output() .expect("Could not run yacrd"); diff --git a/tests/realistic_scenario.rs b/tests/realistic_scenario.rs index d3c5398..53e8635 100644 --- a/tests/realistic_scenario.rs +++ b/tests/realistic_scenario.rs @@ -35,7 +35,7 @@ mod realistic_scenario { #[test] fn default() { - let child = Command::new("./target/debug/yarcd") + let child = Command::new("./target/debug/yacrd") .stdin(Stdio::from(fs::File::open("tests/data/test.paf").unwrap())) .stdout(Stdio::piped()) .spawn() @@ -49,7 +49,7 @@ mod realistic_scenario { #[test] fn file_mhap_gz_out_same_paf_default_default() { - let child = Command::new("./target/debug/yarcd") + let child = Command::new("./target/debug/yacrd") .arg("-i") .arg("tests/data/test.mhap.gz") .arg("-F") @@ -81,7 +81,7 @@ Chimeric 1 10000 2000,0,2000;1000,4500,5500;2000,8000,10000 "; let good: HashSet<&str> = expected.split("\n").collect(); - Command::new("./target/debug/yarcd") + Command::new("./target/debug/yacrd") .arg("-i") .arg("-") .arg("-o") @@ -92,7 +92,7 @@ Chimeric 1 10000 2000,0,2000;1000,4500,5500;2000,8000,10000 fs::File::open("tests/data/test_cov_1.paf").unwrap(), )) .stdout(Stdio::piped()) - .spawn() + .output() .expect("Could ot run yacrd"); assert_eq!( @@ -113,7 +113,7 @@ Not_covered 3 10000 5500,4500,10000 "; let good: HashSet<&str> = expected.split("\n").collect(); - let child = Command::new("./target/debug/yarcd") + let child = Command::new("./target/debug/yacrd") .arg("-i") .arg("tests/data/test.paf.bz2") .arg("-o") @@ -169,7 +169,7 @@ Chimeric 1 10000 2000,0,2000;1000,4500,5500;2000,8000,10000 let good: HashSet<&str> = expected.split("\n").collect(); - Command::new("./target/debug/yarcd") + Command::new("./target/debug/yacrd") .arg("-i") .arg("tests/data/test_cov_1.mhap.xz") .arg("-o") @@ -184,7 +184,7 @@ Chimeric 1 10000 2000,0,2000;1000,4500,5500;2000,8000,10000 .arg("tests/data/test.fasta") .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .spawn() + .output() .expect("Could not run yacrd"); {