Commit
·
299744f
1
Parent(s):
98ec642
fix
Browse files
multi_omics_transcript_expression.py
CHANGED
@@ -29,7 +29,7 @@ Task Specific Handlers:
|
|
29 |
-------------------------------------------------------------------------------------------
|
30 |
"""
|
31 |
|
32 |
-
logger = logging.getLogger("
|
33 |
logger.setLevel("INFO")
|
34 |
|
35 |
|
@@ -123,7 +123,7 @@ class GenomicLRATaskHandler(ABC):
|
|
123 |
|
124 |
class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
125 |
"""
|
126 |
-
Handler for the
|
127 |
"""
|
128 |
|
129 |
DEFAULT_LENGTH = 200000
|
@@ -136,7 +136,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
136 |
**kwargs,
|
137 |
):
|
138 |
"""
|
139 |
-
Creates a new handler for the
|
140 |
Args:
|
141 |
sequence_length: Length of the sequence around the TSS_CAGE start site
|
142 |
Instance Vars:
|
@@ -160,7 +160,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
160 |
|
161 |
def get_info(self, description: str) -> DatasetInfo:
|
162 |
"""
|
163 |
-
Returns the DatasetInfor for the
|
164 |
includes a genomic sequence and a list of label values.
|
165 |
"""
|
166 |
features = datasets.Features(
|
@@ -186,7 +186,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
186 |
def split_generators(self, dl_manager, cache_dir_root):
|
187 |
"""
|
188 |
Separates files by split and stores filenames in instance variables.
|
189 |
-
The
|
190 |
csv file,and label csv file to be saved.
|
191 |
"""
|
192 |
# Manually download the reference genome since there are difficulties when streaming
|
@@ -196,11 +196,11 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
196 |
self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
|
197 |
|
198 |
self.coordinate_csv_file = dl_manager.download_and_extract(
|
199 |
-
"
|
200 |
)
|
201 |
|
202 |
self.labels_csv_file = dl_manager.download_and_extract(
|
203 |
-
"
|
204 |
)
|
205 |
|
206 |
return super().split_generators(dl_manager, cache_dir_root)
|
@@ -217,9 +217,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
217 |
|
218 |
key = 0
|
219 |
for idx, coordinates_row in coordinates_split_df.iterrows():
|
220 |
-
start =
|
221 |
-
coordinates_row["position"] - 1
|
222 |
-
) # -1 since vcf coords are 1-based
|
223 |
|
224 |
chromosome = coordinates_row["chr"]
|
225 |
labels_row = coordinates_row.loc[idx].values[2:]
|
@@ -257,7 +255,6 @@ Dataset for benchmark of genomic deep learning models.
|
|
257 |
"""
|
258 |
|
259 |
|
260 |
-
|
261 |
# define dataset configs
|
262 |
class GenomicsLRAConfig(datasets.BuilderConfig):
|
263 |
"""
|
|
|
29 |
-------------------------------------------------------------------------------------------
|
30 |
"""
|
31 |
|
32 |
+
logger = logging.getLogger("multi_omics_transcript_expression")
|
33 |
logger.setLevel("INFO")
|
34 |
|
35 |
|
|
|
123 |
|
124 |
class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
125 |
"""
|
126 |
+
Handler for the Transcript Expression task.
|
127 |
"""
|
128 |
|
129 |
DEFAULT_LENGTH = 200000
|
|
|
136 |
**kwargs,
|
137 |
):
|
138 |
"""
|
139 |
+
Creates a new handler for the Transcrpt Expression Prediction Task.
|
140 |
Args:
|
141 |
sequence_length: Length of the sequence around the TSS_CAGE start site
|
142 |
Instance Vars:
|
|
|
160 |
|
161 |
def get_info(self, description: str) -> DatasetInfo:
|
162 |
"""
|
163 |
+
Returns the DatasetInfor for the Transcript Expression dataset. Each example
|
164 |
includes a genomic sequence and a list of label values.
|
165 |
"""
|
166 |
features = datasets.Features(
|
|
|
186 |
def split_generators(self, dl_manager, cache_dir_root):
|
187 |
"""
|
188 |
Separates files by split and stores filenames in instance variables.
|
189 |
+
The Transcript Expression dataset requires the reference hg19 genome, coordinate
|
190 |
csv file,and label csv file to be saved.
|
191 |
"""
|
192 |
# Manually download the reference genome since there are difficulties when streaming
|
|
|
196 |
self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
|
197 |
|
198 |
self.coordinate_csv_file = dl_manager.download_and_extract(
|
199 |
+
"transcript_expression/transcript_coordinates.csv"
|
200 |
)
|
201 |
|
202 |
self.labels_csv_file = dl_manager.download_and_extract(
|
203 |
+
"transcript_expression/rna_expression_values.csv"
|
204 |
)
|
205 |
|
206 |
return super().split_generators(dl_manager, cache_dir_root)
|
|
|
217 |
|
218 |
key = 0
|
219 |
for idx, coordinates_row in coordinates_split_df.iterrows():
|
220 |
+
start = coordinates_row["position"] - 1 # -1 since vcf coords are 1-based
|
|
|
|
|
221 |
|
222 |
chromosome = coordinates_row["chr"]
|
223 |
labels_row = coordinates_row.loc[idx].values[2:]
|
|
|
255 |
"""
|
256 |
|
257 |
|
|
|
258 |
# define dataset configs
|
259 |
class GenomicsLRAConfig(datasets.BuilderConfig):
|
260 |
"""
|