Skip to content

Commit

Permalink
Update dazzname.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-q committed Dec 2, 2024
1 parent afd6b2d commit 5831407
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cmd/dazzname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ pub fn execute(args: &ArgMatches) -> anyhow::Result<()> {

let outfile = args.get_one::<String>("outfile").unwrap();
let mut fa_out = fasta::Writer::new(intspan::writer(outfile));
let mut writer_rplc = intspan::writer(&format!("{}.replace.tsv", outfile));

let opt_prefix = args.get_one::<String>("prefix").unwrap();
let mut opt_start = *args.get_one::<usize>("start").unwrap();

let mut rplc_lines = vec![];

//----------------------------
// Ops
//----------------------------
Expand Down Expand Up @@ -85,12 +86,19 @@ pub fn execute(args: &ArgMatches) -> anyhow::Result<()> {
.expect("Write fasta file failed");

if !is_no_replace {
writer_rplc.write_fmt(format_args!("{}\t{}\n", name_new, name))?;
rplc_lines.push(format!("{}\t{}", name_new, name));
}

opt_start += 1;
}
}

if !is_no_replace {
intspan::write_lines(
&format!("{}.replace.tsv", outfile),
&rplc_lines.iter().map(AsRef::as_ref).collect(),
)?;
}

Ok(())
}

0 comments on commit 5831407

Please sign in to comment.