/// <summary> /// This function retrieves a list of found proteins fulfilling the search criteria. /// </summary> public DataTable GetProteinsByName(string name) { try { var query = @"SELECT proteinsbyname.ID, Min(proteinsbyname.GENE_NAME) AS GENE_NAME, Min(proteinsbyname.NAME_TYPE) AS NAME_TYPE, proteinsbyname.SYMBOL, proteinsbyname.GENE_ID, proteinsbyname.OFFICIAL_FULL_NAME, case when Exists(SELECT NULL FROM TAB_GENE_VARIANTS v, TAB_EXPRESSION_DATA_VALUES e WHERE e.VARIANT_ID = v.VARIANT_ID AND v.GENE_ID = proteinsbyname.ID) then 1 else 0 end AS HAS_DATA FROM (SELECT gn.GENE_ID AS ID, gn.GENE_NAME, gn.NAME_TYPE, (SELECT Min(s.GENE_NAME) FROM TAB_GENE_NAMES s WHERE s.GENE_ID = gn.GENE_ID AND s.NAME_TYPE = 'SYMBOL') AS SYMBOL, (SELECT Min(s.GENE_NAME) FROM TAB_GENE_NAMES s WHERE s.GENE_ID = gn.GENE_ID AND s.NAME_TYPE = 'GENE_ID') AS GENE_ID, (SELECT Min(s.GENE_NAME) FROM TAB_GENE_NAMES s WHERE s.GENE_ID = gn.GENE_ID AND s.NAME_TYPE = 'OFFICIAL_FULL_NAME') AS OFFICIAL_FULL_NAME FROM TAB_GENE_NAMES AS gn WHERE gn.GENE_NAME like @P_NAME) as proteinsbyname GROUP BY proteinsbyname.ID, proteinsbyname.SYMBOL, proteinsbyname.GENE_ID, proteinsbyname.OFFICIAL_FULL_NAME"; _databaseObject.AddParameter(P_NAME, name, DAS.ParameterModes.PARM_IN, DAS.ServerTypes.STRING); return(executeStatementForDataTable(query)); } finally { _databaseObject.RemoveParameter(P_NAME); } }
/// <summary> /// This function retrieves a list of found proteins fulfilling the search criteria. /// </summary> public DataTable GetProteinsByName(string name) { DASDataTable retTable = null; try { _databaseObject.AddParameter(P_NAME, name, DAS.ParameterModes.PARM_IN, DAS.ServerTypes.ST_VARCHAR2); retTable = _databaseObject.CreateAndFillDataTable( $"SELECT {QRY_FIND_PROTEINS_COLUMNS} FROM {QRY_PROTEINS_BY_NAME} WHERE {P_NAME} = @{P_NAME}"); } finally { _databaseObject.RemoveParameter(P_NAME); } return(retTable); }
private static void removeNameParameter(DAS connection) { connection.RemoveParameter(_pName); }