Skip to content

Commit

Permalink
do not check for chromosome names in bam_is_sorted (#898)
Browse files Browse the repository at this point in the history
set check_sq=False when opening a bam file in bam_is_sorted so we do not require chromosome names to be present
  • Loading branch information
tomkinsc committed Nov 27, 2018
1 parent b546eae commit 5dbd9fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def makeFastaFile(seqs, outFasta):

def bam_is_sorted(bam_file_path):
# Should perhaps be in samtools.py once it moves to pysam
samfile = pysam.AlignmentFile(bam_file_path, "rb")
samfile = pysam.AlignmentFile(bam_file_path, "rb", check_sq=False)
if "HD" in samfile.header and "SO" in samfile.header["HD"]:
return samfile.header["HD"]["SO"] in ("coordinate") # also: "queryname"
else:
Expand Down

0 comments on commit 5dbd9fc

Please sign in to comment.