Skip to content

Commit

Permalink
Replace '\t' to ' ' in BAM headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvark committed Jul 10, 2017
1 parent 0cfdfbf commit 90a0ab0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/galaxy/datatypes/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def get_chunk( self, trans, dataset, offset=0, ck_size=None ):
ck_data = ""
header_line_count = 0
if offset == 0:
ck_data = bamfile.text
ck_data = bamfile.text.replace('\t',' ')
header_line_count = bamfile.text.count('\n')
else:
bamfile.seek( offset )
Expand All @@ -486,9 +486,9 @@ def get_chunk( self, trans, dataset, offset=0, ck_size=None ):
break
else:
bamline = alignment.tostring( bamfile )
# Galaxy display each tag as separate column because 'tostring()' funcition put spaces in between each tag of tags column.
# Galaxy display each tag as separate column because 'tostring()' funcition put tabs in between each tag of tags column.
# Below code will remove spaces between each tag.
bamline_modified = ('\t').join( bamline.split()[:11] + [ ('').join(bamline.split()[11:]) ] )
bamline_modified = ('\t').join( bamline.split()[:11] + [ (' ').join(bamline.split()[11:]) ] )
ck_data = "%s\n%s" % ( ck_data, bamline_modified )
return dumps( { 'ck_data': util.unicodify( ck_data ),
'offset': offset } )
Expand Down

0 comments on commit 90a0ab0

Please sign in to comment.