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.
This commit is contained in:
Wolfgang Maier
2022-01-21 09:44:56 +01:00
committed by GitHub
parent 9f8223d845
commit bc9bd0538f
+1 -1
View File
@@ -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