Skip to content

Commit

Permalink
fix #3 in collapsed reads
Browse files Browse the repository at this point in the history
  • Loading branch information
zj-zhang committed May 12, 2019
1 parent 472e6f2 commit b09c5b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CLAM/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def filter_bam_multihits(filename, max_tags, max_hits, out_dir, read_tagger_meth
## omit the details in read sequence and quality
## recommended for larger bam because this
## can save some memory/storage for large bams
if omit_detail:
read.query_sequence = '*'
read.query_qualities = '0'
#if omit_detail:
# read.query_sequence = '*'
# read.query_qualities = '0'

if read.is_secondary or (read.has_tag('NH') and read.opt("NH")>1):
try:
Expand Down Expand Up @@ -234,17 +234,17 @@ def filter_bam_maxtags(obam_fn, ibam_fn, max_tags=1):
last_pos = read.positions[0]
stack = [read]
for new_alignment in new_alignment_list:
new_alignment.query_sequence = '*'
new_alignment.query_qualities = '0'
#new_alignment.query_sequence = '*'
#new_alignment.query_qualities = '0'
_ = obam.write(new_alignment)
else:
stack.append(read)
new_alignment_list, collapse_dict = collapse_stack(stack, collapse_dict, max_tags)
output_counter += len(new_alignment_list)
last_pos = read.positions[0]
for new_alignment in new_alignment_list:
new_alignment.query_sequence = '*'
new_alignment.query_qualities = '0'
#new_alignment.query_sequence = '*'
#new_alignment.query_qualities = '0'
_ = obam.write(new_alignment)
ibam.close()
obam.close()
Expand Down

0 comments on commit b09c5b2

Please sign in to comment.