Skip to content

Commit

Permalink
Misc. changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-q committed Dec 2, 2024
1 parent 586285d commit 77b23bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions templates/7_fill_anchors.tera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mkdir -p 7_fill_anchors

log_info "overlap: between anchor-long"

dazz overlap2 \
anchr overlap2 \
--parallel {{ opt.parallel }} \
${FILE_ANCHOR} \
${FILE_LONG} \
Expand All @@ -40,7 +40,7 @@ dazz overlap2 \

cd 7_fill_anchors

CONTIG_COUNT=$(faops n50 -H -N 0 -C anchor.fasta)
CONTIG_COUNT=$(hnsm n50 -H -N 0 -C anchor.fasta)
log_debug "contigs: ${CONTIG_COUNT}"

log_info "group: anchor-long"
Expand Down Expand Up @@ -84,7 +84,7 @@ log_info "Build contigs"
cat \
group/non_grouped.fasta \
group/*.contig.fasta |
faops filter -l 0 -a 1000 stdin contig.fasta
hnsm filter -a 1000 stdin -o contig.fasta

log_info Done.

Expand Down
6 changes: 2 additions & 4 deletions tests/cli_pl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ fn command_overlap2() -> anyhow::Result<()> {
eprintln!("bin = {:#?}", bin);
}

let curdir = std::env::current_dir().unwrap();

let tempdir = tempfile::TempDir::new().unwrap();
assert!(std::env::set_current_dir(&tempdir).is_ok());

let mut cmd = Command::cargo_bin("anchr")?;
let output = cmd
.arg("overlap2")
.arg("tests/ovlpr/1_4.anchor.fasta")
.arg("tests/ovlpr/1_4.pac.fasta")
.arg("-d")
.arg(tempdir.path().display().to_string())
.output()
.unwrap();
let stdout = String::from_utf8(output.stdout).unwrap();
Expand All @@ -97,7 +96,6 @@ fn command_overlap2() -> anyhow::Result<()> {
assert!(&tempdir.path().join("anchorLong.db").is_file());
assert!(&tempdir.path().join("anchorLong.ovlp.tsv").is_file());

assert!(std::env::set_current_dir(&curdir).is_ok());
assert!(tempdir.close().is_ok());

Ok(())
Expand Down

0 comments on commit 77b23bc

Please sign in to comment.