Skip to content

Commit 3f914fd

Browse files
committed
recognize cram for sparse_bam
1 parent b4489b6 commit 3f914fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spladder/spladder_build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def spladder(options):
9090
### convert input BAMs to sparse arrays - filtered case
9191
if options.sparse_bam:
9292
for bfn in options.bam_fnames:
93-
if bfn.endswith('.bam') and not os.path.exists(re.sub(r'\.[bB][aA][mM]|\.[cC][rR][aA][mM]$', '', bfn) + '.conf_%i' % options.confidence + '.filt.hdf5'):
93+
if bfn.lower().split('.')[-1] in ['bam', 'cram'] and not os.path.exists(re.sub(r'\.[bB][aA][mM]|\.[cC][rR][aA][mM]$', '', bfn) + '.conf_%i' % options.confidence + '.filt.hdf5'):
9494

9595
if not hasattr(options, 'chrm_lookup'):
9696
IN = pysam.Samfile(bfn, 'rb')
@@ -171,7 +171,7 @@ def spladder(options):
171171
### convert input BAMs to sparse arrays - unfiltered case
172172
if options.sparse_bam:
173173
for bfn in options.bam_fnames:
174-
if bfn.endswith('.bam') and not os.path.exists(re.sub(r'\.[bB][aA][mM]|\.[cC][rR][aA][mM]$', '', bfn) + '.hdf5'):
174+
if bfn.lower().split('.')[-1] in ['bam', 'cram'] and not os.path.exists(re.sub(r'\.[bB][aA][mM]|\.[cC][rR][aA][mM]$', '', bfn) + '.hdf5'):
175175
#cnts = dict()
176176

177177
if not hasattr(options, 'chrm_lookup'):

0 commit comments

Comments
 (0)