-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvcf_filter.module
175 lines (153 loc) · 5.98 KB
/
vcf_filter.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
<?php
/**
* @file
* Basic hook implementations for this module.
*/
require_once('api/vcf_filter.api.inc');
require_once('includes/vcf_filter.trpdownload.inc');
require_once('includes/vcf_filter.fields.inc');
/**
* Implements hook_menu().
*/
function vcf_filter_menu() {
$items = array();
$items['filter_vcf'] = array(
'title' => 'Filter VCF',
'description' => 'Form interface so users can custom filter existing VCF files and export in a variety of formats.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_form'),
'access callback' => TRUE,
'file' => 'includes/vcf_filter.form.inc',
);
$items['filter_vcf/Position_search'] = array(
'title' => 'VCF Position Search',
'description' => 'Search sites from current available vcf files.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_position_search_form'),
'access callback' => TRUE,
'file' => 'includes/vcf_filter.position_search.form.inc',
);
// TRIPAL DOWNLOAD PAGES.
$items['filter_vcf/ABH'] = array(
'title' => 'Download Filtered VCF: A/B Biparental Format',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_abh'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['filter_vcf/Genotype-Matrix'] = array(
'title' => 'Download Filtered VCF: Genotype Matrix Format',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_genotype_matrix'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['filter_vcf/Quality-Matrix'] = array(
'title' => 'Download Filtered VCF: Quality Matrix Format',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_qual_matrix'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['filter_vcf/VCF'] = array(
'title' => 'Download Filtered VCF',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_VCF'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['filter_vcf/Hapmap'] = array(
'title' => 'Download Filtered VCF: Haplotype Map (Hapmap) Format',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_hapmap'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['filter_vcf/Bgzipped'] = array(
'title' => 'Download Filtered VCF: Block Compression/Decompression (bgzipped) Format',
'page callback' => 'trpdownload_download_page',
'page arguments' => array('vcf_filter_bgzipped'),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
// ADMINISTRATION.
// List VCF Files.
$items['admin/tripal/extension/vcf_filter'] = array(
'title' => 'VCF Filter',
'description' => 'Provides a form so users can custom filter existing VCF files and export in a variety of formats.',
'page callback' => 'vcf_filter_admin_list',
'page arguments' => array(),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// Manage VCF Files
// -- Add
$items['admin/tripal/extension/vcf_filter/add'] = array(
'title' => 'Add VCF File',
'description' => 'Make a VCF file available to be filtered.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_admin_vcf_file_form', 'add'),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// -- Edit
$items['admin/tripal/extension/vcf_filter/edit'] = array(
'title' => 'Edit VCF File',
'description' => 'Edit an existing VCF file.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_admin_vcf_file_form', 'edit'),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// -- Delete
$items['admin/tripal/extension/vcf_filter/delete'] = array(
'title' => 'Delete VCF File',
'description' => 'Delete an existing VCF file.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_admin_vcf_file_form', 'delete'),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// Manage Access to VCF Files.
// -- Add
$items['admin/tripal/extension/vcf_filter/access'] = array(
'title' => 'VCF File Permissions',
'description' => 'Handle permissions for a VCF file.',
'page callback' => 'drupal_get_form',
'page arguments' => array('vcf_filter_admin_vcf_file_perm_form', 5),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// -- Remove (no confirm)
$items['admin/tripal/extension/vcf_filter/access/%/%/%'] = array(
'title' => 'Remove VCF File Permissions',
'description' => 'Handle permissions for a VCF file.',
'page callback' => 'vcf_filter_admin_vcf_file_perm_remove_callback',
'page arguments' => array(5,6,7),
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
// AUTOCOMPLETE: User
// Note: We can't just use user/autocomplete, user_autocomplete() because it assumes
// you are typing the username in order rather then simply finding the substring.
$items['autocomplete/vcf_filter/user'] = array(
'title' => 'VCF Filter: Autocomplete',
'page callback' => 'vcf_filter_user_autocomplete',
'type' => MENU_CALLBACK,
'access arguments' => array('administer tripal'),
'file' => 'includes/vcf_filter.admin.inc',
);
return $items;
}
/**
* Implements hook_theme().
*/
function vcf_filter_theme($existing, $type, $theme, $path) {
$items = array();
$items['vcf_filter_admin_form_perm_table'] = array(
'function' => 'vcf_filter_admin_form_perm_table',
'render element' => 'element',
'file' => 'includes/vcf_filter.admin.inc',
);
return $items;
}