// -*- mode: c++; indent-tabs-mode: nil; -*- // // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Chris Saunders /// #include "blt_util/bam_dumper.hh" #include "starling/starling_streams.hh" #include #include #include starling_streams:: starling_streams(const starling_options& client_opt, const prog_info& pinfo, const char* const cmdline, const bam_header_t* const header) : base_t(client_opt,pinfo,cmdline,true) { if(client_opt.is_bindel_diploid_file){ std::ofstream* fosptr(new std::ofstream); _bindel_diploid_osptr.reset(fosptr); std::ofstream& fos(*fosptr); open_ofstream(pinfo,client_opt.bindel_diploid_filename,"bindel-diploid",client_opt.is_clobber,fos); fos << "# ** " << pinfo.name() << " bindel-diploid file **\n"; write_file_audit(client_opt,pinfo,cmdline,fos); fos << "#$ INDEL_THETA " << client_opt.bindel_diploid_theta << "\n"; fos << "#\n"; fos << "#$ COLUMNS seq_name pos type ref_upstream ref/indel ref_downstream Q(indel) max_gtype Q(max_gtype) depth alt_reads indel_reads other_reads repeat_unit ref_repeat_count indel_repeat_count\n"; } if(client_opt.is_realigned_read_file){ assert(NULL != header); // \TODO consider putting extra info into BAM header: // //fp->header = bam_header_dup((const bam_header_t*)aux); //fos << "@PG\tID:" << pinfo.name() << "\tVN:" << pinfo.version() << "\tCL:" << cmdline << "\n"; if(not client_opt.is_clobber){ // weak clobber test: std::ofstream fos; open_ofstream(pinfo,client_opt.realigned_read_filename,"realigned-read BAM",client_opt.is_clobber,fos); } _realign_bam_ptr.reset(new bam_dumper(client_opt.realigned_read_filename.c_str(),header)); } } // dtor here to make auto_ptr work correctly: starling_streams:: ~starling_streams() {}