コード例 #1
0
        public string GetAvailableNetworks([FromQuery] CoexpParams coexpdata)
        {
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetAvailableNetworks(coexpdata);

            return(response);
        }
コード例 #2
0
        public string GetModuleTOMGenes([FromQuery] CoexpParams coexpdata)
        {
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetModuleTOMGenes(coexpdata);

            return(response);
        }
コード例 #3
0
        public string GetNetworkCategories()
        {
            //getNetworkCategories()
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetNetworkCategories();

            return(response);
        }
コード例 #4
0
        public string GetCellTypeFromTissue([FromQuery] CoexpParams coexpdata)
        {
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetCellTypeFromTissue(coexpdata);

            response = response.Replace("_row", "Cell Type");

            return(response);
        }
コード例 #5
0
        public string PostGetModuleTOMGraph([FromBody] CoexpParams coexpdata)
        {
            /////////////////////////////////////////////////
            // 2. If, at least one gene has been found, we make a request to CoExp R
            /////////////////////////////////////////////////
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetModuleTOMGraph(coexpdata);

            return(response);
        }
コード例 #6
0
        public string PostReportOnGenesMultipleTissue([FromBody] CoexpParams coexpdata)
        {
            //category = which.one
            //network = tissue
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.ReportOnGenesMultipleTissue(coexpdata);

            string parsed_response = response.Replace("go.report", "go_report");

            parsed_response = parsed_response.Replace("pd.genes", "pd_genes");
            parsed_response = parsed_response.Replace("cell.type.pred", "cell_type_pred");
            //parsed_response = parsed_response.Replace("p.val.mods", "p_val_mods");
            parsed_response = parsed_response.Replace("tissue", "network");


            return(parsed_response);
        }
コード例 #7
0
        public string GetGOFromTissue([FromQuery] CoexpParams coexpdata)
        {
            //category = which.one
            //network = tissue
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GetGOFromTissue(coexpdata);

            //REPLACE CHARACTERS
            string parsed_response = response.Replace("query.number", "query_number");

            parsed_response = parsed_response.Replace("p.value", "p_value");
            parsed_response = parsed_response.Replace("term.size", "term_size");
            parsed_response = parsed_response.Replace("query.size", "query_size");
            parsed_response = parsed_response.Replace("overlap.size", "overlap_size");
            parsed_response = parsed_response.Replace("term.id", "term_id");
            parsed_response = parsed_response.Replace("subgraph.number", "subgraph_number");
            parsed_response = parsed_response.Replace("term.name", "term_name");
            parsed_response = parsed_response.Replace("relative.depth", "relative_depth");
            parsed_response = parsed_response.Replace(",", ", ");

            return(parsed_response);
        }
コード例 #8
0
        public string PostGlobalReportOnGenes([FromBody] CoexpParams coexpdata)
        {
            string parsed_response;

            //////////////////////////////////////////////
            //// 1. First, we check all typed genes
            //////////////////////////////////////////////
            //var provider = new PhysicalFileProvider(_hostingEnvironment.WebRootPath);
            //var genesfileInfo = provider.GetFileInfo("data/genes.txt");

            ////Read all ensembl genes from a .csv file.
            //string csvData = System.IO.File.ReadAllText(genesfileInfo.PhysicalPath);

            ////Convert both ensembl and typed genes into two different lists
            //IEnumerable<string> genes;
            //IEnumerable<string> ensembleData = csvData.Split("\r\n");
            //ensembleData = String.Join(',',ensembleData).Split(',');
            //if (coexpdata.Genes.Contains(", ")){
            //    genes = coexpdata.Genes.Split(", ");
            //}
            //else if (coexpdata.Genes.Contains(",")){
            //    genes = coexpdata.Genes.Split(",");
            //}
            //else{
            //    genes = coexpdata.Genes.Split(" ");
            //}

            ////Using LINQ we check whether the genes typed exist
            //if(genes.Any(x => ensembleData.Contains(x))) {

            //    IEnumerable<string> genesFound = genes.Where(p => ensembleData.Any(l => p == l)).ToList();
            //    IEnumerable<string> genesNotFound = genes.Where(p => !genesFound.Any(p2 => p == p2)).ToList();

            //    if (genesNotFound.Count() > 0)
            //    {
            //        parsed_response = String.Format("The following {0} genes from your list have not been found on Ensembl: {1}.\n\nWould you like to continue the request?",
            //            genesNotFound.Count(),
            //            String.Join(",", genesNotFound));

            //        //parsed_response = "[{\"message\":\""+ parsed_response + "\",\"genes\":\""+ String.Join(',', genesFound)+ "\"}]";
            //        parsed_response = JsonConvert.SerializeObject(new
            //        {
            //            message = parsed_response,
            //            genes = String.Join(",", genesFound),
            //            multipleData = coexpdata.MultipleSelectionData
            //        });
            //    }
            //    else
            //    {
            /////////////////////////////////////////////////
            // 2. If, at least one gene has been found, we make a request to CoExp R
            /////////////////////////////////////////////////
            CoExpRepository repository = new CoExpRepository(_hostingEnvironment);
            string          response   = repository.GlobalReportOnGenes(coexpdata);

            parsed_response = response.Replace("go.report", "go_report");
            parsed_response = parsed_response.Replace("pd.genes", "pd_genes");
            parsed_response = parsed_response.Replace("cell.type.pred", "cell_type_pred");
            //parsed_response = parsed_response.Replace("p.val.mods", "p_val_mods");
            parsed_response = parsed_response.Replace("tissue", "network");
            //    }
            //}else
            //{
            //    parsed_response = "Please, check your gene list. None of your genes has been found on Ensembl.";
            //}

            return(parsed_response);
        }