Commit
·
d4aacab
1
Parent(s):
819d018
fix
Browse files
.gitattributes
CHANGED
|
@@ -53,6 +53,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
-
transcript_expression/
|
| 57 |
-
transcript_expression/
|
| 58 |
-
transcript_expression/transcript_coordinates.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
transcript_expression/GTEx_df_v1.csv filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
transcript_expression/GTEx_df_v2.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
multi_omics_transcript_expression.py
CHANGED
|
@@ -32,6 +32,96 @@ Task Specific Handlers:
|
|
| 32 |
logger = logging.getLogger("multi_omics_transcript_expression")
|
| 33 |
logger.setLevel("INFO")
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
class GenomicLRATaskHandler(ABC):
|
| 37 |
"""
|
|
@@ -195,12 +285,8 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
| 195 |
)
|
| 196 |
self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
|
| 197 |
|
| 198 |
-
self.
|
| 199 |
-
"transcript_expression/
|
| 200 |
-
)
|
| 201 |
-
|
| 202 |
-
self.labels_csv_file = dl_manager.download_and_extract(
|
| 203 |
-
"transcript_expression/expression_values_v2.csv"
|
| 204 |
)
|
| 205 |
|
| 206 |
return super().split_generators(dl_manager, cache_dir_root)
|
|
@@ -211,18 +297,17 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
| 211 |
and the corresponding labels. The sequences are padded to the correct sequence
|
| 212 |
length and standardized before returning.
|
| 213 |
"""
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
labels_name = labels_df.columns[2:]
|
| 217 |
|
| 218 |
-
|
| 219 |
|
| 220 |
key = 0
|
| 221 |
-
for idx, coordinates_row in
|
| 222 |
start = coordinates_row["position"] - 1 # -1 since vcf coords are 1-based
|
| 223 |
|
| 224 |
chromosome = coordinates_row["chr"]
|
| 225 |
-
labels_row =
|
| 226 |
padded_sequence = pad_sequence(
|
| 227 |
chromosome=self.reference_genome[chromosome],
|
| 228 |
start=start,
|
|
@@ -241,7 +326,7 @@ class TranscriptExpressionHandler(GenomicLRATaskHandler):
|
|
| 241 |
}
|
| 242 |
key += 1
|
| 243 |
logger.info(
|
| 244 |
-
f"filtering out {len(
|
| 245 |
f"elements from the dataset"
|
| 246 |
)
|
| 247 |
|
|
|
|
| 32 |
logger = logging.getLogger("multi_omics_transcript_expression")
|
| 33 |
logger.setLevel("INFO")
|
| 34 |
|
| 35 |
+
LABELS_V1 = [
|
| 36 |
+
"Adipose Tissue",
|
| 37 |
+
"Adrenal Gland",
|
| 38 |
+
"Bladder",
|
| 39 |
+
"Blood",
|
| 40 |
+
"Blood Vessel",
|
| 41 |
+
"Brain",
|
| 42 |
+
"Breast",
|
| 43 |
+
"Cervix Uteri",
|
| 44 |
+
"Colon",
|
| 45 |
+
"Esophagus",
|
| 46 |
+
"Fallopian Tube",
|
| 47 |
+
"Heart",
|
| 48 |
+
"Kidney",
|
| 49 |
+
"Liver",
|
| 50 |
+
"Lung",
|
| 51 |
+
"Muscle",
|
| 52 |
+
"Nerve",
|
| 53 |
+
"Ovary",
|
| 54 |
+
"Pancreas",
|
| 55 |
+
"Pituitary",
|
| 56 |
+
"Prostate",
|
| 57 |
+
"Salivary Gland",
|
| 58 |
+
"Skin",
|
| 59 |
+
"Small Intestine",
|
| 60 |
+
"Spleen",
|
| 61 |
+
"Stomach",
|
| 62 |
+
"Testis",
|
| 63 |
+
"Thyroid",
|
| 64 |
+
"Uterus",
|
| 65 |
+
"Vagina",
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
LABELS_V2 = [
|
| 69 |
+
"Adipose_Subcutaneous",
|
| 70 |
+
"Adipose_Visceral (Omentum)",
|
| 71 |
+
"Adrenal Gland",
|
| 72 |
+
"Artery_Aorta",
|
| 73 |
+
"Artery_Coronary",
|
| 74 |
+
"Artery_Tibial",
|
| 75 |
+
"Bladder",
|
| 76 |
+
"Brain_Amygdala",
|
| 77 |
+
"Brain_Anterior cingulate cortex (BA24)",
|
| 78 |
+
"Brain_Caudate (basal ganglia)",
|
| 79 |
+
"Brain_Cerebellar Hemisphere",
|
| 80 |
+
"Brain_Cerebellum",
|
| 81 |
+
"Brain_Cortex",
|
| 82 |
+
"Brain_Frontal Cortex (BA9)",
|
| 83 |
+
"Brain_Hippocampus",
|
| 84 |
+
"Brain_Hypothalamus",
|
| 85 |
+
"Brain_Nucleus accumbens (basal ganglia)",
|
| 86 |
+
"Brain_Putamen (basal ganglia)",
|
| 87 |
+
"Brain_Spinal cord (cervical c-1)",
|
| 88 |
+
"Brain_Substantia nigra",
|
| 89 |
+
"Breast_Mammary Tissue",
|
| 90 |
+
"Cells_Cultured fibroblasts",
|
| 91 |
+
"Cells_EBV-transformed lymphocytes",
|
| 92 |
+
"Cervix_Ectocervix",
|
| 93 |
+
"Cervix_Endocervix",
|
| 94 |
+
"Colon_Sigmoid",
|
| 95 |
+
"Colon_Transverse",
|
| 96 |
+
"Esophagus_Gastroesophageal Junction",
|
| 97 |
+
"Esophagus_Mucosa",
|
| 98 |
+
"Esophagus_Muscularis",
|
| 99 |
+
"Fallopian Tube",
|
| 100 |
+
"Heart_Atrial Appendage",
|
| 101 |
+
"Heart_Left Ventricle",
|
| 102 |
+
"Kidney_Cortex",
|
| 103 |
+
"Kidney_Medulla",
|
| 104 |
+
"Liver",
|
| 105 |
+
"Lung",
|
| 106 |
+
"Minor Salivary Gland",
|
| 107 |
+
"Muscle_Skeletal",
|
| 108 |
+
"Nerve_Tibial",
|
| 109 |
+
"Ovary",
|
| 110 |
+
"Pancreas",
|
| 111 |
+
"Pituitary",
|
| 112 |
+
"Prostate",
|
| 113 |
+
"Skin_Not Sun Exposed (Suprapubic)",
|
| 114 |
+
"Skin_Sun Exposed (Lower leg)",
|
| 115 |
+
"Small Intestine_Terminal Ileum",
|
| 116 |
+
"Spleen",
|
| 117 |
+
"Stomach",
|
| 118 |
+
"Testis",
|
| 119 |
+
"Thyroid",
|
| 120 |
+
"Uterus",
|
| 121 |
+
"Vagina",
|
| 122 |
+
"Whole Blood",
|
| 123 |
+
]
|
| 124 |
+
|
| 125 |
|
| 126 |
class GenomicLRATaskHandler(ABC):
|
| 127 |
"""
|
|
|
|
| 285 |
)
|
| 286 |
self.reference_genome = Fasta(reference_genome_file, one_based_attributes=False)
|
| 287 |
|
| 288 |
+
self.df_csv_file = dl_manager.download_and_extract(
|
| 289 |
+
"transcript_expression/GTEx_df_v1.csv"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
)
|
| 291 |
|
| 292 |
return super().split_generators(dl_manager, cache_dir_root)
|
|
|
|
| 297 |
and the corresponding labels. The sequences are padded to the correct sequence
|
| 298 |
length and standardized before returning.
|
| 299 |
"""
|
| 300 |
+
df = pd.read_csv(self.df_csv_file)
|
| 301 |
+
labels_name = LABELS_V1
|
|
|
|
| 302 |
|
| 303 |
+
split_df = df.loc[df["split"] == split]
|
| 304 |
|
| 305 |
key = 0
|
| 306 |
+
for idx, coordinates_row in split_df.iterrows():
|
| 307 |
start = coordinates_row["position"] - 1 # -1 since vcf coords are 1-based
|
| 308 |
|
| 309 |
chromosome = coordinates_row["chr"]
|
| 310 |
+
labels_row = coordinates_row.iloc[LABELS_V1]
|
| 311 |
padded_sequence = pad_sequence(
|
| 312 |
chromosome=self.reference_genome[chromosome],
|
| 313 |
start=start,
|
|
|
|
| 326 |
}
|
| 327 |
key += 1
|
| 328 |
logger.info(
|
| 329 |
+
f"filtering out {len(split_df)-key} "
|
| 330 |
f"elements from the dataset"
|
| 331 |
)
|
| 332 |
|
transcript_expression/transcript_coordinates.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:6a5ee8afeb870a22e4bc6cef3de694c4107571972f10efe52788122bb87b6820
|
| 3 |
-
size 5237763
|
|
|
|
|
|
|
|
|
|
|
|