def set(bam_alignment, header)
@al = Bio::DB::SAM::Tools::Bam1T.new(bam_alignment)
tmp_str = Bio::DB::SAM::Tools.bam_format1(header,al)
self.sam = String.new(tmp_str)
core = al[:core]
cigar = al[:data][core[:l_qname]]
@calend = Bio::DB::SAM::Tools.bam_calend(core,cigar)
@qlen = Bio::DB::SAM::Tools.bam_cigar2qlen(core,cigar)
@is_paired = @flag & 0x0001 > 0
@is_mapped = @flag & 0x0002 > 0
@query_unmapped = @flag & 0x0004 > 0
@mate_unmapped = @flag & 0x0008 > 0
@query_strand = !(@flag & 0x0010 > 0)
@mate_strand = !(@flag & 0x0020 > 0)
@first_in_pair = @flag & 0x0040 > 0
@second_in_pair = @flag & 0x0080 > 0
@primary = !(@flag & 0x0100 > 0)
@failed_quality = @flag & 0x0200 > 0
@is_duplicate = @flag & 0x0400 > 0
end