-
Notifications
You must be signed in to change notification settings - Fork 1
/
riceKBpipeline.py
320 lines (227 loc) · 12.5 KB
/
riceKBpipeline.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#!/usr/bin/env python
import glob
from riceKB import uniprotToRDF
from Bio.UniProt import GOA
import pprint
#from riceKB import * #southGreenParsers #oryzaBaseParser gafToRDF grameneParsers TairParser grameneParsers
#import riceKB
import os
import re
# from riceKB import gafToRDF, grameneParsers, oryzaBaseParser, TairParser,\
# southGreenParsers, uniprotToRDF, TropgeneParser, TropgeneModel, gffParser, os_japonicaModel, \
# os_indicaModel, a_thalianaModel, sniplayPaserModel, vineModel #
#from riceKB.oryzaBaseParser import oryzaBaseParser
from riceKB import grameneParsers
#ROOT_DIR='/Volumes/LaCie/AGROLD/agroLD_data_update_mai_2017'
ROOT_DIR='/Users/plarmande/Downloads'
'''
Input directory path
'''
'''
Ontology association directory/files
'''
#eco_map_file = '/home/venkatesan/workspace/explore/test_files/ontology_associations/gaf-eco-mapping.txt'
# prot_assoc_test_dir = '/test_files/ontology_associations/protein_associations/*.*'
# gene_assoc_test_dir = '/test_files/ontology_associations/gene_associations/*.*'
# qtl_assoc_test_dir = '/test_files/ontology_associations/qtl_associations/*.*'
#aracyc_file = '/home/venkatesan/workspace/explore/test_files/tair/aracyc/aracyc_pathways.20130709.txt'
#protein_assoc_dir = '/media/sf_F_DRIVE/IBC/argoLD_project/data/ontology_associations/protein/*.*' # /home/venkatesan/workspace/argoLD_project/data/ontology_associations/protein
#gene_assoc_dir = '/home/venkatesan/workspace/argoLD_project/data/ontology_associations/gene/*.*'
#qtl_assoc_dir = '/media/sf_F_DRIVE/IBC/argoLD_project/data/ontology_associations/qtl/*.*'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
INPUT FILE
'''
eco_map_file = '/AgroLD_ETL/test_files/ontology_associations/gaf-eco-mapping.txt'
protein_assoc_dir = '/data/ontology_associations/protein/*.*' # /home/venkatesan/workspace/argoLD_project/data/ontology_associations/protein
gene_assoc_dir = '/data/ontology_associations/gene/*.*'
qtl_assoc_dir = 'data/ontology_associations/qtl/*.*'
'''
Gramene genes and QTL directory/files
'''
##gramene_g_test_dir = '/home/venkatesan/workspace/explore/test_files/gramene_genes/*.txt' #*.txt Oryza_sativa_japonica.txt' #meridionalis barthii sativa_indica sativa_japonica
# gramene_qtl_test_file = '/test_files/gramene_qtl/Rice_QTL.dat'
##gramene_genes_files = '/media/sf_F_DRIVE/IBC/argoLD_project/data/gramene_genes/*.txt'
#gramene_qtl_file = '/media/sf_F_DRIVE/IBC/argoLD_project/data/gramene_qtl/Rice_QTL.dat'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
INPUT FILE
'''
gramene_genes_files = ROOT_DIR + '/data/gramene_genes/Oryza meridionalis.txt' #*.txt Oryza_sativa_japonica.txt' #meridionalis barthii sativa_indica sativa_japonica
gramene_qtl_file = ROOT_DIR + '/data/gramene_qtl/Rice_QTL.dat'
'''
OryzaBaseDB
'''
# oryzabase_test_file = '/home/venkatesan/workspace/explore/test_files/oryzabase_genes/OryzabaseGeneListEn_20140621.txt'
oryzabase_file = 'data/oryzabase/*.txt' #'data/oryzabase/OryzabaseGeneListEn_20141206.txt'
'''
AraCyc
'''
# aracyc_test_file = '/home/venkatesan/workspace/explore/test_files/tair/aracyc/aracyc_pathways.20130709.txt'
aracyc_file = '/data/tair/aracyc/aracyc_pathways.20130709'
'''
RiceCyc
'''
# ricecyc_test_dir = '/home/venkatesan/workspace/explore/test_files/gramene_ricecyc/*.tab'
ricecyc_file = '/data/ricecyc/*.tab'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
INPUT FILE
'''
# ricecyc_file = '/media/elhassouni/donnees/Noeud-plante-projet/argoLD_project_all_data/data/ricecyc/*.tab'
'''
OryzaTagLine input
'''
# otl_test_inputfile = '/home/venkatesan/workspace/explore/test_files/oryzaTagLine/OTL_export_pheno+trait.csv'
otl_inputfile = '/data/southgreen/oryzatagline/OTL_export_pheno+trait.csv'
'''
UniProt input
'''
# up_test_dir = '/home/venkatesan/workspace/explore/test_files/uniprot/*.dat'
up_dir = '/Volumes/LaCie/AGROLD/agroLD_data_update_mai_2017/data/uniprot/*.dat'
#########################################################
'''
Output file path - RDF files - turtle syntax
'''
'''
Ontology association files
'''
prot_test_output = '/home/venkatesan/workspace/explore/rdf_ttl/associations_ttl/protein_associations.ttl'
gene_test_output = '/home/venkatesan/workspace/explore/rdf_ttl/associations_ttl/gene_associations.ttl'
qtl_test_output = '/home/venkatesan/workspace/explore/rdf_ttl/associations_ttl/qtl_associations.ttl'
#protein_assoc_ttl = '/media/sf_F_DRIVE/IBC/argoLD_project/rdf/ontology_associations_ttl/protein_ttl/protein_associations.ttl'
gene_assoc_ttl = '/home/venkatesan/workspace/argoLD_project/rdf/ontology_associations_ttl/gene_ttl/gene_associations.ttl'
#qtl_assoc_ttl = '/media/sf_F_DRIVE/IBC/argoLD_project/rdf/ontology_associations_ttl/qtl_ttl/qtl_associations.ttl'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
INPUT FILE
'''
protein_assoc_ttl = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/ontology_associations_ttl/protein_ttl/protein_associations.ttl'
qtl_assoc_ttl = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/ontology_associations_ttl/qtl_ttl/qtl_associations.ttl'
'''
Gramene genes/QTL files
'''
genomes_rdf_test_out = '/home/venkatesan/workspace/explore/rdf_ttl/gramene_genome_ttl/'
gramene_qtl_test_out = '/home/venkatesan/workspace/explore/rdf_ttl/gramene_qtl_ttl/'
##gramene_genes_out = '/media/sf_F_DRIVE/IBC/argoLD_project/rdf/gramene_genes_ttl/'
#gramene_qtl_out = '/media/sf_F_DRIVE/IBC/argoLD_project/rdf/gramene_qtl_ttl/'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
'''
gramene_genes_out = ROOT_DIR + '/rdf/gramene_genes_ttl/'
gramene_qtl_out = ROOT_DIR + '/rdf/gramene_qtl_ttl/'
'''
OryzaBaseDB file
'''
# oryzaBase_test_output = '/home/venkatesan/workspace/explore/rdf_ttl/oryzabase_ttl/oryzabase_genes.ttl'
oryzaBase_output = ROOT_DIR + '/rdf/oryzabase_ttl/oryzabase_genes.ttl'
#oryzaBase_output = '/home/venkatesan/Documents/data_samples/oryzabase/oryzabase_genes.ttl'
'''
AraCyc
'''
aracyc_test_output = ROOT_DIR + '/rdf/tair_ttl/aracyc/'
aracyc_output = ROOT_DIR + '/rdf/tair_ttl/aracyc_ttl/'
'''
RiceCyc
'''
ricecyc_test_output = '/rdf_ttl/gramene_ricecyc_ttl/'
#ricecyc_output = '/media/sf_F_DRIVE/IBC/argoLD_project/rdf/cyc_ttl/'
'''
Nouveau path pour reexecuter les fichier avc la nouvelle demande de Aravind et Pierre
'''
ricecyc_output = ROOT_DIR + '/rdf/cyc_ttl/'
'''
OryzaTagLine
'''
otl_test_output = '/rdf_ttl/southgreen/oryzaTagLine/otl.ttl'
otl_output = ROOT_DIR + '/rdf/southgreen/oryzatagline_ttl/otl.ttl'
'''
UniprotKB
'''
up_test_output = ROOT_DIR + '/rdf_ttl/uniprot_ttl/'
up_output = ROOT_DIR + '/rdf/uniprot_ttl/'
up_output = '/Users/plarmande/Downloads'
pp = pprint.PrettyPrinter(indent=4)
#prot_gaf_files = glob.glob(protein_assoc_dir) #gene_assoc_dir stores file names(with the full path) as a list
#prot_gaf_files = glob.glob(prot_assoc_test_dir) #gene_assoc_dir stores file names(with the full path) as a list
#gene_gaf_files = glob.glob(gene_assoc_dir)
#gene_gaf_files = glob.glob(gene_assoc_input_dir)
#qtl_gaf_files = glob.glob(qtl_assoc_dir)
#goa = gafToRDF
#print "************** Protein-ontology associations *************\n"
#mapping = goa.gafEcoMap(eco_map_file)
#goa.allGafRDF(prot_gaf_files, prot_output_file, 'qtl') #
#goa.ProteinGafRDF(prot_gaf_files, mapping, protein_assoc_ttl) # allGafRDF(prot_gaf_files, protein_assoc_ttl, 'protein')
#print "************** Protein-ontology associations RDF converted *************\n\n"
#print "************** QTL-ontology associations *************\n"
#goa.allGafRDF(qtl_gaf_files, mapping, qtl_assoc_ttl, 'qtl')
#print "************** QTL-ontology associations RDF converted *************\n\n"
#gaf_eco_file = '/home/venkatesan/workspace/explore/test_files/ontology_associations/gaf-eco-mapping.txt'
#goa = gafToRDF
#ds = goa.gafEcoMap(gaf_eco_file)
#pp.pprint(mapping)
#gramene_genomes = glob.glob(gramene_genes_files) #gramene_genes_files
#g_parse = grameneParsers#oryzaBaseParser
#print "***************** Gramene Genes data ********************\n"
#g_parse = grameneParsers
#input_f = '/Oryza brachyantha.txt' #Oryza_barthii.txt' Oryza_sativa_japonica
#input_f = '/home/venkatesan/workspace/explore/test_files/gramene_genes/Oryza_brachyantha.txt' #Oryza_barthii.txt' Oryza_sativa_japonica
#geneHash = g_parse.geneParser(gramene_genomes)#grameneQTLRDF(gramene_qtl_dir, gramene_qtl_out) oryzaBaseRDF(oryzabase_file, oryzaBase_output) grameneGeneRDF(gramene_genomes, gramene_genes_out)
#pp.pprint(geneHash)
#g_parse.grameneGeneRDF(gramene_genomes, gramene_genes_out)
#print "********************************************************\n\n"
#print "*************** Gramene QTL data ***************\n"
#g_parse.grameneQTLRDF(gramene_qtl_file, gramene_qtl_out) #gramene_qtl_file, gramene_qtl_out gramene_qtl_test_file, gramene_qtl_test_out
#print "***********************************************\n\n"
#print "*********** Cyc data *************\n"
#pw_files = glob.glob(ricecyc_file)
#ricecyc_ds = g_parse.CycParser(pw_files) # ricecyc_test_file ricecyc_file
#pp.pprint(ricecyc_ds)
#g_parse.CycRDF(ricecyc_ds, ricecyc_output) #ricecyc_test_output ricecyc_output
#print "*************************************\n\n"
#print "************ OryzaTagLine data **************\n"
#southG = southGreenParsers
#oryzaTag_ds = southG.otlParser(otl_inputfile) #otl_test_inputfile otl_inputfile
#pp.pprint(oryzaTag_ds)
#southG.otlRDF(oryzaTag_ds, otl_output)#otl_test_output otl_output
#print "********************************************\n\n"
#UniPort********
up_files = glob.glob(up_dir)#up_dir up_test_dir
print "*********** Uniprot data *************\n"
up_converter = uniprotToRDF
up_converter.upToRDF(up_files, up_output)#up_output up_test_output
print "********************************************\n\n"
# '''
# print "************ TropGene data **************\n"
# path = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/test_files/tropGene/rice.csv' # The input
# path_output = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/southgreen/tropgene.rice.ttl' # The output
# ds = TropgeneModel.tropGeneParser(path)# The parsing file withe tropGeneParser()
# pp.pprint(ds) # For to see in teminal the parsing
# TropgeneModel.tropGeneToRDF(ds, path_output) # The tranformation fonction tropGeneToRdf(input, output)
# '''
#print "************ OS.Japonica data orygene_db **************\n"
#path = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/test_files/orygenes_db/os.japonicaCancat_test.gff3' # The input
#path = '/media/elhassouni/donnees/Noeud-plante-projet/orygeneDB_model_data/gff_data_orygeneDB/os_japonica/os_indicaCancat.gff3'
#path_output = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/southgreen/os.japonica.ttl' # The output
#ds = gffParser.parseGFF3(path) # The parsing file withe tropGeneParser()
#pp.pprint(ds) # For to see in teminal the parsing
#os_japonicaModel.os_indicaModeleRDF(ds, path_output)
#print "************ OS.Indica data orygene_db **************\n"
#path = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/test_files/orygenes_db/os.indicaCancat_Test.gff3' # The input
#path = '/media/elhassouni/donnees/Noeud-plante-projet/orygeneDB_model_data/gff_data_orygeneDB/os_indica_gff3/indicaCant.gff3'
#path_output = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/southgreen/os.indica.ttl' # The output
#ds = gffParser.parseGFF3(path) # The parsing file withe tropGeneParser()
#pp.pprint(ds) # For to see in teminal the parsing
#os_indicaModel.os_indicaModeleRDF(ds, path_output)
#print "************ A.thaliana data orygene_db **************\n"
#path = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/test_files/orygenes_db/a.thalianaCancat_test.gff3' # The input
#path = '/media/elhassouni/donnees/Noeud-plante-projet/orygeneDB_model_data/gff_data_orygeneDB/a.thaliana/a.thalianaCat.gff3' # The input
#path_output = '/home/elhassouni/Bureau/RDF_DATA_REALEASE/rdf/southgreen/a.thaliana.ttl' # The output
#ds = gffParser.parseGFF3(path)
#pp.pprint(ds) # For to see in teminal the parsing
#a_thalianaModel.a_thalianaModeleRDF(ds, path_output)
##print "************ Sniplay datasniplay_db **************\n"
#path = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/test_files/sniplay_db/sniplay_test.txt'
#path_output = '/media/elhassouni/donnees/Noeud-plante-projet/workspace/AgroLD/AgroLD_ETL/rdf_ttl/sniplay_db_ttl/sniplay.ttl' # The output
#sniplayPaserModel.sniplayPaserModel()
##print "************ A.thaliana data orygene_db **************\n"