File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,19 @@ bool BamReader::next()
24
24
char *chr = bamHdr->target_name [aln->core .tid ] ; // contig name (chromosome)
25
25
uint32_t len = aln->core .l_qseq ; // length of the read.
26
26
27
- uint8_t *q = bam_get_seq (aln); // quality string
28
- uint32_t q2 = aln-> core . qual ; // mapping quality
27
+ uint8_t *q = bam_get_seq (aln); // sequence string
28
+ uint8_t * q2 = bam_get_qual ( aln) ; // sequence quality
29
29
30
- char *qseq = (char *)malloc (len);
30
+ char *qseq = static_cast <char *>(malloc (len));
31
+ char * qqua = static_cast <char *>(malloc (len));
31
32
32
33
for (int i=0 ; i< len ; i++){
33
34
qseq[i] = seq_nt16_str[bam_seqi (q,i)]; // gets nucleotide id and converts them into IUPAC id.
35
+ qqua[i] = static_cast <char >(q2[i]);
34
36
}
35
37
36
38
seq.setSequence (QByteArray (qseq, len));
37
- seq.setQuality (QByteArray (qseq , len));
39
+ seq.setQuality (QByteArray (qqua , len));
38
40
39
41
40
42
// update sequence
You can’t perform that action at this time.
0 commit comments