From 6281b46ea8876fc3b6cd6a51d947b75f9a362b34 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 6 Oct 2023 13:57:39 -0400 Subject: [PATCH 1/3] Use AlignedSegment.to_string --- lib/galaxy/datatypes/binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 022631195215..6ff176063f4a 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -664,7 +664,7 @@ def get_chunk(self, trans, dataset: HasFileName, offset: int = 0, ck_size: Optio break offset = bamfile.tell() - bamline = alignment.tostring(bamfile) + bamline = alignment.to_string(bamfile) # With multiple tags, Galaxy would display each as a separate column # because the 'tostring()' function uses tabs also between tags. # Below code will turn these extra tabs into spaces. From a058eeb3dee8fdc34c49951329e391879e803a8c Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Fri, 6 Oct 2023 14:06:56 -0400 Subject: [PATCH 2/3] Update outdated comment Co-authored-by: Dannon --- lib/galaxy/datatypes/binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 6ff176063f4a..46f4385cd5e3 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -666,7 +666,7 @@ def get_chunk(self, trans, dataset: HasFileName, offset: int = 0, ck_size: Optio offset = bamfile.tell() bamline = alignment.to_string(bamfile) # With multiple tags, Galaxy would display each as a separate column - # because the 'tostring()' function uses tabs also between tags. + # because the 'to_string()' function uses tabs also between tags. # Below code will turn these extra tabs into spaces. n_tabs = bamline.count("\t") if n_tabs > 11: From 48dcf862c967f815c12fd47f3f2c28630840e370 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Sat, 7 Oct 2023 21:49:17 +0200 Subject: [PATCH 3/3] fix the call arguments https://pysam.readthedocs.io/en/v0.21.0/api.html?highlight=AlignedSegment#pysam.AlignedSegment.tostring --- lib/galaxy/datatypes/binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 46f4385cd5e3..c15b2213a94c 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -664,7 +664,7 @@ def get_chunk(self, trans, dataset: HasFileName, offset: int = 0, ck_size: Optio break offset = bamfile.tell() - bamline = alignment.to_string(bamfile) + bamline = alignment.to_string() # With multiple tags, Galaxy would display each as a separate column # because the 'to_string()' function uses tabs also between tags. # Below code will turn these extra tabs into spaces.