Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zj-zhang authored Jul 23, 2019
2 parents e55fe4f + b09c5b2 commit bdb2321
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CLAM/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def filter_bam_multihits(filename, max_tags, max_hits, out_dir, read_tagger_meth
if read_tag==-1:
continue
read.tags += [('RT', read_tag)] ## add the tag

tagged_read = pysam.AlignedSegment()
tagged_read.query_name = read.query_name
tagged_read.query_sequence = 'N'
Expand Down Expand Up @@ -239,17 +240,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 bdb2321

Please sign in to comment.