Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 committed Dec 16, 2024
1 parent 38fb9e7 commit 9bb785f
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions bwapy/libbwapy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -265,27 +265,27 @@ cdef class BwaAln:
if seq.type == BWA_TYPE_NO_MATCH: # unmapped read
# TODO: custom bwa tags: RG, BC, XC
return rec
#
# ref_len_in_alignment = pos_end(seq) - seq.pos
#
# # if on the reverse strand, reverse the query sequence and qualities
# rec.query_sequence = query.sequence[::-1]
# if query.quality is not None:
# rec.query_qualities = query.quality[::-1]
#
# # reference id
# nn = bns_cnt_ambi(self._index._bns, seq.pos, ref_len_in_alignment, &reference_id)
# rec.reference_id = reference_id
#
# # make this unmapped if we map off the end of the contig
# rec.is_unmapped = seq.pos + ref_len_in_alignment - self._index._bns.anns[
# rec.reference_id].offset > self._index._bns.anns[rec.reference_id].len
#
# # strand, reference start, and mapping quality
# if seq.strand:
# rec.is_reverse = True
# rec.reference_start = seq.pos - self._index._bns.anns[rec.reference_id].offset + 1
# rec.mapping_quality = seq.mapQ

ref_len_in_alignment = pos_end(seq) - seq.pos

# if on the reverse strand, reverse the query sequence and qualities
rec.query_sequence = query.sequence[::-1]
if query.quality is not None:
rec.query_qualities = query.quality[::-1]

# reference id
nn = bns_cnt_ambi(self._index._bns, seq.pos, ref_len_in_alignment, &reference_id)
rec.reference_id = reference_id

# make this unmapped if we map off the end of the contig
rec.is_unmapped = seq.pos + ref_len_in_alignment - self._index._bns.anns[
rec.reference_id].offset > self._index._bns.anns[rec.reference_id].len

# strand, reference start, and mapping quality
if seq.strand:
rec.is_reverse = True
rec.reference_start = seq.pos - self._index._bns.anns[rec.reference_id].offset + 1
rec.mapping_quality = seq.mapQ
#
# # cigar
# cigar = ""
Expand Down Expand Up @@ -346,7 +346,6 @@ cdef class BwaAln:
self._build_alignment(query=queries[i], seq=&seqs[i], kstr=kstr)
for i in range(num_seqs)
]
recs = []

bwa_free_read_seq(num_seqs, seqs)
free(kstr)
Expand Down

0 comments on commit 9bb785f

Please sign in to comment.