-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtripal_rnaseq.module.bk
executable file
·810 lines (756 loc) · 35.3 KB
/
tripal_rnaseq.module.bk
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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
<?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 "includes/tripal_analysis_expression.chado_node.inc";
require_once "includes/tripal_analysis_expression.admin.inc";
require_once "includes/tripal_analysis_expression_config.admin.inc";
require_once "includes/tripal_analysis_expression.delete.inc";
require_once "includes/tripal_arraydesign.chado_node.inc";
require_once "includes/tripal_arraydesign.delete.inc";
require_once "includes/tripal_biomaterial.chado_node.inc";
require_once "includes/tripal_biomaterial.delete.inc";
require_once "includes/tripal_arraydesign.admin.inc";
require_once "includes/tripal_protocol.chado_node.inc";
require_once "includes/tripal_protocol.admin.inc";
require_once "includes/tripal_protocol.delete.inc";
require_once "includes/tripal_biomaterial.admin.inc";
require_once "includes/tripal_expression_loader.inc";
require_once "includes/tripal_biomaterial_loader.inc";
require_once "theme/tripal_analysis_expression.theme.inc";
require_once "api/tripal_arraydesign.api.inc";
require_once "api/tripal_protocol.api.inc";
require_once drupal_get_path('module', 'tripal_analysis_expression').'/includes/feature_heatmap_form.inc';
/**
* Implements hook_help().
*
* Display help and module information.
*
* @ingroup tripal_analysis_expression
*/
function tripal_analysis_expression_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_analysis_expression_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().
*
* This function adds menus for the four content types created by the
* tripal analyis expression module as well a menu the configuration of
* expression data on feature pages. An admin list, sync, delete, TOC,
* settings, and help page is created for the following content types:
* analysis: expression, arraydesign, biomaterial, and protocol.
*
* @ingroup tripal_expression
*/
function tripal_analysis_expression_menu() {
$items = array();
// Admin configuration group.
$items['admin/tripal/extension/tripal_analysis_expression'] = array(
'title' => 'Expression Analysis',
'description' => 'Administrative pages for the Tripal Expression Analysis module.',
'access arguments' => array('administer tripal analysis expression'),
);
// Content type configuration group.
$items['admin/tripal/extension/tripal_analysis_expression/content_types'] = array(
'title' => 'Tripal Expression Analysis Content Types',
'description' => 'Administer content types provided by the Tripal Expression Analysis module.',
'access arguments' => array('administer tripal analysis expression'),
);
// Module help pages.
$items['admin/tripal/extension/tripal_analysis_expression/help'] = array(
'title' => 'Tripal Expression Analysis Help',
'description' => 'A description of expression module content types and loaders.',
'access arguments' => array('administer tripal analysis expression'),
'weight' => 10,
);
// Expression display on feature pages.
$items['admin/tripal/extension/tripal_analysis_expression/manage'] = array(
'title' => 'Tripal Expression Analysis Settings',
'description' => 'Manage the display of expression information.',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_analysis_expression_config_admin'),
);
// Biomaterial loader form.
$items['admin/tripal/extension/tripal_analysis_expression/biomaterial_loader'] = array(
'title' => 'Tripal Biomaterial Loader',
'description' => 'Load biosample xml files from NCBI, or biomaterial flat files.',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biomaterial_loader'),
'weight' => 10,
);
// Admin configuration - arraydesign admin list.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign'] = array(
'title' => 'Array Design',
'description' => 'The description of an array.',
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'tripal_arraydesign_admin_arraydesign_view',
'type' => MENU_NORMAL_ITEM,
);
// Admin configuration - arraydesign settings.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal Expression: Array Design settings and configurations.',
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_arraydesign_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// Admin configuration - arraydesign TOC.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/chado_arraydesign_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for arraydesign nodes.',
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_arraydesign'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// Admin configuration - arraydesign sync.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for arraydesigns stored in Chado.',
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_analysis_expression',
'chado_arraydesign',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// Admin configuration - arraydesign delete.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple array designs from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_arraydesign_delete_form'),
'access arguments' => array('administer tripal protoocl'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_analysis_expression'),
'file' => 'includes/tripal_arraydesign.delete.inc',
'weight' => 3,
);
// Admin configuration - arraydesign help.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Array Design content type including a short description of it's usage.",
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'theme',
'page arguments' => array('tripal_arraydesign_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// Admin configuration - arraydesign enable view.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign/views/arraydesigns/enable'] = array(
'title' => 'Enable Arraydesign Administrative View',
'access arguments' => array('administer tripal arraydesign'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_arraydesign_admin_arraydesigns',
'tripal_analysis_expression',
'admin/tripal/extension/tripal_analysis_expression/arraydesign',
),
);
// Admin configuration - protocol admin list.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol'] = array(
'title' => 'Protocol',
'description' => 'A description of the methods, software, and hardware used in an experimental process.',
'access arguments' => array('administer tripal protocol'),
'page callback' => 'tripal_protocol_admin_protocol_view',
'type' => MENU_NORMAL_ITEM,
);
// Admin configuration - protocol settings.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal Expression: Protocol settings and configurations.',
'access arguments' => array('administer tripal protocol'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_protocol_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// Admin configuration - protocol TOC.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/chado_protocol_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for protocol nodes.',
'access arguments' => array('administer tripal protocol'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_protocol'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// Admin configuration - protocol sync.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for protocols stored in Chado.',
'access arguments' => array('administer tripal protocol'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_analysis_expression',
'chado_protocol',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// Admin configuration - protocol delete.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple protocols from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_protocol_delete_form'),
'access arguments' => array('administer tripal protoocl'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_analysis_expression'),
'file' => 'includes/tripal_protocol.delete.inc',
'weight' => 3,
);
// Admin configuration - protocol help.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Protocol content type including a short description of it's usage.",
'access arguments' => array('administer tripal protocol'),
'page callback' => 'theme',
'page arguments' => array('tripal_protocol_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// Admin configuration - protocol enable view.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/protocol/views/protocols/enable'] = array(
'title' => 'Enable Protocol Administrative View',
'access arguments' => array('administer tripal protocol'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_protocol_admin_protocols',
'tripal_analysis_expression',
'admin/tripal/extension/tripal_analysis_expression/protocol',
),
);
// Admin configuration - biomaterial admin list.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial'] = array(
'title' => 'Biomaterial',
'description' => 'A biological material (tissue, cells, serum, etc.).',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'tripal_biomaterial_admin_biomaterial_view',
'type' => MENU_NORMAL_ITEM,
);
// Admin configuration - biomaterial settings.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Tripal Expression: Biomaterial settings and configurations.',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biomaterial_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// Admin configuration - biomaterial TOC.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/chado_biomaterial_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for biomaterial nodes.',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_biomaterial'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// Admin configuration - biomaterial sync.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for biomaterials stored in Chado.',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_analysis_expression',
'chado_biomaterial',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// Admin configuration - biomaterial delete.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple biomaterials from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_biomaterial_delete_form'),
'access arguments' => array('administer tripal protoocl'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_analysis_expression'),
'file' => 'includes/tripal_biomaterial.delete.inc',
'weight' => 3,
);
// Admin configuration - biomaterial help.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Biomaterial content type including a short description of it's usage.",
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'theme',
'page arguments' => array('tripal_biomaterial_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// Admin configuration - biomaterial enable view.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial/views/biomaterials/enable'] = array(
'title' => 'Enable Biomaterial Administrative View',
'access arguments' => array('administer tripal biomaterial'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_biomaterial_admin_biomaterials',
'tripal_analysis_expression',
'admin/tripal/extension/tripal_analysis_expression/biomaterial',
),
);
// Admin configuration - analysis_expression admin list.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression'] = array(
'title' => 'Analysis: Expression',
'description' => 'An expression analysis from the chado database.',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'tripal_analysis_expression_admin_analysis_expression_view',
'type' => MENU_NORMAL_ITEM,
);
// Admin configuration - analysis_expression settings.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/configuration'] = array(
'title' => 'Settings',
'description' => 'Manage Analysis: Expression settings and configurations.',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_analysis_expression_admin'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
// Admin configuration - analysis_expression TOC.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/chado_analysis_expression_toc'] = array(
'title' => 'TOC',
'description' => 'Manage the table of contents for analysis_expression nodes.',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_core_content_type_toc_form', 'chado_analysis_expression'),
'file' => 'includes/tripal_core.toc.inc',
'file path' => drupal_get_path('module', 'tripal_core'),
'type' => MENU_LOCAL_TASK,
'weight' => 3,
);
// Admin configuration - analysis_expression sync.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/sync'] = array(
'title' => 'Sync',
'description' => 'Create pages on this site for analysis_expressions stored in Chado.',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'chado_node_sync_form',
'tripal_analysis_expression',
'chado_analysis_expression',
),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
// Admin configuration - analysis_expression delete.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/delete'] = array(
'title' => "Delete",
'description' => 'Delete multiple analysis_expressions from Chado',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_analysis_expression_delete_form'),
'access arguments' => array('administer tripal protoocl'),
'type' => MENU_LOCAL_TASK,
'file path' => drupal_get_path('module', 'tripal_analysis_expression'),
'file' => 'includes/tripal_analysis_expression.delete.inc',
'weight' => 3,
);
// Admin configuration - analysis_expression help.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/help'] = array(
'title' => 'Help',
'description' => "A description of the Tripal Analysis: Expression content type including a short description of it's usage.",
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'theme',
'page arguments' => array('tripal_analysis_expression_help'),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
// Admin configuration - analysis_expression enable view.
$items['admin/tripal/extension/tripal_analysis_expression/content_types/analysis_expression/views/analysis_expressions/enable'] = array(
'title' => 'Enable Analysis: Expression Administrative View',
'access arguments' => array('administer tripal analysis expression'),
'page callback' => 'tripal_enable_view',
'page arguments' => array(
'tripal_analysis_expression_admin_analysis_expressions',
'tripal_analysis_expression',
'admin/tripal/extension/tripal_analysis_expression/analysis_expression',
),
);
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_analysis_expression
*/
function tripal_analysis_expression_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,
* biomaterial, and protocol. 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_analysis_expression
*/
function tripal_analysis_expression_theme($existing, $type, $theme, $path) {
$core_path = drupal_get_path('module', 'tripal_core');
$items = array(
'node__chado_analysis_expression' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_analysis_expression_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_analysis_expression_help',
'path' => "$path/theme/templates",
),
'tripal_analysis_expression_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_analysis_expression_base',
'path' => "$path/theme/templates",
),
'tripal_analysis_expression_protocols' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_analysis_expression_protocols',
'path' => "$path/theme/templates",
),
'tripal_analysis_expression_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_analysis_expression_teaser',
'path' => "$path/theme/templates",
),
'node__chado_arraydesign' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_arraydesign_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_arraydesign_base',
'path' => "$path/theme/templates",
),
'tripal_arraydesign_properties' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_arraydesign_properties',
'path' => "$path/theme/templates",
),
'tripal_arraydesign_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_arraydesign_teaser',
'path' => "$path/theme/templates",
),
'tripal_arraydesign_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_arraydesign_help',
'path' => "$path/theme/templates",
),
'node__chado_protocol' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_protocol_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_protocol_base',
'path' => "$path/theme/templates",
),
'tripal_protocol_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_protocol_teaser',
'path' => "$path/theme/templates",
),
'tripal_protocol_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_protocol_help',
'path' => "$path/theme/templates",
),
'node__chado_biomaterial' => array(
'template' => 'node--chado-generic',
'render element' => 'node',
'base hook' => 'node',
'path' => "$core_path/theme/templates",
),
'tripal_biomaterial_base' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biomaterial_base',
'path' => "$path/theme/templates",
),
'tripal_biomaterial_properties' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biomaterial_properties',
'path' => "$path/theme/templates",
),
'tripal_biomaterial_references' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biomaterial_references',
'path' => "$path/theme/templates",
),
'tripal_biomaterial_teaser' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biomaterial_teaser',
'path' => "$path/theme/templates",
),
'tripal_biomaterial_help' => array(
'variables' => array('node' => NULL),
'template' => 'tripal_biomaterial_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_analysis_expression_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;
}