-
Notifications
You must be signed in to change notification settings - Fork 0
/
tripal_sra.module
executable file
·666 lines (622 loc) · 26.6 KB
/
tripal_sra.module
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
<?php
/**
* @file
* Basic functionality for the tripal analysis expression module.
*/
/**
* @defgroup tripal_analysis_expression Tripal Analysis Expression
* @ingroup tripal_modules *** is this right?
* @{
* Integrates the several tables from the Chado Mage module with
* the Analysis module.
* @}
*/
require_once "api/tripal_sra.api.inc";
require_once "includes/tripal_sra.chado.node.inc";
// change keyword biomaterial to biosample for:
// 1: not conflict with tripal_analysis_expression
// 2: consistant with SRA database
require_once "api/tripal_bioproject.api.inc";
require_once "includes/tripal_biosample.chado_node.inc";
require_once "includes/tripal_biosample.admin.inc";
require_once "includes/tripal_biosample_loader.inc";
// node bioproject
require_once "includes/tripal_bioproject.chado_node.inc";
require_once "includes/tripal_bioproject.admin.inc";
// node experiment
require_once "includes/tripal_experiment.chado_node.inc";
require_once "includes/tripal_experiment.admin.inc";
require_once "includes/tripal_experiment_loader.inc";
// theme preprocessing
require_once "theme/tripal_sra.theme.inc";
/**
* Implements hook_help().
*
* Display help and module information.
*
* @ingroup tripal_analysis_expression
*/
function tripal_sra_help($path, $arg) {
switch ($path) {
// Both of the following cases should display the below HTML.
case 'admin/tripal/extension/tripal_analysis_expression/help' :
case 'admin/help#tripal_analysis_expression' : {
$ret_val = '<h3>' . t('Module Content Types') . '</h3>';
$ret_val .= '<p>' . t('The expression module allows the user to load and display expression information.') . '</p>';
$ret_val .= "<b>" . t("Analysis: Expression") . "</b> - " . t("This analysis: expression content type") . " ";
$ret_val .= t("provides the ability") . " ";
$ret_val .= t("to describe either microarray expression data or next generation sequencing") . " ";
$ret_val .= t("expression data (such as data obtained from RNASeq). The analysis: expression content") . " ";
$ret_val .= t("type also provides a") . " ";
$ret_val .= t("form to load expression data associated with the analysis.") . "<br>";
$ret_val .= l(t("Analysis: Expression Administrative Pages"), "admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression");
$ret_val .= "<br>" . l(t("Create Analysis: Expression"), "node/add/chado-analysis-expression");
$ret_val .= "<br>" . l(t("Analysis: Expression Help"), "admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/help");
$ret_val .= "<br><br><b>" . t("Biomaterial") . "</b> - " . t("The biomaterial content type") . " ";
$ret_val .= t("represents the Chado biomaterial table. The Chado biomaterial table is a member") . " ";
$ret_val .= t("of the Chado MAGE module. The biomaterial content type is similar to the") . " ";
$ret_val .= l(t("BioSample"), "http://www.ncbi.nlm.nih.gov/books/NBK169436/") . " ";
$ret_val .= t("content type provided by NCBI. See the biomaterial description at the") . " ";
$ret_val .= l(t("GMOD wiki."), "http://gmod.org/wiki/Chado_Mage_Module#Table:_biomaterial") . "<br>";
$ret_val .= l(t("Biomaterial Administrative Pages"), "admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial");
$ret_val .= "<br>" . l(t("Create Biomaterial"), "node/add/chado-biomaterial");
$ret_val .= "<br>" . l(t("Biomaterial Help"), "admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/help");
$ret_val .= "<br><br><b>" . t("Array Design") . "</b> - " . t("The array design content type") . " ";
$ret_val .= t("represents the Chado arraydesign table. This table is only used when describing") . " ";
$ret_val .= t("the experimental design of data collected from a microarray expression experiment.") . " ";
$ret_val .= t("See the arraydesign description at the");
$ret_val .= l(t(" GMOD wiki."), "http://gmod.org/wiki/Chado_Mage_Module#Table:_arraydesign") . "<br>";
$ret_val .= l(t("Array Design Administrative Pages"), "admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign");
$ret_val .= "<br>" . l(t("Create Array Design"), "node/add/chado-arraydesign");
$ret_val .= "<br>" . l(t("Array Design Help"), "admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/help");
$ret_val .= "<br><br><b>" . t("Protocol") . "</b> -" . t(" The protocol content type represents") . " ";
$ret_val .= t("the Chado protocol table. This table is used to describe the protocol, software,") . " ";
$ret_val .= t("and hardware used in different steps of the experiment. See the protocol description at the") . " ";
$ret_val .= l(t("GMOD wiki."), "http://gmod.org/wiki/Chado_Tables#Table:_protocol") . "<br>";
$ret_val .= l(t("Protocol Administrative Pages"), "admin/tripal/extension/tripal_analysis_expression/content_types/protocol");
$ret_val .= "<br>" . l(t("Create Protocol"), "node/add/chado-protocol") . "<br>";
$ret_val .= l(t("Protocol Help"), "admin/tripal/extension/tripal_analysis_expression/content_types/protocol/help");
$ret_val .= '<h3>' . t('Module Data Loaders') . '</h3>';
$ret_val .= "<p>" . t("This module provides several data loaders.") . '</p>';
$ret_val .= "<b>" . l(t("Biomaterial Loader"), "admin/tripal/extension/tripal_analysis_expression/biomaterial_loader");
$ret_val .= "</b> - " . t("The biomaterial loader has the ability to load ");
$ret_val .= l(t("BioSample"), "http://www.ncbi.nlm.nih.gov/biosample/") . t(" data downloaded from NCBI in an xml format. ");
$ret_val .= t("The biomaterial loader can also load data from a CSV or TSV file formatted as a ");
$ret_val .= l(t("BioSample submission template"), "https://submit.ncbi.nlm.nih.gov/biosample/template/") . t(".");
$ret_val .= "<br><br><b>" . l(t("Expression Loader"), "node/add/chado-analysis-expression") . "</b> - ";
$ret_val .= t("The expression loader is associated with the Analysis: Expression ");
$ret_val .= t("content type. To load expression data, create an Analysis: Expression and configure the expression loading job ");
$ret_val .= t("in the Analysis: Expression form. Expression data may be loaded from two types of tab separted formats, ");
$ret_val .= t("a matrix file or a column file.") . "<br><br>";
return $ret_val;
break;
}
}
}
/**
* Implements hook_permission().
*
* Set the permissions types used by the tripal analysis expression module.
* Permissions include: access, create, delete, edit, and administer.
* Permissions are set for the following content types provided by this module:
* Analysis: Expression, Arraydesign, Biomaterial, and Protocol.
*
* @ingroup tripal_analysis_expression
*/
//function tripal_sra_permission() {
/**
return array(
'access chado_analysis_expression content' => array(
'title' => t('View Analysis: Expressions'),
'description' => t('Allow users to view analysis: expression pages.'),
),
'create chado_analysis_expression content' => array(
'title' => t('Create Analysis: Expressions'),
'description' => t('Allow users to create new analysis: expression pages.'),
),
'delete chado_analysis_expression content' => array(
'title' => t('Delete Analysis: Expressions'),
'description' => t('Allow users to delete analysis: expression pages.'),
),
'edit chado_analysis_expression content' => array(
'title' => t('Edit Analysis: Expressions'),
'description' => t('Allow users to edit analysis: expression pages.'),
),
'administer tripal analysis expression' => array(
'title' => t('Administer Analysis: Expressions'),
'description' => t('Allow users to administer all analysis: expressions.'),
),
'access chado_arraydesign content' => array(
'title' => t('View Arraydesigns'),
'description' => t('Allow users to view arraydesign pages.'),
),
'create chado_arraydesign content' => array(
'title' => t('Create Arraydesigns'),
'description' => t('Allow users to create new arraydesign pages.'),
),
'delete chado_arraydesign content' => array(
'title' => t('Delete Arraydesigns'),
'description' => t('Allow users to delete arraydesign pages.'),
),
'edit chado_arraydesign content' => array(
'title' => t('Edit Arraydesigns'),
'description' => t('Allow users to edit arraydesign pages.'),
),
'administer tripal arraydesign' => array(
'title' => t('Administer Arraydesigns'),
'description' => t('Allow users to administer all arraydesigns.'),
),
'access chado_biomaterial content' => array(
'title' => t('View Biomaterials'),
'description' => t('Allow users to view biomaterial pages.'),
),
'create chado_biomaterial content' => array(
'title' => t('Create Biomaterials'),
'description' => t('Allow users to create new biomaterial pages.'),
),
'delete chado_biomaterial content' => array(
'title' => t('Delete Biomaterials'),
'description' => t('Allow users to delete biomaterial pages.'),
),
'edit chado_biomaterial content' => array(
'title' => t('Edit Biomaterials'),
'description' => t('Allow users to edit biomaterial pages.'),
),
'administer tripal biomaterial' => array(
'title' => t('Administer Biomaterials'),
'description' => t('Allow users to administer all biomaterials.'),
),
'access chado_protocol content' => array(
'title' => t('View Protocols'),
'description' => t('Allow users to view protocol pages.'),
),
'create chado_protocol content' => array(
'title' => t('Create Protocols'),
'description' => t('Allow users to create new protocol pages.'),
),
'delete chado_protocol content' => array(
'title' => t('Delete Protocols'),
'description' => t('Allow users to delete protocol pages.'),
),
'edit chado_protocol content' => array(
'title' => t('Edit Protocols'),
'description' => t('Allow users to edit protocol pages.'),
),
'administer tripal protocol' => array(
'title' => t('Administer Protocols'),
'description' => t('Allow users to administer all protocols.'),
),
);
*/
//}
/**
* Implements hook_menu().
*/
function tripal_sra_menu() {
$items = array();
// === main admin page ===.
$items['admin/tripal/extension/tripal_sra'] = array(
'title' => 'Tripal SRA',
'description' => 'A module for management of NGS samples like NCBI SRA.',
'access arguments' => array('administer site configuration'),
);
// === help ===
$items['admin/tripal/extension/tripal_sra/help'] = array(
'title' => 'Tripal SRA Help',
'description' => 'Document for how to use Tripal SRA.',
'access arguments' => array('administer site configuration'),
'weight' => 10,
);
/**
* bioproject (use project module in chado)
*/
$items['admin/tripal/extension/tripal_sra/bioproject'] = array(
'title' => 'SRA BioProject',
'description' => 'A collection of biological data related to a single initiative, originating from a single organization or from a consortium.',
'access arguments' => array('administer site configuration'),
'page callback' => 'tripal_bioproject_admin_bioprojects_view',
'type' => MENU_NORMAL_ITEM,
);
// bioproject settings.
$items['admin/tripal/extension/tripal_sra/bioproject/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal SRA: BioPorject settings and configurations.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_bioproject_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// bioproject TOC.
$items['admin/tripal/extension/tripal_sra/bioproject/chado_bioproject_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for BioProject nodes.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_bioproject'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// bioproject help.
$items['admin/tripal/extension/tripal_sra/bioproject/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal BioProject content type including a short description of it's usage.",
'access arguments' => array('administer site configuration'),
'page callback' => 'theme',
'page arguments' => array('tripal_bioproject_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// bioproject enable view.
$items['admin/tripal/extension/tripal_sra/bioproject/views/bioprojects/enable'] = array(
'title' => 'Enable Biosample Administrative View',
'access arguments' => array('administer site configuration'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_biosample_admin_bioproject',
'tripal_sra',
'admin/tripal/extension/tripal_sra/bioproject',
),
);
/**
* biomaterial (aka biosample in SRA)
*/
$items['admin/tripal/extension/tripal_sra/biosample'] = array(
'title' => 'SRA BioSample',
'description' => 'Descriptions of biological source materials used in experimental assays.',
'access arguments' => array('administer site configuration'),
'page callback' => 'tripal_biosample_admin_biosamples_view',
'type' => MENU_NORMAL_ITEM,
);
// biosample loader from txt file.
$items['admin/tripal/extension/tripal_sra/biosample/biosample_loader'] = array(
'title' => 'Load',
'description' => 'Load biosamples into database from tab delimit file.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biosample_loader'),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// biosample sync node from chado database
$items['admin/tripal/extension/tripal_sra/biosample/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for BioSamples stored in Chado.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_sra',
'chado_biosample',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// biosample TOC.
$items['admin/tripal/extension/tripal_sra/biosample/chado_biosample_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for biosample nodes.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_biosample'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// biosample delete.
$items['admin/tripal/extension/tripal_sra/biosample/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple biosamples from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biosample_delete_form'),
'access arguments' => array('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_sra'),
'file' => 'includes/tripal_biosample.delete.inc',
'weight' => 3,
);
// biosample settings.
$items['admin/tripal/extension/tripal_sra/biosample/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal SRA: Biosample settings and configurations.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biosample_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// biosample help.
$items['admin/tripal/extension/tripal_sra/biosample/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Biosample content type including a short description of it's usage.",
'access arguments' => array('administer site configuration'),
'page callback' => 'theme',
'page arguments' => array('tripal_biosample_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// biosample enable view.
/**
$items['admin/tripal/extension/tripal_sra/biosample/views/biosamples/enable'] = array(
'title' => 'Enable Biosample Administrative View',
'access arguments' => array('administer'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_biosample_admin_biosamples',
'tripal_sra',
'admin/tripal/extension/tripal_sra/biosample',
),
);
*/
/**
* experiment (aka experiment in SRA)
*/
$items['admin/tripal/extension/tripal_sra/experiment'] = array(
'title' => 'SRA Experiment',
'description' => 'SRA Experiment.',
'access arguments' => array('administer site configuration'),
'page callback' => 'tripal_experiment_admin_experiments_view',
'type' => MENU_NORMAL_ITEM,
);
// biosample loader from txt file.
$items['admin/tripal/extension/tripal_sra/experiment/experiment_loader'] = array(
'title' => 'Load',
'description' => 'Load Experiments into database from tab delimit file.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_experiment_loader'),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// biosample sync node from chado database
$items['admin/tripal/extension/tripal_sra/experiment/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for Experiments stored in Chado.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_sra',
'chado_experiment',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// experiment settings.
$items['admin/tripal/extension/tripal_sra/experiment/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal SRA: Experiment settings and configurations.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_experiment_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// experiment TOC.
$items['admin/tripal/extension/tripal_sra/experiment/chado_experiment_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for Experiment nodes.',
'access arguments' => array('administer site configuration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_experiment'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// experiment delete.
$items['admin/tripal/extension/tripal_sra/experiment/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple Experiments from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_experiment_delete_form'),
'access arguments' => array('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_sra'),
'file' => 'includes/tripal_experiment.delete.inc',
'weight' => 3,
);
// experiment help.
$items['admin/tripal/extension/tripal_sra/experiment/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Experiment content type including a short description of it's usage.",
'access arguments' => array('administer site configuration'),
'page callback' => 'theme',
'page arguments' => array('tripal_experiment_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
return $items;
}
/**
* Implements hook_views_api().
*
* Essentially this hook tells drupal that there is views support for
* for this module which then includes tripal_db.views.inc where all the
* views integration code is located.
*
* @ingroup tripal_sra
*/
function tripal_sra_views_api() {
return array(
'api' => 3.0,
);
}
/**
* Implements hook_theme().
*
* This function informs drupal of the themes included in this modules.
* An base, help, and teaser template are included for the four content
* types defined by this module:
analysis: expression, arraydesign,
* biosample, and project. Additional templates include a protocol
* template for the analysis: expression content type and a variable
* expression template for the feature content type.
*
* ***documentation of parameters here????
*
* @ingroup tripal_sra
*/
function tripal_sra_theme($existing, $type, $theme, $path) {
$core_path = drupal_get_path('module', 'tripal_core');
$items = array(
'node__chado_bioproject' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_bioproject_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_bioproject_base',
'path' => "$path/theme/templates",
),
'tripal_bioproject_experiments' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_bioproject_experiments',
'path' => "$path/theme/templates",
),
'tripal_bioproject_references' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_bioproject_references',
'path' => "$path/theme/templates",
),
'tripal_bioproject_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_bioproject_teaser',
'path' => "$path/theme/templates",
),
'tripal_bioproject_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_bioproject_help',
'path' => "$path/theme/templates",
),
'node__chado_biosample' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_biosample_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biosample_base',
'path' => "$path/theme/templates",
),
'tripal_biosample_references' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biosample_references',
'path' => "$path/theme/templates",
),
'tripal_biosample_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biosample_teaser',
'path' => "$path/theme/templates",
),
'tripal_biosample_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biosample_help',
'path' => "$path/theme/templates",
),
'node__chado_experiment' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_experiment_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_experiment_base',
'path' => "$path/theme/templates",
),
'tripal_experiment_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_experiment_teaser',
'path' => "$path/theme/templates",
),
'tripal_experiment_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_experiment_help',
'path' => "$path/theme/templates",
),
);
/**
'tripal_organism_biomaterial' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_organism_biomaterial',
'path' => "$path/theme/templates",
),
'tripal_feature_expression' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_feature_expression',
'path' => "$path/theme/templates",
),
'tripal_analysis_biomaterial' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_analysis_biomaterial',
'path' => "$path/theme/templates",
),
);
*/
return $items;
}
/*
* Implement hook_block_info()
* Define two blocks one for input features
* the other one for display heatmap
*/
/**
function tripal_sra_block_info(){
// Define two blocks: one for features input form
// the other one for heatmap display
$blocks = array();
$blocks['input_features'] = array(
'info' => t('tripal_analysis_expression features form for heatmap'),
'status' => 1,
'region' => 'content',
'weight' => 24,
'cache' => DRUPAL_NO_CACHE
);
$blocks['heatmap_features'] = array(
'info' => t('tripal_analysis_expression heatmap display'),
'status' => 1,
'region' => 'content',
'weight' => 25,
'cache' => DRUPAL_NO_CACHE
);
return $blocks;
}
*/
/*
* Implement hook_block_view()
*/
/**
function tripal_analysis_expression_block_view($delta = ''){
$block = array();
switch($delta){
case 'input_features':
//$block['subject'] = t('Feature Expression');
//$block['content'] = drupal_get_form('feature_heatmap_form');
break;
case 'heatmap_features':
if(!empty($_SESSION['heatmap_data'])){
$block['subject'] = t('Feature Expression Heatmap');
$block['content'] = '<div id="vis_expression"></div>';
drupal_add_js(array('tripal_analysis_expression' => array('heatmap_data' => $_SESSION['heatmap_data'])), array('type' => 'setting'));
drupal_add_js(array('tripal_analysis_expression' => array('left_margin' => $_SESSION['left_margin'])), array('type' => 'setting'));
drupal_add_js(array('tripal_analysis_expression' => array('bottom_margin' => $_SESSION['bottom_margin'])), array('type' => 'setting'));
} else {
//$block['subject'] = '';
//$block['content'] = t('<b><span style="color:red">Either you have not entered any features or no expression data available for the features you entered.</span></b>');
}
break;
}
//drupal_add_js(array('tripal_analysis_expression' => array('heatmap_data' => $_SESSION['heatmap_data'])), array('type' => 'setting'));
//drupal_add_js('https://cdn.plot.ly/plotly-latest.min.js', 'external');
drupal_add_js(drupal_get_path('module', 'tripal_analysis_expression').'/theme/js/plotly-latest.min.js');
drupal_add_js(drupal_get_path('module', 'tripal_analysis_expression').'/theme/js/heatmap.js');
return $block;
}
*/