-
Notifications
You must be signed in to change notification settings - Fork 0
/
vcf_filter.install
118 lines (107 loc) · 3.18 KB
/
vcf_filter.install
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
<?php
/**
* @file
* Installation of this module.
*/
/**
* Implements hook_schema().
*/
function vcf_filter_schema() {
$schema = array();
$schema['vcf_files'] = array(
'description' => 'Keeps track of VCF files for use with VCF Filter module.',
'fields' => array(
'vcf_file_id' => array(
'description' => 'Primary Key',
'type' => 'serial',
'not null' => TRUE,
),
'file_path' => array(
'description' => 'Absolute path to an existing VCF file.',
'type' => 'text',
'not null' => TRUE,
),
'name' => array(
'description' => 'Human-readable name for the VCF file.',
'type' => 'varchar',
'length' => 200,
),
'num_snps' => array(
'description' => 'The number of SNPs in this VCF file.',
'type' => 'int',
),
'backbone' => array(
'description' => 'The name of the sequence the SNPs are called on.',
'type' => 'varchar',
'length' => 200,
),
'description' => array(
'description' => 'Free text description of the VCF file.',
'type' => 'text',
),
'specific_germplasm' => array(
'description' => 'Free text includes all germplasm names of the VCF file.',
'type' => 'text',
),
'chromosome_format' => array(
'description' => 'Free text description of the chromosome format applied in the VCF file.',
'type' => 'text',
),
'export_format_selection' => array(
'description' => 'Available export formats for this file.',
'type' => 'text',
),
),
'primary key' => array('vcf_file_id'),
);
$schema['vcf_files_perm'] = array(
'description' => 'Keeps track of permissions for VCF files.',
'fields' => array(
'vcf_file_perm_id' => array(
'description' => 'Primary Key',
'type' => 'serial',
'not null' => TRUE,
),
'vcf_file_id' => array(
'description' => 'Links to the VCF files',
'type' => 'int',
'not null' => TRUE,
),
'rid' => array(
'description' => 'The ROLE ID of a role to provide access to.',
'type' => 'int',
),
'uid' => array(
'description' => 'The USER ID of a user to provide access to.',
'type' => 'int',
),
),
'primary key' => array('vcf_file_perm_id'),
);
return $schema;
}
/**
* Add newcol field to {vcf_files} table.
*/
function vcf_filter_update_7000() {
$specific_germplasm = array(
'description' => 'Free text includes all germplasm names of the VCF file.',
'type' => 'text',
);
$chromosome_format = array(
'description' => 'Free text description of the chromosome format applied in the VCF file.',
'type' => 'text',
);
db_add_field('vcf_files', 'specific_germplasm', $specific_germplasm);
db_add_field('vcf_files', 'chromosome_format', $chromosome_format);
}
/**
* Add export format selection to vcf_files.
*/
function vcf_filter_update_7001() {
$export_format_selection = array(
'description' => 'Available export formats for this vcf file.',
'type' => 'text',
);
db_add_field('vcf_files', 'export_format_selection', $export_format_selection);
}