|
|
@@ -181,34 +181,8 @@ pub fn create_bam_leave_two_out(input_path: &str) -> anyhow::Result<Vec<PathBuf>
|
|
|
Ok(output_paths)
|
|
|
}
|
|
|
|
|
|
-// pub fn remap_bam(reference: &str, input_seq: &str, output_bam: &str) -> anyhow::Result<()> {
|
|
|
-// duct::cmd!("bwa", "index", reference).run()?;
|
|
|
-// let bwa = format!("bwa mem {reference} {input_seq}");
|
|
|
-// let samtools = "samtools sort /dev/stdin";
|
|
|
-// let pipe = format!("{bwa} | {samtools} > {output_bam}");
|
|
|
-// duct::cmd!("bash", "-c", pipe).run()?;
|
|
|
-// fs::remove_file(format!("{reference}.amb"))?;
|
|
|
-// fs::remove_file(format!("{reference}.ann"))?;
|
|
|
-// fs::remove_file(format!("{reference}.bwt"))?;
|
|
|
-// fs::remove_file(format!("{reference}.pac"))?;
|
|
|
-// fs::remove_file(format!("{reference}.sa"))?;
|
|
|
-//
|
|
|
-// Ok(())
|
|
|
-// }
|
|
|
pub fn remap_bam(reference: &str, input_seq: &str, output_bam: &str) -> anyhow::Result<()> {
|
|
|
info!("Remaping {input_seq} to {reference} into {output_bam}");
|
|
|
- // Index the reference
|
|
|
- // let index_output = Command::new("bwa")
|
|
|
- // .args(["index", reference])
|
|
|
- // .output()
|
|
|
- // .context("Failed to run bwa index")?;
|
|
|
- //
|
|
|
- // if !index_output.status.success() {
|
|
|
- // anyhow::bail!(
|
|
|
- // "bwa index failed: {}",
|
|
|
- // String::from_utf8_lossy(&index_output.stderr)
|
|
|
- // );
|
|
|
- // }
|
|
|
|
|
|
// Prepare the bwa mem command
|
|
|
let mut minimap2_command = Command::new("minimap2");
|