Skip to content

Commit

Permalink
Fixes compile error for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
kcleal committed Nov 20, 2024
1 parent cc6e617 commit 636b5b6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions dysgu/call_component.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cdef base_quals_aligned_clipped(AlignedSegment a):
cdef float clipped_base_quals = 0
cdef int left_clip = 0
cdef int right_clip = 0
clip_sizes(a, left_clip, right_clip)
clip_sizes(a, &left_clip, &right_clip)
clipped_bases = left_clip + right_clip
cdef const unsigned char[:] quals = a.query_qualities
cdef int i
Expand Down Expand Up @@ -121,7 +121,7 @@ cdef count_attributes2(reads1, reads2, spanning, float insert_ppf, generic_ins,
er.n_unmapped_mates += 1
left_clip = 0
right_clip = 0
clip_sizes_hard(a, left_clip, right_clip)
clip_sizes_hard(a, &left_clip, &right_clip)
if left_clip > 0 and right_clip > 0:
er.double_clips += 1
has_sa = a.has_tag("SA")
Expand Down Expand Up @@ -164,7 +164,7 @@ cdef count_attributes2(reads1, reads2, spanning, float insert_ppf, generic_ins,

left_clip = 0
right_clip = 0
clip_sizes(a, left_clip, right_clip)
clip_sizes(a, &left_clip, &right_clip)
if left_clip or right_clip:
er.sc += 1
if a.flag & 1: # paired read
Expand All @@ -180,7 +180,7 @@ cdef count_attributes2(reads1, reads2, spanning, float insert_ppf, generic_ins,
er.NP += 1
left_clip = 0
right_clip = 0
clip_sizes_hard(a, left_clip, right_clip)
clip_sizes_hard(a, &left_clip, &right_clip)
if left_clip > 0 and right_clip > 0:
er.double_clips += 1
if a.has_tag("SA"):
Expand Down Expand Up @@ -426,7 +426,7 @@ cdef make_generic_insertion_item(aln, int insert_size, int insert_std):
v_item.svtype = "BND"
left_clip = 0
right_clip = 0
clip_sizes(aln, left_clip, right_clip)
clip_sizes(aln, &left_clip, &right_clip)
clip_s = max(left_clip, right_clip)
rand_insert_pos = 100 if not clip_s else clip_s
v_item.inferred_sv_len = 0 if rand_insert_pos < 0 else rand_insert_pos
Expand Down
4 changes: 2 additions & 2 deletions dysgu/graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ cdef class ClipScoper:
unordered_set[int]& clustered_nodes):
cdef int clip_left = 0
cdef int clip_right = 0
clip_sizes(r, clip_left, clip_right)
clip_sizes(r, &clip_left, &clip_right)
if chrom != self.current_chrom:
self.scope_left.clear()
self.scope_right.clear()
Expand Down Expand Up @@ -1336,7 +1336,7 @@ cpdef tuple construct_graph(genome_scanner, infile, int max_dist, int clustering
pos2 = -1
left_clip_size = 0
right_clip_size = 0
clip_sizes_hard(r, left_clip_size, right_clip_size) # soft and hard-clips
clip_sizes_hard(r, &left_clip_size, &right_clip_size) # soft and hard-clips
if r.flag & 8 and clipped: # paired by inference
# skip if both ends are clipped, usually means its a chunk of badly mapped sequence
# if not (left_clip_size and right_clip_size) and ((paired_end and good_quality_clip(r, 20)) or (not paired_end and) ):
Expand Down
4 changes: 2 additions & 2 deletions dysgu/map_set_utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ cdef extern from "<map>" namespace "std" nogil:

cdef int cigar_exists(r)

cdef void clip_sizes(AlignedSegment r, int& left, int& right)
cdef void clip_sizes(AlignedSegment r, int* left, int* right)

cdef void clip_sizes_hard(AlignedSegment r, int& left, int& right)
cdef void clip_sizes_hard(AlignedSegment r, int* left, int* right)

cdef int cigar_clip(r, int clip_length)

Expand Down
12 changes: 6 additions & 6 deletions dysgu/map_set_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ cdef int cigar_exists(r):
return 0


cdef void clip_sizes(AlignedSegment r, int& left, int& right):
cdef void clip_sizes(AlignedSegment r, int* left, int* right):
cdef uint32_t cigar_value
cdef uint32_t cigar_l
cdef uint32_t *cigar_p
Expand All @@ -258,11 +258,11 @@ cdef void clip_sizes(AlignedSegment r, int& left, int& right):
cigar_value = cigar_p[0]
opp = <int> cigar_value & 15
if opp == 4:
left = <int> cigar_value >> 4
left[0] = <int> cigar_value >> 4
cigar_value = cigar_p[cigar_l - 1]
opp = <int> cigar_value & 15
if opp == 4:
right = <int> cigar_value >> 4
right[0] = <int> cigar_value >> 4

# c = r.cigartuples
# if not c:
Expand All @@ -278,7 +278,7 @@ cdef void clip_sizes(AlignedSegment r, int& left, int& right):
# return left, right


cdef void clip_sizes_hard(AlignedSegment r, int& left, int& right):
cdef void clip_sizes_hard(AlignedSegment r, int* left, int* right):
cdef uint32_t cigar_value
cdef uint32_t cigar_l
cdef uint32_t *cigar_p
Expand All @@ -291,11 +291,11 @@ cdef void clip_sizes_hard(AlignedSegment r, int& left, int& right):
cigar_value = cigar_p[0]
opp = <int> cigar_value & 15
if opp == 4 or opp == 5:
left = <int> cigar_value >> 4
left[0] = <int> cigar_value >> 4
cigar_value = cigar_p[cigar_l - 1]
opp = <int> cigar_value & 15
if opp == 4 or opp == 5:
right = <int> cigar_value >> 4
right[0] = <int> cigar_value >> 4

# c = r.cigartuples
# if not c:
Expand Down

0 comments on commit 636b5b6

Please sign in to comment.