Skip to content

Commit ad6b754

Browse files
committed
bug fix that backend is not used
1 parent ca8fb5f commit ad6b754

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

seqchromloader/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def initialize(self):
139139
# create the stream handler after child processes spawned to enable parallel reading
140140
# this function will be called by worker_init_function in DataLoader
141141
self.genome_pyfaidx = pyfaidx.Fasta(self.genome_fasta)
142-
self.bigwigs = [utils.BigWig(bw_path) for bw_path in self.bigwig_filelist] if self.bigwig_filelist is not None else None
142+
self.bigwigs = [utils.BigWig(bw_path, backend=config.BIGWIG_BACKEND) for bw_path in self.bigwig_filelist] if self.bigwig_filelist is not None else None
143143
if self.target_bam is not None:
144144
if isinstance(self.target_bam, list):
145145
self.target_pysam = [pysam.AlignmentFile(b) for b in self.target_bam]

seqchromloader/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def compute_mean_std_bigwig(bigwig):
461461
:type bigwig: str
462462
:rtype: (mean, stddev)
463463
"""
464-
bw = BigWig(bigwig)
464+
bw = BigWig(bigwig, backend=config.BIGWIG_BACKEND)
465465

466466
# get chrom length list
467467
chroms = bw.chroms()

seqchromloader/writer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pysam
1717
import webdataset as wds
1818

19-
from seqchromloader import utils
19+
from seqchromloader import utils, config
2020
from seqchromloader.loader import _SeqChromDatasetByWds
2121

2222
logger = logging.getLogger(__name__)
@@ -147,17 +147,17 @@ def dump_data_webdataset_worker(coords,
147147
):
148148
#get handlers
149149
genome_pyfaidx = pyfaidx.Fasta(fasta)
150-
bigwigs = [utils.BigWig(bw) for bw in bigwig_files] if bigwig_files is not None else None
150+
bigwigs = [utils.BigWig(bw, backend=config.BIGWIG_BACKEND) for bw in bigwig_files] if bigwig_files is not None else None
151151
if target_bam is not None:
152152
if isinstance(target_bam, list):
153153
target = [pysam.AlignmentFile(b) for b in target_bam]
154154
else:
155155
target = pysam.AlignmentFile(target_bam)
156156
elif target_bw is not None:
157157
if isinstance(target_bw, list):
158-
target = [utils.BigWig(b) for b in target_bw]
158+
target = [utils.BigWig(b, backend=config.BIGWIG_BACKEND) for b in target_bw]
159159
else:
160-
target = utils.BigWig(target_bw)
160+
target = utils.BigWig(target_bw, backend=config.BIGWIG_BACKEND)
161161
else:
162162
target = None
163163

0 commit comments

Comments
 (0)