hdallatorre
commited on
Commit
•
1eb5300
1
Parent(s):
652fa59
feat: Add the rest of the downstream tasks
Browse files- H3/test.fna +3 -0
- H3/train.fna +3 -0
- H3K14ac/test.fna +3 -0
- H3K14ac/train.fna +3 -0
- H3K36me3/test.fna +3 -0
- H3K36me3/train.fna +3 -0
- H3K4me1/test.fna +3 -0
- H3K4me1/train.fna +3 -0
- H3K4me2/test.fna +3 -0
- H3K4me2/train.fna +3 -0
- H3K4me3/test.fna +3 -0
- H3K4me3/train.fna +3 -0
- H3K79me3/test.fna +3 -0
- H3K79me3/train.fna +3 -0
- H3K9ac/test.fna +3 -0
- H3K9ac/train.fna +3 -0
- H4/test.fna +3 -0
- H4/train.fna +3 -0
- H4ac/test.fna +3 -0
- H4ac/train.fna +3 -0
- enhancers/test.fna +3 -0
- enhancers/train.fna +3 -0
- nucleotide_transformer_downstream_tasks.py +37 -18
- promoter_no_tata/test.fna +3 -0
- promoter_no_tata/train.fna +3 -0
- promoter_tata/test.fna +3 -0
- promoter_tata/train.fna +3 -0
- splice_sites_acceptors/test.fna +3 -0
- splice_sites_acceptors/train.fna +3 -0
- splice_sites_all/test.fna +3 -0
- splice_sites_all/train.fna +3 -0
- splice_sites_donors/test.fna +3 -0
- splice_sites_donors/train.fna +3 -0
H3/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b3a01d0ef1c7b93d7429ef492d322db57a128ec16e4e7cf8c29a39d5f5bfbb70
|
3 |
+
size 781962
|
H3/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:99d0be089142d7759292ac7198548adf35736b56a654764225e52db362c15b89
|
3 |
+
size 7039208
|
H3K14ac/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d8c31dd7c996206bdd637dfad09b78d050f6a7db13019795c4d334feba5a19dc
|
3 |
+
size 1729036
|
H3K14ac/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6fe56532376cc39310c29bb78c8031539ec71352507f20f139537fab362bf437
|
3 |
+
size 15560611
|
H3K36me3/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c05eb6567706f067f45db7388d509c7e4fbeadb9363898801183ff6db43e40a4
|
3 |
+
size 1824680
|
H3K36me3/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3b309ff7dbdc3f69bcf605d27416f2e7ccfbf91cf2e09ac90d66f030858e3ab
|
3 |
+
size 16425059
|
H3K4me1/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b67be75b83710f2d5813edc0fa99ffd7285aeb9a958e9fcbe0e797b3bd2ce35
|
3 |
+
size 1657511
|
H3K4me1/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7931757559723875235693e0abae6f37a0f73d4451aec62ac62f87dfc136f96f
|
3 |
+
size 14917250
|
H3K4me2/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3dcce00ac16f1b259e0527b4993ac5ddfd9715cf8c43d0dfab142ce9dc29159d
|
3 |
+
size 1606145
|
H3K4me2/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd0434b71b3d14128b1304b1a6c8700a3bcafa2645aa0f770763a2e37fbe0d0d
|
3 |
+
size 14451116
|
H3K4me3/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:29a340db0b4b9d4521a6d8132754159e1a11d22a10964fc81fa89aad70f19b2d
|
3 |
+
size 1925372
|
H3K4me3/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e75d43093a1083f4f80c04d5da952648c72f1e7fc1248435b5a22715e593a347
|
3 |
+
size 17327517
|
H3K79me3/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:16239b4452d2a84450b9592d69749a2721addadc7a724f345e28fb47908a055f
|
3 |
+
size 1508653
|
H3K79me3/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:748cf5e04f9cbcb41c912f43d5e42eb58c9f428cd9cfe8ab05f81f5ade598c62
|
3 |
+
size 13576486
|
H3K9ac/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9bef89e78c65752edf85d7e385abf44846769d118bd13cb7b08e1cfa5c78d16
|
3 |
+
size 1453687
|
H3K9ac/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fbe3fe65f1426735582f8f5124b4873bad50aa0bf9af1e3287839620d8a3e751
|
3 |
+
size 13078023
|
H4/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c74c0cbe936dd3e5237fd5752e260d1bd5cb6bac93360969b22c3dc45b5b5fdb
|
3 |
+
size 763348
|
H4/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b3ee5ed8dd92f30d3d92af487aabcd56c21228ccc39790771e6ee7e06ed760a5
|
3 |
+
size 6865024
|
H4ac/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:814bd5d0ce5433e470f2576cf971d441dcd5e8590037b7a8f207a3ea77cdcec3
|
3 |
+
size 1783953
|
H4ac/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0fd3b74cdc9f2bca143f4735ddc3be98f7aea91952f69f11e0f559618138f9f3
|
3 |
+
size 16053328
|
enhancers/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cacdf6d1bede9b0154586e66a9e7801ca345f38324d7f485ace2f6afd181c9de
|
3 |
+
size 83200
|
enhancers/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64f79a265db7181136f8af72207fbe1d9046863e8f9ab0d5e53b7e14544a4593
|
3 |
+
size 3102309
|
nucleotide_transformer_downstream_tasks.py
CHANGED
@@ -16,6 +16,7 @@
|
|
16 |
Transformer paper."""
|
17 |
|
18 |
from typing import List
|
|
|
19 |
import datasets
|
20 |
from Bio import SeqIO
|
21 |
|
@@ -42,8 +43,24 @@ _HOMEPAGE = "https://github.com/instadeepai/nucleotide-transformer"
|
|
42 |
_LICENSE = "https://github.com/instadeepai/nucleotide-transformer/LICENSE.md"
|
43 |
|
44 |
_TASKS = [
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
]
|
48 |
|
49 |
|
@@ -58,7 +75,7 @@ class NucleotideTransformerDownstreamTasksConfig(datasets.BuilderConfig):
|
|
58 |
"""
|
59 |
super().__init__(
|
60 |
*args,
|
61 |
-
name=f
|
62 |
**kwargs,
|
63 |
)
|
64 |
self.task = task
|
@@ -94,25 +111,27 @@ class NucleotideTransformerDownstreamTasks(datasets.GeneratorBasedBuilder):
|
|
94 |
citation=_CITATION,
|
95 |
)
|
96 |
|
97 |
-
def _split_generators(
|
|
|
|
|
98 |
|
99 |
-
train_file = dl_manager.download_and_extract(self.config.task +
|
100 |
-
test_file = dl_manager.download_and_extract(self.config.task +
|
101 |
|
102 |
return [
|
103 |
-
datasets.SplitGenerator(
|
104 |
-
|
105 |
-
|
106 |
-
datasets.SplitGenerator(
|
107 |
-
|
108 |
-
|
109 |
]
|
110 |
|
111 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
112 |
def _generate_examples(self, file):
|
113 |
key = 0
|
114 |
-
with open(file,
|
115 |
-
fasta_sequences = SeqIO.parse(f,
|
116 |
|
117 |
for record in fasta_sequences:
|
118 |
|
@@ -122,8 +141,8 @@ class NucleotideTransformerDownstreamTasks(datasets.GeneratorBasedBuilder):
|
|
122 |
|
123 |
# yield example
|
124 |
yield key, {
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
}
|
129 |
-
key += 1
|
|
|
16 |
Transformer paper."""
|
17 |
|
18 |
from typing import List
|
19 |
+
|
20 |
import datasets
|
21 |
from Bio import SeqIO
|
22 |
|
|
|
43 |
_LICENSE = "https://github.com/instadeepai/nucleotide-transformer/LICENSE.md"
|
44 |
|
45 |
_TASKS = [
|
46 |
+
"H4ac",
|
47 |
+
"H3K36me3",
|
48 |
+
"splice_sites_donors",
|
49 |
+
"splice_sites_acceptors",
|
50 |
+
"H3",
|
51 |
+
"H4",
|
52 |
+
"H3K4me3",
|
53 |
+
"splice_sites_all",
|
54 |
+
"H3K4me1",
|
55 |
+
"H3K14ac",
|
56 |
+
"enhancers_types",
|
57 |
+
"promoter_no_tata",
|
58 |
+
"H3K79me3",
|
59 |
+
"H3K4me2",
|
60 |
+
"promoter_tata",
|
61 |
+
"enhancers",
|
62 |
+
"H3K9ac",
|
63 |
+
"promoter_all",
|
64 |
]
|
65 |
|
66 |
|
|
|
75 |
"""
|
76 |
super().__init__(
|
77 |
*args,
|
78 |
+
name=f"{task}",
|
79 |
**kwargs,
|
80 |
)
|
81 |
self.task = task
|
|
|
111 |
citation=_CITATION,
|
112 |
)
|
113 |
|
114 |
+
def _split_generators(
|
115 |
+
self, dl_manager: datasets.DownloadManager
|
116 |
+
) -> List[datasets.SplitGenerator]:
|
117 |
|
118 |
+
train_file = dl_manager.download_and_extract(self.config.task + "/train.fna")
|
119 |
+
test_file = dl_manager.download_and_extract(self.config.task + "/test.fna")
|
120 |
|
121 |
return [
|
122 |
+
datasets.SplitGenerator(
|
123 |
+
name=datasets.Split.TRAIN, gen_kwargs={"file": train_file}
|
124 |
+
),
|
125 |
+
datasets.SplitGenerator(
|
126 |
+
name=datasets.Split.TEST, gen_kwargs={"file": test_file}
|
127 |
+
),
|
128 |
]
|
129 |
|
130 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
131 |
def _generate_examples(self, file):
|
132 |
key = 0
|
133 |
+
with open(file, "rt") as f:
|
134 |
+
fasta_sequences = SeqIO.parse(f, "fasta")
|
135 |
|
136 |
for record in fasta_sequences:
|
137 |
|
|
|
141 |
|
142 |
# yield example
|
143 |
yield key, {
|
144 |
+
"sequence": sequence,
|
145 |
+
"name": name,
|
146 |
+
"label": label,
|
147 |
}
|
148 |
+
key += 1
|
promoter_no_tata/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e120603363d95bec7d20d7080811a5a050bd8822d15bbdbd03453777bb7d2b4e
|
3 |
+
size 1735000
|
promoter_no_tata/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64e3e5854d3ccaa73019b57d512a0456bb13aa30e11f94cd3376f4df7dd10acf
|
3 |
+
size 15639842
|
promoter_tata/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ed240f79b44da05a8d0d97a5ab25a9dfa84970d61032917424c44ab74cef3e7
|
3 |
+
size 201322
|
promoter_tata/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:33d784be320898fb0f1c383d32f5139b6432849ed6e4b02977fccd60b4978ca5
|
3 |
+
size 1785916
|
splice_sites_acceptors/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:50a001ffc04fb2e966990c8bd935932751b355e6fb7cfbdde2cb2b00073daa2e
|
3 |
+
size 1374264
|
splice_sites_acceptors/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5b9dd4aede601bb93cfd1c1c68b7b8c94d8230c937dbc036417cf89e71c573e9
|
3 |
+
size 12368180
|
splice_sites_all/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d6af1ceac271adb14c2c63193d31891f52d4125f7279971f4129bdd16ef13143
|
3 |
+
size 1237890
|
splice_sites_all/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dbb443646d1030b148bde60d17d265e0e6650c61ed535c0b9bc3a8cff607f5a9
|
3 |
+
size 11160380
|
splice_sites_donors/test.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80fb6b30f56c5cc676b268ba4d9978a5ae152f172711b7d0ced17284ab8a94c7
|
3 |
+
size 1361951
|
splice_sites_donors/train.fna
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:073b0c824b36e302564f38b8ecbcaa4ee2fcf2cb6730df0b7549bf467af6376e
|
3 |
+
size 12253452
|