fn print_pileup(result:&[Pileup],out: &str, version: &str, author: &str , command: &str )-> Result<i32> {
	let now: DateTime<Local> = Local::now();
	let mut writer = csv::WriterBuilder::new().delimiter(b'\t').from_path(&out)?;
	writer.write_record(&["##","abc:",version,"","","","","","","","","","",""])?;
    writer.write_record(&["##","author:",author,"","","","","","","","","","",""])?;
    writer.write_record(&["##","date:",&now.to_rfc2822(),"","","","","","","","","","",""])?;
    writer.write_record(&["##","command:", command,"","","","","","","","","","",""])?;    
    writer.write_record(&["# chromosome","start","end","reference","A","T","C","G","ambigious","ins","del","depth","VAF","RAF"])?;
    for element in result.iter() {
        writer.write_record(&[
			element.chromosome.clone(),
			element.start.to_string(),
			element.end.to_string(),
			element.reference.clone(),
			element.nuc_a.to_string(),
			element.nuc_t.to_string(),
			element.nuc_c.to_string(),
			element.nuc_g.to_string(),
			element.ambigious.to_string(),
			element.ins.to_string(),
			element.del.to_string(),
			element.depth.to_string(),
			format!("{:.4}",element.vaf),
			format!("{:.4}",element.raf),
			])?;
    };
    writer.flush()?;
    Ok(0)
}
// takes the generates pileups in our specific
// format and prints them according to our wishes
// currently only tsv, might add more possibilities
// in the future
takes the generates pileups in our specific
format and prints them according to our wishes
currently only tsv, might add more possibilities
in the future
takes the generates pileups in our specific format and prints them according to our wishes currently only tsv might add more possibilities in the future
fn print_pileup(result:&[Pileup],out: &str, version: &str, author: &str , command: &str )-> Result<i32> {
	let now: DateTime<Local> = Local::now();
	let mut writer = csv::WriterBuilder::new().delimiter(b'\t').from_path(&out)?;
	writer.write_record(&["##","abc:",version,"","","","","","","","","","",""])?;
    writer.write_record(&["##","author:",author,"","","","","","","","","","",""])?;
    writer.write_record(&["##","date:",&now.to_rfc2822(),"","","","","","","","","","",""])?;
    writer.write_record(&["##","command:", command,"","","","","","","","","","",""])?;    
    writer.write_record(&["# chromosome","start","end","reference","A","T","C","G","ambigious","ins","del","depth","VAF","RAF"])?;
    for element in result.iter() {
        writer.write_record(&[
			element.chromosome.clone(),
			element.start.to_string(),
			element.end.to_string(),
			element.reference.clone(),
			element.nuc_a.to_string(),
			element.nuc_t.to_string(),
			element.nuc_c.to_string(),
			element.nuc_g.to_string(),
			element.ambigious.to_string(),
			element.ins.to_string(),
			element.del.to_string(),
			element.depth.to_string(),
			format!("{:.4}",element.vaf),
			format!("{:.4}",element.raf),
			])?;
    };
    writer.flush()?;
    Ok(0)
}
fn print_pileup ( result : & [ Pileup ] , out : & str , version : & str , author : & str , command : & str ) -> Result < i32 > { let now : DateTime < Local > = Local :: now ( ) ; let mut writer = csv :: WriterBuilder :: new ( ) . delimiter ( b'\t' ) . from_path ( & out ) ? ; writer . write_record ( & [ " " , " " , version , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ) ? ; writer . write_record ( & [ " " , " " , author , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ) ? ; writer . write_record ( & [ " " , " " , & now . to_rfc2822 ( ) , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ) ? ; writer . write_record ( & [ " " , " " , command , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ) ? ; writer . write_record ( & [ " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ) ? ; for element in result . iter ( ) { writer . write_record ( & [ element . chromosome . clone ( ) , element . start . to_string ( ) , element . end . to_string ( ) , element . reference . clone ( ) , element . nuc_a . to_string ( ) , element . nuc_t . to_string ( ) , element . nuc_c . to_string ( ) , element . nuc_g . to_string ( ) , element . ambigious . to_string ( ) , element . ins . to_string ( ) , element . del . to_string ( ) , element . depth . to_string ( ) , format ! ( " " element vaf ) , format ! ( " " element raf ) , ] ) ? ; } ; writer . flush ( ) ? ; Ok ( 0 ) }
takes the generates pileups in our specific
format and prints them according to our wishes
currently only tsv, might add more possibilities
in the future
takes the generates pileups in our specific format and prints them according to our wishes currently only tsv might add more possibilities in the future
result
&[Pileup]
out
&str
version
&str
author
&str
command
&str
result
&[Pileup]
out
&str
version
&str
author
&str
command
&str