From bc9bd0538f3481458a35f5b8c1817102e41aba36 Mon Sep 17 00:00:00 2001 From: Wolfgang Maier Date: Fri, 21 Jan 2022 09:44:56 +0100 Subject: [PATCH] Enable display of BAM data without sequence info Unaligned BAM files like produced, e.g., by picard FastqToSam will not have sequence information present in their header. This change should allow Galaxy to display such files instead of just a ``` Could not display BAM file, error was: file has no sequences defined (mode='rb') - is it SAM/BAM format? Consider opening with check_sq=False ``` message. --- 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 efef4febb9f..6e76bccd897 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -467,7 +467,7 @@ class BamNative(CompressedArchive, _BamOrSam): def get_chunk(self, trans, dataset, offset=0, ck_size=None): if not offset == -1: try: - with pysam.AlignmentFile(dataset.file_name, "rb") as bamfile: + with pysam.AlignmentFile(dataset.file_name, "rb", check_sq=False) as bamfile: ck_size = 300 # 300 lines ck_data = "" header_line_count = 0