Skip to content

Commit

Permalink
Fix tests, change command line call parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
olliecheng committed Jan 2, 2025
1 parent 05c4054 commit 89c306f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub enum Commands {
preset: crate::preset::PresetBarcodeFormats,

/// the output index file
#[arg(long, default_value = "index.tsv")]
index: String,
#[arg(short, default_value = "index.tsv")]
output: String,

/// whether to use a file containing pre-clustered reads, with every line in one of two formats:
/// 1. READ_ID;BARCODE
Expand Down Expand Up @@ -94,7 +94,7 @@ pub enum Commands {
index: String,

/// output file
#[arg(long, default_value = "summary.html")]
#[arg(short, default_value = "summary.html")]
output: String,
},

Expand All @@ -109,8 +109,8 @@ pub enum Commands {
#[arg(long)]
input: String,

/// the output .fasta; note that quality values are not preserved
#[arg(long)]
/// the output .fastq
#[arg(short)]
output: Option<String>,

/// the number of threads to use
Expand All @@ -137,7 +137,7 @@ pub enum Commands {
#[arg(long)]
input: String,

#[arg(long)]
#[arg(short)]
output: Option<String>,
},
}
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn try_main() -> Result<()> {
}
Commands::Index {
file,
index,
output,
preset,
barcode_regex,
clusters,
Expand All @@ -93,13 +93,14 @@ fn try_main() -> Result<()> {

index::construct_index(
file,
index,
output,
&barcode_regex,
*skip_unmatched,
clusters,
filter_opts,
)?;
info!("Completed index generation to {index}");

info!("Completed index generation to {output}");
}
Commands::Call {
index,
Expand Down
6 changes: 3 additions & 3 deletions tests/correct/consensus.fastq

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/correct/index.tsv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#{"nailpolish_version":"0.1.0","file_path":"/Users/olliecheng/Developer/WEHI/consensus-call/nailpolish/tests/data/scmixology2_sample.fastq","index_date":"2025-01-02T10:46:32.316021+08:00","elapsed":0.526168292,"gb":0.02817634679377079,"matched_read_count":14142,"unmatched_read_count":0,"read_count":14143,"avg_qual":21274.992292462168,"avg_len":1009.505232640362,"filtered_reads":1}
#{"nailpolish_version":"0.1.0","file_path":"/Users/olliecheng/Developer/WEHI/consensus-call/nailpolish/tests/data/scmixology2_sample.fastq","index_date":"2025-01-02T10:50:28.741895+08:00","elapsed":0.023255041,"gb":0.02817634679377079,"matched_read_count":14142,"unmatched_read_count":0,"read_count":14143,"avg_qual":21274.992292462168,"avg_len":1009.505232640362,"filtered_reads":1}
id pos avg_qual n_bases rec_len
TCTGGCTCATTCTCCG_GCAGCGAAGCCC 0 19.47 593 1264
GCACTAAGTTGAAGTA_ATCAATGTATTG 1264 9.52 1655 3388
Expand Down
13 changes: 4 additions & 9 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ fn index() {
let mut command = Command::cargo_bin("nailpolish").unwrap();

let _ = command
.args(&[
"index",
SAMPLE_FASTQ,
"--index",
temp.path().to_str().unwrap(),
])
.args(&["index", SAMPLE_FASTQ, "-o", temp.path().to_str().unwrap()])
.assert()
.success();

Expand All @@ -43,7 +38,7 @@ fn summary() {
"summary",
"--index",
"tests/correct/index.tsv",
"--output",
"-o",
temp.path().to_str().unwrap(),
])
.assert()
Expand All @@ -65,7 +60,7 @@ fn consensus_1t() {
"tests/correct/index.tsv",
"--input",
SAMPLE_FASTQ,
"--output",
"-o",
temp.path().to_str().unwrap(),
"--threads",
"1",
Expand Down Expand Up @@ -94,7 +89,7 @@ fn consensus_4t() {
"tests/correct/index.tsv",
"--input",
SAMPLE_FASTQ,
"--output",
"-o",
temp.path().to_str().unwrap(),
"--threads",
"4",
Expand Down

0 comments on commit 89c306f

Please sign in to comment.