/
Kit_model.php
99 lines (93 loc) · 2.76 KB
/
Kit_model.php
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
<?php
// Copyright 2015 National Marrow Donor Program (NMDP)
// This file is part of HGTR.
// HGTR is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
class Kit_model extends CI_Model {
function __construct()
{
parent::__construct();
$this->load->database();
}
function get_genes()
{
$sql = 'SELECT ENTREZ_GENE_ID,SYMBOL FROM human_gene';
$query = $this->db->query($sql);
return $query->result();
}
function get_platforms()
{
$sql = 'SELECT PLATFORM FROM platform';
$query = $this->db->query($sql);
return $query->result();
}
function get_category()
{
$sql = 'SELECT MAJOR_METHOD,METHOD,INPUT_VALUE as value FROM category';
$query = $this->db->query($sql);
return $query->result();
}
function get_method()
{
$sql = 'SELECT PRIMARY_METHODOLOGY as method FROM method';
$query = $this->db->query($sql);
return $query->result();
}
function get_instruments()
{
$sql = 'SELECT INSTRUMENT FROM instrument';
$query = $this->db->query($sql);
return $query->result();
}
function get_purpose()
{
$sql = 'SELECT PURPOSE FROM purpose';
$query = $this->db->query($sql);
return $query->result();
}
function get_diseased()
{
$sql = 'SELECT NAME FROM disease';
$query = $this->db->query($sql);
return $query->result();
}
function get_imgt_hla_versions()
{
$sql = 'SELECT VERSION FROM imgt_hla_meta';
$query = $this->db->query($sql);
return $query->result();
}
function get_gene_id($gene_symbol)
{
$sql = 'SELECT ENTREZ_GENE_ID FROM human_gene WHERE SYMBOl = ?';
$query = $this->db->query($sql, array($gene_symbol));
return $query->row_array();
}
function check_instruments($instrument)
{
$sql = 'SELECT * FROM instrument WHERE INSTRUMENT=?';
$query = $this->db->query($sql, array($instrument));
return $query->row_array();
}
function check_method($primary_method)
{
$sql = 'SELECT * FROM method WHERE PRIMARY_METHODOLOGY=?';
$query = $this->db->query($sql, array($primary_method));
return $query->row_array();
}
function check_platform($platform)
{
$sql = 'SELECT * FROM platform WHERE PLATFORM = ?';
$query = $this->db->query($sql, array($platform));
return $query->row_array();
}
}
?>