fn samtools_sort(result_dir: &str) {
    let input_file = format!("{}/fixed_alignments.bam", result_dir);
    let output_file = format!("{}/sorted_alignments.bam", result_dir);

    println!("Waiting for samtools sort...");
    let mut child_proc = Command::new("samtools")
        .args(&["sort", "-O", "bam", &input_file[..], "-o", &output_file[..]])
        .spawn()
        .unwrap();
    let _result = child_proc.wait().unwrap();
    println!("Alignment sorting complete");
}
// sort the alignments in numerical order (Freebayes does not work unless alignments are in numerical order)
// keep everything compressed in the BAM format to save space
sort the alignments in numerical order (Freebayes does not work unless alignments are in numerical order)
keep everything compressed in the BAM format to save space
sort the alignments in numerical order ( Freebayes does not work unless alignments are in numerical order ) keep everything compressed in the BAM format to save space
fn samtools_sort(result_dir: &str) {
    let input_file = format!("{}/fixed_alignments.bam", result_dir);
    let output_file = format!("{}/sorted_alignments.bam", result_dir);
    println!("Waiting for samtools sort...");
    let mut child_proc = Command::new("samtools")
        .args(&["sort", "-O", "bam", &input_file[..], "-o", &output_file[..]])
        .spawn()
        .unwrap();
    let _result = child_proc.wait().unwrap();
    println!("Alignment sorting complete");
}
fn samtools_sort ( result_dir : & str ) { let input_file = format ! ( " " result_dir ) ; let output_file = format ! ( " " result_dir ) ; println ! ( " " ) ; let mut child_proc = Command :: new ( " " ) . args ( & [ " " , " " , " " , & input_file [ .. ] , " " , & output_file [ .. ] ] ) . spawn ( ) . unwrap ( ) ; let _result = child_proc . wait ( ) . unwrap ( ) ; println ! ( " " ) ; }
sort the alignments in numerical order (Freebayes does not work unless alignments are in numerical order)
keep everything compressed in the BAM format to save space
sort the alignments in numerical order ( Freebayes does not work unless alignments are in numerical order ) keep everything compressed in the BAM format to save space
result_dir
&str
result_dir
&str