seqchromloader 0.7.3__tar.gz → 0.7.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/PKG-INFO +1 -1
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader/loader.py +12 -4
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader/writer.py +1 -1
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader.egg-info/PKG-INFO +1 -1
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/setup.py +1 -1
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/README.md +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader/__init__.py +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader/utils.py +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader.egg-info/SOURCES.txt +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader.egg-info/dependency_links.txt +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader.egg-info/requires.txt +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/seqchromloader.egg-info/top_level.txt +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/setup.cfg +0 -0
- {seqchromloader-0.7.3 → seqchromloader-0.7.4}/tests/test_writer_loader.py +0 -0
|
@@ -110,7 +110,8 @@ class _SeqChromDatasetByDataFrame(IterableDataset):
|
|
|
110
110
|
bigwig_filelist:list,
|
|
111
111
|
target_bam=None,
|
|
112
112
|
transforms:dict=None,
|
|
113
|
-
return_region=False
|
|
113
|
+
return_region=False,
|
|
114
|
+
patch_left=0, patch_right=0):
|
|
114
115
|
|
|
115
116
|
self.dataframe = dataframe
|
|
116
117
|
self.genome_fasta = genome_fasta
|
|
@@ -122,6 +123,8 @@ class _SeqChromDatasetByDataFrame(IterableDataset):
|
|
|
122
123
|
|
|
123
124
|
self.transforms = transforms
|
|
124
125
|
self.return_region = return_region
|
|
126
|
+
self.patch_left = patch_left
|
|
127
|
+
self.patch_right = patch_right
|
|
125
128
|
|
|
126
129
|
self.start = 0; self.end = len(self.dataframe)
|
|
127
130
|
|
|
@@ -157,7 +160,9 @@ class _SeqChromDatasetByDataFrame(IterableDataset):
|
|
|
157
160
|
bigwigs=self.bigwigs,
|
|
158
161
|
target=self.target_pysam,
|
|
159
162
|
strand=item.strand,
|
|
160
|
-
transforms=self.transforms
|
|
163
|
+
transforms=self.transforms,
|
|
164
|
+
patch_left=self.patch_left,
|
|
165
|
+
patch_right=self.patch_right
|
|
161
166
|
)
|
|
162
167
|
except utils.BigWigInaccessible as e:
|
|
163
168
|
logging.warn(f"Inaccessible bigwig error detected in region {item.chrom}:{item.start}-{item.end}, Skipping...")
|
|
@@ -187,14 +192,17 @@ class _SeqChromDatasetByBed(_SeqChromDatasetByDataFrame):
|
|
|
187
192
|
:param transforms: A dictionary of functions to transform the output data, accepted keys are *["seq", "chrom", "target", "label"]*
|
|
188
193
|
:type transforms: dict of functions
|
|
189
194
|
"""
|
|
190
|
-
def __init__(self, bed: str, genome_fasta: str, bigwig_filelist:list, target_bam=None,
|
|
195
|
+
def __init__(self, bed: str, genome_fasta: str, bigwig_filelist:list, target_bam=None,
|
|
196
|
+
transforms:dict=None, return_region=False,
|
|
197
|
+
patch_left=0, patch_right=0):
|
|
191
198
|
dataframe = pd.read_table(bed, header=None, names=['chrom', 'start', 'end', 'label', 'score', 'strand' ])
|
|
192
199
|
super().__init__(dataframe,
|
|
193
200
|
genome_fasta,
|
|
194
201
|
bigwig_filelist,
|
|
195
202
|
target_bam,
|
|
196
203
|
transforms,
|
|
197
|
-
return_region
|
|
204
|
+
return_region,
|
|
205
|
+
patch_left, patch_right)
|
|
198
206
|
|
|
199
207
|
SeqChromDatasetByBed = seqChromLoaderCurry(_SeqChromDatasetByBed)
|
|
200
208
|
|
|
@@ -186,7 +186,7 @@ def dump_data_webdataset_worker(coords,
|
|
|
186
186
|
|
|
187
187
|
if batch_size is None:
|
|
188
188
|
feature_dict = defaultdict()
|
|
189
|
-
feature_dict["__key__"] = f"{rindex}_{item.chrom}:{item.start}-{item.end}_{item.strand}"
|
|
189
|
+
feature_dict["__key__"] = f"{rindex}_{item.chrom}:{item.start-patch_left}-{item.end+patch_right}_{item.strand}"
|
|
190
190
|
feature_dict["seq.npy"] = feature['seq']
|
|
191
191
|
feature_dict["chrom.npy"] = feature['chrom']
|
|
192
192
|
feature_dict["target.npy"] = feature['target']
|
|
@@ -20,7 +20,7 @@ setup(
|
|
|
20
20
|
# eg: 1.0.0, 1.0.1, 3.0.2, 5.0-beta, etc.
|
|
21
21
|
# You CANNOT upload two versions of your package with the same version number
|
|
22
22
|
# This field is REQUIRED
|
|
23
|
-
version="0.7.
|
|
23
|
+
version="0.7.4",
|
|
24
24
|
|
|
25
25
|
# The packages that constitute your project.
|
|
26
26
|
# For my project, I have only one - "pydash".
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|