text: user9118: I am using the "htslib/sam.h" header in C++. I need to access the SEQ field of bam reads and store each sequence in a vector of strings. I also need to access the MAPQ field of each read to check if the read passes my threshold quality of 10 (which I have stored as an integer). Does anyone know which htslib/sam.h functions can accomplish these tasks?
  
  user77: The MAPQ is stored in b->core.qual, given a bam1_t *b. You can access the sequence with bam_seqi(bam_get_seq(b), some_offset)(see https://github.com/samtools/htslib/blob/develop/htslib/sam.h#L317). This will get you a base at a time, so you'd need to iterate over it (the length of the sequence being in b->core.l_qseq).
  
original_text: 9118: <p>I am using the &quot;htslib/sam.h&quot; header in C++. I need to access the SEQ field of bam reads and store each sequence in a vector of strings. I also need to access the MAPQ field of each read to check if the read passes my threshold quality of 10 (which I have stored as an integer). Does anyone know which htslib/sam.h functions can accomplish these tasks?</p>
   77: <p>The MAPQ is stored in <code>b-&gt;core.qual</code>, given a <code>bam1_t *b</code>. You can access the sequence with <code>bam_seqi(bam_get_seq(b), some_offset)</code>(see <a href="https://github.com/samtools/htslib/blob/develop/htslib/sam.h#L317" rel="nofollow noreferrer">https://github.com/samtools/htslib/blob/develop/htslib/sam.h#L317</a>). This will get you a base at a time, so you'd need to iterate over it (the length of the sequence being in <code>b-&gt;core.l_qseq</code>).</p>
  