Пример #1
0
 function __construct($sObjectID = '', $nID = '')
 {
     // Default constructor.
     global $_AUTH;
     // SQL code for loading an entry for an edit form.
     // FIXME; change owner to owned_by_ in the load entry query below.
     $this->sSQLLoadEntry = 'SELECT p.*, ' . 'uo.name AS owner ' . 'FROM ' . TABLE_PHENOTYPES . ' AS p ' . 'LEFT JOIN ' . TABLE_USERS . ' AS uo ON (p.owned_by = uo.id) ' . 'WHERE p.id = ?';
     // SQL code for viewing an entry.
     $this->aSQLViewEntry['SELECT'] = 'p.*, ' . 'i.statusid AS individual_statusid, ' . 'd.symbol AS disease, ' . 'uo.name AS owned_by_, ' . 'uc.name AS created_by_, ' . 'ue.name AS edited_by_';
     $this->aSQLViewEntry['FROM'] = TABLE_PHENOTYPES . ' AS p ' . 'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (p.individualid = i.id) ' . 'LEFT OUTER JOIN ' . TABLE_DISEASES . ' AS d ON (p.diseaseid = d.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (p.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uc ON (p.created_by = uc.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ue ON (p.edited_by = ue.id)';
     $this->aSQLViewEntry['GROUP_BY'] = 'p.id';
     // SQL code for viewing the list of phenotypes
     $this->aSQLViewList['SELECT'] = 'p.*, ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 'CASE p.statusid WHEN ' . STATUS_MARKED . ' THEN "marked" WHEN ' . STATUS_HIDDEN . ' THEN "del" WHEN ' . STATUS_PENDING . ' THEN "del" END AS class_name,' : '') . 'ds.name AS status, ' . 'uo.name AS owned_by_, ' . 'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner';
     $this->aSQLViewList['FROM'] = TABLE_PHENOTYPES . ' AS p ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (p.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_DATA_STATUS . ' AS ds ON (p.statusid = ds.id)';
     $this->sObjectID = $sObjectID;
     $this->nID = $nID;
     // Run parent constructor to find out about the custom columns.
     parent::__construct();
     // List of columns and (default?) order for viewing an entry.
     $this->aColumnsViewEntry = array_merge(array('individualid_' => 'Individual ID', 'disease_' => 'Associated disease'), $this->buildViewEntry(), array('owned_by_' => 'Owner name', 'status' => array('Phenotype data status', LEVEL_COLLABORATOR), 'created_by_' => array('Created by', LEVEL_COLLABORATOR), 'created_date_' => array('Date created', LEVEL_COLLABORATOR), 'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR), 'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR)));
     // List of columns and (default?) order for viewing a list of entries.
     $this->aColumnsViewList = array_merge(array('id_' => array('view' => array('Phenotype ID', 110, 'style="text-align : right;"'), 'db' => array('p.id', 'ASC', true))), $this->buildViewList(), array('owned_by_' => array('view' => array('Owner', 160), 'db' => array('uo.name', 'ASC', true)), 'owner_countryid' => array('view' => false, 'db' => array('uo.countryid', 'ASC', true)), 'status' => array('view' => array('Status', 70), 'db' => array('ds.name', false, true), 'auth' => LEVEL_COLLABORATOR), 'individualid' => array('view' => array('Individual ID', 70, 'style="text-align : right;"'), 'db' => array('p.individualid', 'ASC', true)), 'diseaseid' => array('view' => array('Disease ID', 70, 'style="text-align : right;"'), 'db' => array('p.diseaseid', 'ASC', true))));
     $this->sSortDefault = 'id_';
     // Because the information is publicly available, remove some columns for the public.
     $this->unsetColsByAuthLevel();
 }
Пример #2
0
 function __construct()
 {
     // Default constructor.
     global $_AUTH;
     // SQL code for loading an entry for an edit form.
     // FIXME; change owner to owned_by_ in the load entry query below.
     $this->sSQLLoadEntry = 'SELECT s.*, ' . 'GROUP_CONCAT(DISTINCT s2g.geneid ORDER BY s2g.geneid SEPARATOR ";") AS _genes, ' . 'uo.name AS owner ' . 'FROM ' . TABLE_SCREENINGS . ' AS s ' . 'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (s.owned_by = uo.id) ' . 'WHERE s.id = ? ' . 'GROUP BY s.id';
     // SQL code for viewing an entry.
     $this->aSQLViewEntry['SELECT'] = 's.*, ' . 'i.statusid AS individual_statusid, ' . 'GROUP_CONCAT(DISTINCT "=\\"", s2g.geneid, "\\"" SEPARATOR "|") AS search_geneid, ' . 'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' . 'uo.name AS owned_by_, ' . 'uc.name AS created_by_, ' . 'ue.name AS edited_by_';
     // Construct list of user IDs for current user and users who share access with him.
     $aOwnerIDs = array_merge(array($_AUTH['id']), lovd_getColleagues(COLLEAGUE_ALL));
     $sOwnerIDsSQL = join(', ', $aOwnerIDs);
     $this->aSQLViewEntry['FROM'] = TABLE_SCREENINGS . ' AS s ' . 'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' . 'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s.id = s2v.screeningid) ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH ? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (s.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (s.individualid = i.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uc ON (s.created_by = uc.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ue ON (s.edited_by = ue.id)';
     $this->aSQLViewEntry['GROUP_BY'] = 's.id';
     // SQL code for viewing the list of screenings
     $this->aSQLViewList['SELECT'] = 's.*, ' . 's.id AS screeningid, ' . 'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' . 'GROUP_CONCAT(DISTINCT s2g.geneid SEPARATOR ", ") AS genes, ' . ($_AUTH['level'] < LEVEL_COLLABORATOR ? '' : 'CASE i.statusid WHEN ' . STATUS_MARKED . ' THEN "marked" WHEN ' . STATUS_HIDDEN . ' THEN "del" END AS class_name, ') . 'uo.name AS owned_by_, ' . 'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner';
     $this->aSQLViewList['FROM'] = TABLE_SCREENINGS . ' AS s ' . 'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s.id = s2v.screeningid) ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH ? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') . 'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' . 'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (s.individualid = i.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (s.owned_by = uo.id)';
     $this->aSQLViewList['GROUP_BY'] = 's.id';
     // Run parent constructor to find out about the custom columns.
     parent::__construct();
     // List of columns and (default?) order for viewing an entry.
     $this->aColumnsViewEntry = array_merge(array('individualid_' => 'Individual ID'), $this->buildViewEntry(), array('variants_found_' => 'Variants found?', 'owned_by_' => 'Owner name', 'created_by_' => array('Created by', LEVEL_COLLABORATOR), 'created_date' => array('Date created', LEVEL_COLLABORATOR), 'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR), 'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR)));
     // List of columns and (default?) order for viewing a list of entries.
     $this->aColumnsViewList = array_merge(array('screeningid' => array('view' => false, 'db' => array('s.id', 'ASC', true)), 'id' => array('view' => array('Screening ID', 110, 'style="text-align : right;"'), 'db' => array('s.id', 'ASC', true)), 'individualid' => array('view' => array('Individual ID', 110, 'style="text-align : right;"'), 'db' => array('s.individualid', 'ASC', true))), $this->buildViewList(), array('genes' => array('view' => array('Genes screened', 20), 'db' => array('genes', 'ASC', 'TEXT')), 'variants_found_' => array('view' => array('Variants found', 100, 'style="text-align : right;"'), 'db' => array('variants_found_', 'ASC', 'INT_UNSIGNED')), 'owned_by_' => array('view' => array('Owner', 160), 'db' => array('uo.name', 'ASC', true)), 'created_date' => array('view' => array('Date created', 130), 'db' => array('s.created_date', 'ASC', true))));
     $this->sSortDefault = 'id';
     // Because the gene information is publicly available, remove some columns for the public.
     $this->unsetColsByAuthLevel();
 }
Пример #3
0
 function __construct()
 {
     // Default constructor.
     global $_AUTH;
     // SQL code for loading an entry for an edit form.
     // FIXME; change owner to owned_by_ in the load entry query below.
     $this->sSQLLoadEntry = 'SELECT i.*, ' . 'uo.name AS owner, ' . 'GROUP_CONCAT(DISTINCT i2d.diseaseid ORDER BY i2d.diseaseid SEPARATOR ";") AS active_diseases_ ' . 'FROM ' . TABLE_INDIVIDUALS . ' AS i ' . 'LEFT OUTER JOIN ' . TABLE_IND2DIS . ' AS i2d ON (i.id = i2d.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (i.owned_by = uo.id) ' . 'WHERE i.id = ? ' . 'GROUP BY i.id';
     // SQL code for viewing an entry.
     $this->aSQLViewEntry['SELECT'] = 'i.*, ' . 'GROUP_CONCAT(DISTINCT d.id SEPARATOR ";") AS _diseaseids, ' . 'GROUP_CONCAT(DISTINCT d.id, ";", IF(CASE d.symbol WHEN "-" THEN "" ELSE d.symbol END = "", d.name, d.symbol), ";", d.name ORDER BY (d.symbol != "" AND d.symbol != "-") DESC, d.symbol, d.name SEPARATOR ";;") AS __diseases, ' . 'GROUP_CONCAT(DISTINCT p.diseaseid SEPARATOR ";") AS _phenotypes, ' . 'GROUP_CONCAT(DISTINCT s.id SEPARATOR ";") AS _screeningids, ' . 'uo.id AS owner, ' . 'uo.name AS owned_by_, ' . 'uc.name AS created_by_, ' . 'ue.name AS edited_by_';
     $this->aSQLViewEntry['FROM'] = TABLE_INDIVIDUALS . ' AS i ' . 'LEFT OUTER JOIN ' . TABLE_SCREENINGS . ' AS s ON (i.id = s.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_IND2DIS . ' AS i2d ON (i.id = i2d.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_DISEASES . ' AS d ON (i2d.diseaseid = d.id) ' . 'LEFT OUTER JOIN ' . TABLE_PHENOTYPES . ' AS p ON (i.id = p.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (i.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uc ON (i.created_by = uc.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ue ON (i.edited_by = ue.id)';
     $this->aSQLViewEntry['GROUP_BY'] = 'i.id';
     // SQL code for viewing the list of individuals
     $this->aSQLViewList['SELECT'] = 'i.*, ' . 'i.id AS individualid, ' . 'GROUP_CONCAT(DISTINCT d.id) AS diseaseids, ' . 'GROUP_CONCAT(DISTINCT IF(CASE d.symbol WHEN "-" THEN "" ELSE d.symbol END = "", d.name, d.symbol) ORDER BY (d.symbol != "" AND d.symbol != "-") DESC, d.symbol, d.name SEPARATOR ", ") AS diseases_, ' . 'GROUP_CONCAT(DISTINCT s2g.geneid ORDER BY s2g.geneid SEPARATOR ", ") AS genes_screened_, ' . 'GROUP_CONCAT(DISTINCT t.geneid ORDER BY t.geneid SEPARATOR ", ") AS variants_in_genes_, ' . 'COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 's2v.variantid' : 'vog.id') . ') AS variants_, ' . 'uo.name AS owned_by_, ' . 'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner, ' . ($_AUTH['level'] < LEVEL_COLLABORATOR ? '' : 'CASE ds.id WHEN ' . STATUS_MARKED . ' THEN "marked" WHEN ' . STATUS_HIDDEN . ' THEN "del" WHEN ' . STATUS_PENDING . ' THEN "del" END AS class_name,') . 'ds.name AS status';
     // Construct list of user IDs for current user and users who share access with him.
     $aOwnerIDs = array_merge(array($_AUTH['id']), lovd_getColleagues(COLLEAGUE_ALL));
     $sOwnerIDsSQL = join(', ', $aOwnerIDs);
     $this->aSQLViewList['FROM'] = TABLE_INDIVIDUALS . ' AS i ' . 'LEFT OUTER JOIN ' . TABLE_IND2DIS . ' AS i2d ON (i.id = i2d.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_DISEASES . ' AS d ON (i2d.diseaseid = d.id) ' . 'LEFT OUTER JOIN ' . TABLE_SCREENINGS . ' AS s ON (i.id = s.individualid) ' . 'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s2v.screeningid = s.id) ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH ? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') . 'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' . 'LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 's2v.variantid' : 'vog.id') . ' = vot.id) ' . 'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (t.id = vot.transcriptid) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (i.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_DATA_STATUS . ' AS ds ON (i.statusid = ds.id)';
     $this->aSQLViewList['GROUP_BY'] = 'i.id';
     // Run parent constructor to find out about the custom columns.
     parent::__construct();
     // List of columns and (default?) order for viewing an entry.
     $this->aColumnsViewEntry = array_merge($this->buildViewEntry(), array('panelid_' => 'Panel ID', 'panel_size' => 'Panel size', 'diseases_' => 'Diseases', 'parents_' => 'Parent(s)', 'owned_by_' => 'Owner name', 'status' => array('Individual data status', LEVEL_COLLABORATOR), 'created_by_' => array('Created by', LEVEL_COLLABORATOR), 'created_date_' => array('Date created', LEVEL_COLLABORATOR), 'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR), 'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR)));
     // List of columns and (default?) order for viewing a list of entries.
     $this->aColumnsViewList = array_merge(array('individualid' => array('view' => false, 'db' => array('i.id', 'ASC', true)), 'id' => array('view' => array('Individual ID', 110, 'style="text-align : right;"'), 'db' => array('i.id', 'ASC', true)), 'panelid' => array('view' => array('Panel ID', 70, 'style="text-align : right;"'), 'db' => array('i.panelid', 'ASC', true))), $this->buildViewList(), array('diseaseids' => array('view' => array('Disease ID', 0), 'db' => array('diseaseids', false, true)), 'diseases_' => array('view' => array('Disease', 175), 'db' => array('diseases_', 'ASC', true)), 'genes_searched' => array('view' => false, 'db' => array('t.geneid', false, true)), 'genes_screened_' => array('view' => array('Genes screened', 175), 'db' => array('genes_screened_', false, true)), 'variants_in_genes_' => array('view' => array('Variants in genes', 175), 'db' => array('variants_in_genes_', false, true), 'legend' => array('The individual has variants for this gene.')), 'variants_' => array('view' => array('Variants', 75, 'style="text-align : right;"'), 'db' => array('variants_', 'DESC', 'INT_UNSIGNED')), 'panel_size' => array('view' => array('Panel size', 70, 'style="text-align : right;"'), 'db' => array('i.panel_size', 'DESC', true), 'legend' => array('How many individuals does this entry represent?')), 'owned_by_' => array('view' => array('Owner', 160), 'db' => array('uo.name', 'ASC', true)), 'owner_countryid' => array('view' => false, 'db' => array('uo.countryid', 'ASC', true)), 'status' => array('view' => array('Status', 70), 'db' => array('ds.name', false, true), 'auth' => LEVEL_COLLABORATOR)));
     $this->sSortDefault = 'id';
     // Because the information is publicly available, remove some columns for the public.
     $this->unsetColsByAuthLevel();
 }
Пример #4
0
 function __construct()
 {
     // Default constructor.
     global $_AUTH, $_CONF, $_SETT;
     // SQL code for loading an entry for an edit form.
     // FIXME; change owner to owned_by_ in the load entry query below.
     $this->sSQLLoadEntry = 'SELECT vog.*, ' . 'uo.name AS owner ' . 'FROM ' . TABLE_VARIANTS . ' AS vog ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (vog.owned_by = uo.id) ' . 'WHERE vog.id = ?';
     // SQL code for viewing an entry.
     $this->aSQLViewEntry['SELECT'] = 'vog.*, ' . 'a.name AS allele_, ' . 'GROUP_CONCAT(DISTINCT i.id, ";", i.statusid SEPARATOR ";;") AS __individuals, ' . 'GROUP_CONCAT(s2v.screeningid SEPARATOR "|") AS screeningids, ' . 'uo.name AS owned_by_, ' . 'uc.name AS created_by_, ' . 'ue.name AS edited_by_';
     $this->aSQLViewEntry['FROM'] = TABLE_VARIANTS . ' AS vog ' . 'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (vog.id = s2v.variantid) ' . 'LEFT OUTER JOIN ' . TABLE_SCREENINGS . ' AS s ON (s.id = s2v.screeningid) ' . 'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (s.individualid = i.id) ' . 'LEFT OUTER JOIN ' . TABLE_ALLELES . ' AS a ON (vog.allele = a.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (vog.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uc ON (vog.created_by = uc.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ue ON (vog.edited_by = ue.id)';
     $this->aSQLViewEntry['GROUP_BY'] = 'vog.id';
     // SQL code for viewing the list of variants
     // FIXME: we should implement this in a different way
     $this->aSQLViewList['SELECT'] = 'vog.*, ' . 'GROUP_CONCAT(s2v.screeningid SEPARATOR ",") AS screeningids, ' . 'a.name AS allele_, ' . 'e.name AS effect, ' . 'uo.name AS owned_by_, ' . 'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner, ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 'CASE vog.statusid WHEN ' . STATUS_MARKED . ' THEN "marked" WHEN ' . STATUS_HIDDEN . ' THEN "del" WHEN ' . STATUS_PENDING . ' THEN "del" END AS class_name,' : '') . 'ds.name AS status';
     $this->aSQLViewList['FROM'] = TABLE_VARIANTS . ' AS vog ' . ($_AUTH['level'] == LEVEL_SUBMITTER && (count($_AUTH['curates']) || count($_AUTH['collaborates'])) ? 'LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (vog.id = vot.id) ' . 'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (vot.transcriptid = t.id) ' : '') . 'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (vog.id = s2v.variantid) ' . 'LEFT OUTER JOIN ' . TABLE_ALLELES . ' AS a ON (vog.allele = a.id) ' . 'LEFT OUTER JOIN ' . TABLE_EFFECT . ' AS e ON (vog.effectid = e.id) ' . 'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (vog.owned_by = uo.id) ' . 'LEFT OUTER JOIN ' . TABLE_DATA_STATUS . ' AS ds ON (vog.statusid = ds.id)';
     $this->aSQLViewList['GROUP_BY'] = 'vog.id';
     parent::__construct();
     // List of columns and (default?) order for viewing an entry.
     $this->aColumnsViewEntry = array_merge(array('individualid_' => 'Individual ID', 'chromosome' => 'Chromosome', 'allele_' => 'Allele', 'effect_reported' => 'Affects function (reported)', 'effect_concluded' => 'Affects function (concluded)'), $this->buildViewEntry(), array('mapping_flags_' => array('Automatic mapping', LEVEL_COLLABORATOR), 'average_frequency_' => 'Average frequency (large NGS studies)', 'owned_by_' => 'Owner', 'status' => array('Variant data status', LEVEL_COLLABORATOR), 'created_by_' => array('Created by', LEVEL_COLLABORATOR), 'created_date_' => array('Date created', LEVEL_COLLABORATOR), 'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR), 'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR)));
     // List of columns and (default?) order for viewing a list of entries.
     $this->aColumnsViewList = array_merge(array('screeningids' => array('view' => false, 'db' => array('screeningids', 'ASC', 'TEXT')), 'id_' => array('view' => array('Variant ID', 90, 'style="text-align : right;"'), 'db' => array('vog.id', 'ASC', true)), 'effect' => array('view' => array('Effect', 70), 'db' => array('e.name', 'ASC', true), 'legend' => array('The variant\'s effect on a protein\'s function, in the format Reported/Curator concluded; ranging from \'+\' (variant affects function) to \'-\' (does not affect function).', 'The variant\'s effect on a protein\'s function, in the format Reported/Curator concluded; \'+\' indicating the variant affects function, \'+?\' probably affects function, \'-\' does not affect function, \'-?\' probably does not affect function, \'?\' effect unknown, \'.\' effect not classified.')), 'allele_' => array('view' => array('Allele', 120), 'db' => array('a.name', 'ASC', true), 'legend' => array('On which allele is the variant located? Does not necessarily imply inheritance!', 'On which allele is the variant located? Does not necessarily imply inheritance! \'Paternal\' (confirmed or inferred), \'Maternal\' (confirmed or inferred), \'Parent #1\' or #2 for compound heterozygosity without having screened the parents, \'Unknown\' for heterozygosity without having screened the parents, \'Both\' for homozygozity.')), 'chromosome' => array('view' => array('Chr', 50), 'db' => array('vog.chromosome', 'ASC', true))), $this->buildViewList(), array('owned_by_' => array('view' => array('Owner', 160), 'db' => array('uo.name', 'ASC', true)), 'owner_countryid' => array('view' => false, 'db' => array('uo.countryid', 'ASC', true)), 'status' => array('view' => array('Status', 70), 'db' => array('ds.name', false, true), 'auth' => LEVEL_COLLABORATOR), 'created_by' => array('view' => false, 'db' => array('vog.created_by', false, true)), 'created_date' => array('view' => false, 'db' => array('vog.created_date', 'ASC', true))));
     $this->sSortDefault = 'VariantOnGenome/DNA';
     // 2015-10-09; 3.0-14; Add genome build name to the VOG/DNA field.
     $this->aColumnsViewEntry['VariantOnGenome/DNA'] .= ' (Relative to ' . $_CONF['refseq_build'] . ' / ' . $_SETT['human_builds'][$_CONF['refseq_build']]['ncbi_name'] . ')';
     $this->aColumnsViewList['VariantOnGenome/DNA']['view'][0] .= ' (' . $_CONF['refseq_build'] . ')';
     // Because the information is publicly available, remove some columns for the public.
     $this->unsetColsByAuthLevel();
     $this->sRowLink = 'variants/{{ID}}';
 }
Пример #5
0
 function __construct($sObjectID = '', $nID = '')
 {
     // Default constructor.
     global $_DB;
     // SQL code for loading an entry for an edit form.
     $this->sSQLLoadEntry = 'SELECT vot.* ' . 'FROM ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ' . 'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (vot.transcriptid = t.id) ' . 'WHERE vot.id = ? ' . 'AND t.geneid = ?';
     // SQL code for viewing an entry.
     $this->aSQLViewEntry['SELECT'] = 'vot.*, ' . 't.geneid, t.id_ncbi';
     $this->aSQLViewEntry['FROM'] = TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ' . 'INNER JOIN ' . TABLE_VARIANTS . ' AS vog ON (vot.id = vog.id) ' . 'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (vot.transcriptid = t.id)';
     $this->aSQLViewEntry['GROUP_BY'] = 'vot.id';
     // SQL code for viewing the list of variants
     // FIXME: we should implement this in a different way
     $this->aSQLViewList['SELECT'] = 'vot.*, ' . 't.geneid, t.id_ncbi, ' . 'e.name AS effect, ' . 'ds.name AS status';
     $this->aSQLViewList['FROM'] = TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ' . 'INNER JOIN ' . TABLE_VARIANTS . ' AS vog ON (vot.id = vog.id) ' . 'LEFT OUTER JOIN ' . TABLE_EFFECT . ' AS e ON (vot.effectid = e.id) ' . 'LEFT OUTER JOIN ' . TABLE_DATA_STATUS . ' AS ds ON (vog.statusid = ds.id) ' . 'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (t.id = vot.transcriptid)';
     $this->sObjectID = $sObjectID;
     $this->nID = $nID;
     parent::__construct();
     // List of columns and (default?) order for viewing an entry.
     $this->aColumnsViewEntry = array_merge(array('geneid_' => 'Gene', 'id_ncbi_' => 'Transcript ID', 'effect_reported' => 'Affects function (reported)', 'effect_concluded' => 'Affects function (concluded)'), $this->buildViewEntry());
     // List of columns and (default?) order for viewing a list of entries.
     $this->aColumnsViewList = array_merge(array('geneid' => array('view' => array('Gene', 70), 'db' => array('t.geneid', 'ASC', true)), 'transcriptid' => array('view' => array('Transcript ID', 90), 'db' => array('vot.transcriptid', 'ASC', true)), 'id_ncbi' => array('view' => array('Transcript', 120), 'db' => array('t.id_ncbi', 'ASC', true)), 'id_' => array('view' => array('Variant ID', 90), 'db' => array('vot.id', 'ASC', true)), 'effect' => array('view' => array('Affects function', 70), 'db' => array('e.name', 'ASC', true), 'legend' => array('The variant\'s effect on the protein\'s function, in the format Reported/Curator concluded; ranging from \'+\' (variant affects function) to \'-\' (does not affect function).', 'The variant\'s effect on the protein\'s function, in the format Reported/Curator concluded; \'+\' indicating the variant affects function, \'+?\' probably affects function, \'-\' does not affect function, \'-?\' probably does not affect function, \'?\' effect unknown, \'.\' effect not classified.'))), $this->buildViewList(), array('status' => array('view' => array('Status', 70), 'db' => array('ds.name', false, true), 'auth' => LEVEL_COLLABORATOR)));
     $this->sSortDefault = 'id_ncbi';
     // Because the disease information is publicly available, remove some columns for the public.
     $this->unsetColsByAuthLevel();
     // Set list of transcripts available for this variant for getForm(), checkFields(), etc...
     if (ACTION == 'create' || lovd_getProjectFile() == '/import.php') {
         $aTranscripts = $_DB->query('SELECT id, id_ncbi, geneid, id_mutalyzer FROM ' . TABLE_TRANSCRIPTS . ' WHERE geneid IN (?' . str_repeat(', ?', substr_count($sObjectID, ',')) . ') ' . (lovd_getProjectFile() == '/import.php' ? 'LIMIT 1' : 'ORDER BY id_ncbi'), explode(',', $sObjectID))->fetchAllRow();
     } else {
         $aTranscripts = $_DB->query('SELECT t.id, t.id_ncbi, t.geneid, t.id_mutalyzer FROM ' . TABLE_TRANSCRIPTS . ' AS t LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (t.id = vot.transcriptid) WHERE vot.id = ? ORDER BY t.geneid, t.id_ncbi', array($this->nID))->fetchAllRow();
     }
     foreach ($aTranscripts as $aTranscript) {
         $this->aTranscripts[$aTranscript[0]] = array($aTranscript[1], $aTranscript[2], $aTranscript[3]);
     }
     $this->sRowLink = 'variants/{{ID}}';
 }