GRichard513 commited on
Commit
aaa5f15
·
2 Parent(s): 8724457 a9937b3

Merge branch 'main' of https://huggingface.co/datasets/InstaDeepAI/multi_omics_transcript_expression

Browse files
multi_omics_transcript_expression.py CHANGED
@@ -226,6 +226,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
226
  self,
227
  sequence_length: int = DEFAULT_LENGTH,
228
  filter_out_sequence_length: int = DEFAULT_FILTER_OUT_LENGTH,
 
229
  **kwargs,
230
  ):
231
  """
@@ -237,12 +238,15 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
237
  coordinate_csv_file: The csv file that stores the coordinates and filename of the target
238
  labels_csv_file: The csv file that stores the labels with one sample per row.
239
  sequence_length: Sequence length for this handler.
 
 
240
  """
241
  self.reference_genome = None
242
  self.coordinate_csv_file = None
243
  self.labels_csv_file = None
244
  self.sequence_length = sequence_length
245
  self.filter_out_sequence_length = filter_out_sequence_length
 
246
 
247
  if filter_out_sequence_length is not None:
248
  assert isinstance(filter_out_sequence_length, int)
@@ -293,9 +297,18 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
293
  )
294
  self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
295
 
296
- self.df_csv_file = dl_manager.download_and_extract(
297
- "transcript_expression/GTEx_tpm_multiomics.csv"
298
- )
 
 
 
 
 
 
 
 
 
299
 
300
  return super().split_generators(dl_manager, cache_dir_root)
301
 
@@ -338,9 +351,9 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
338
  "DNA": standardize_sequence(padded_sequence),
339
  "chromosome": re.sub("chr", "", chromosome),
340
  "RNA": coordinates_row["RNA"],
341
- # "five_prime_utr": coordinates_row["5UTR"],
342
- # "coding_sequence": coordinates_row["CDS"],
343
- # "three_prime_utr": coordinates_row["3UTR"],
344
  "Protein": coordinates_row["Protein"],
345
  }
346
  key += 1
 
226
  self,
227
  sequence_length: int = DEFAULT_LENGTH,
228
  filter_out_sequence_length: int = DEFAULT_FILTER_OUT_LENGTH,
229
+ expression_method: str = "read_counts_old",
230
  **kwargs,
231
  ):
232
  """
 
238
  coordinate_csv_file: The csv file that stores the coordinates and filename of the target
239
  labels_csv_file: The csv file that stores the labels with one sample per row.
240
  sequence_length: Sequence length for this handler.
241
+ expression_method: To specify if user wants to use TPMs instead of read
242
+ counts.
243
  """
244
  self.reference_genome = None
245
  self.coordinate_csv_file = None
246
  self.labels_csv_file = None
247
  self.sequence_length = sequence_length
248
  self.filter_out_sequence_length = filter_out_sequence_length
249
+ self.expression_method = expression_method
250
 
251
  if filter_out_sequence_length is not None:
252
  assert isinstance(filter_out_sequence_length, int)
 
297
  )
298
  self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
299
 
300
+ if self.expression_method == "tpm":
301
+ self.df_csv_file = dl_manager.download_and_extract(
302
+ "transcript_expression/GTEx_final_tpm_multiomics.csv"
303
+ )
304
+ elif self.expression_method == "read_counts_old":
305
+ self.df_csv_file = dl_manager.download_and_extract(
306
+ "transcript_expression/GTEx_v1_multiomics.csv"
307
+ )
308
+ elif self.expression_method == "read_counts":
309
+ raise NotImplementedError(
310
+ "Needs the dataset"
311
+ )
312
 
313
  return super().split_generators(dl_manager, cache_dir_root)
314
 
 
351
  "DNA": standardize_sequence(padded_sequence),
352
  "chromosome": re.sub("chr", "", chromosome),
353
  "RNA": coordinates_row["RNA"],
354
+ "five_prime_utr": coordinates_row["5UTR"],
355
+ "coding_sequence": coordinates_row["CDS"],
356
+ "three_prime_utr": coordinates_row["3UTR"],
357
  "Protein": coordinates_row["Protein"],
358
  }
359
  key += 1
transcript_expression/GTEx_tpm_multiomics.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c26aac2b9f4f1ab97f800337a36294c3cc99eb18c16ad7e99967183b43810908
3
- size 446177061
 
 
 
 
transcript_expression/expression_values_v1.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:33497cd1e5ace0eee4f220319dd16bfa5b9b0befae9c6fa95b8abc3d62f5e1fc
3
- size 457970509
 
 
 
 
transcript_expression/expression_values_v2.csv DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a188b731d7e9ec28ac8dd723d4d0bee597bbd4f8b4ba78707875e7a868ed778a
3
- size 539601860