Exemplo n.º 1
0
        public void RunTraining(string rawDirectoryPath, string targetFilePath, string decoyFilePath, double hcdError = 30, double cidError = 500)
        {
            // Read target file
            var targetReader = new LipidMapsDbReader <Lipid>();
            var targets      = targetReader.ReadFile(new FileInfo(targetFilePath));

            // Read decoy file
            var decoyReader = new LipidMapsDbReader <Lipid>();
            var decoys      = decoyReader.ReadFile(new FileInfo(decoyFilePath));

            var files = Directory.GetFiles(rawDirectoryPath);

            foreach (var rawFilePath in files.Where(file => file.EndsWith(".raw")))
            {
                // create output paths
                var rawFileName       = Path.GetFileName(rawFilePath);
                var datasetPath       = Path.GetDirectoryName(rawFilePath);
                var datasetName       = Path.GetFileNameWithoutExtension(rawFilePath);
                var targetResultsPath = Path.Combine(datasetPath, string.Format("{0}_target.tsv", datasetName));
                var decoyResultsPath  = Path.Combine(datasetPath, string.Format("{0}_decoy.tsv", datasetName));

                // Run liquid global workflow
                var globalWorkflow = new GlobalWorkflow(rawFilePath);
                var targetResults  = globalWorkflow.RunGlobalWorkflow(targets, hcdError, cidError);
                var decoyResults   = globalWorkflow.RunGlobalWorkflow(decoys, hcdError, cidError);

                // Output results
                LipidGroupSearchResultWriter.OutputResults(targetResults, targetResultsPath, rawFileName);
                LipidGroupSearchResultWriter.OutputResults(decoyResults, decoyResultsPath, rawFileName);

                // Assure that the source data file is closed
                globalWorkflow.LcMsRun.Close();
            }
        }
Exemplo n.º 2
0
        public void TestReadLipidMaps()
        {
            var fileLocation = @"../../../testFiles/Global_LipidMaps_Pos.txt";
            var fileInfo     = new FileInfo(fileLocation);
            var lipidReader  = new LipidMapsDbReader <Lipid>();
            var lipidList    = lipidReader.ReadFile(fileInfo);

            Console.WriteLine(lipidList.Count);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Main functionality for running the LIQUID workflow and outputting the results
        /// </summary>
        /// <param name="targetsFilePath"></param>
        /// <param name="outputFileName"></param>
        /// <param name="datasetNamesList"></param>
        private void RunWorkflowAndOutput(string targetsFilePath, string outputFileName, List <string> datasetNamesList)
        {
            var targetsFileInfo = new FileInfo(targetsFilePath);
            var lipidReader     = new LipidMapsDbReader <Lipid>();
            var lipidList       = lipidReader.ReadFile(targetsFileInfo);
            var headerWritten   = false;

            foreach (var datasetName in datasetNamesList)
            {
                var rawFileName = datasetName + ".raw";

                var rawFilePath = Path.Combine(@"D:\Data\Liquid\Original", rawFileName);


                Console.WriteLine(DateTime.Now + ": Processing " + datasetName);

                if (File.Exists(rawFilePath))
                {
                    Console.WriteLine(DateTime.Now + ": Dataset already exists");
                }
                else
                {
                    Console.WriteLine(DateTime.Now + ": Dataset does not exist locally, so we will go get it");

                    // Lookup in DMS via Mage
                    var dmsFolder         = DmsDatasetFinder.FindLocationOfDataset(datasetName);
                    var dmsDirectoryInfo  = new DirectoryInfo(dmsFolder);
                    var fullPathToDmsFile = Path.Combine(dmsDirectoryInfo.FullName, rawFileName);

                    // Copy Locally
                    // TODO: Handle files that are on MyEMSL
                    Console.WriteLine(DateTime.Now + ": Copying dataset from " + dmsDirectoryInfo.FullName);
                    File.Copy(fullPathToDmsFile, rawFilePath);
                    Console.WriteLine(DateTime.Now + ": Copy complete");
                }

                // Setup workflow
                var globalWorkflow = new GlobalWorkflow(rawFilePath);

                // Run workflow
                var lipidGroupSearchResults = globalWorkflow.RunGlobalWorkflow(lipidList, 30, 500);

                if (!headerWritten)
                {
                    LipidGroupSearchResultWriter.OutputResults(lipidGroupSearchResults, outputFileName, rawFileName, null, true, true);
                    headerWritten = true;
                }
                else
                {
                    LipidGroupSearchResultWriter.OutputResults(lipidGroupSearchResults, outputFileName, rawFileName, null, true, false);
                }

                // Assure that the source data file is closed
                globalWorkflow.LcMsRun.Close();
            }
        }
Exemplo n.º 4
0
        public void TestReadLipidMapsNegativeAndCreateTargets()
        {
            var fileLocation = @"../../../testFiles/Global_LipidMaps_Neg.txt";
            var fileInfo     = new FileInfo(fileLocation);
            var lipidReader  = new LipidMapsDbReader <Lipid>();
            var lipidList    = lipidReader.ReadFile(fileInfo);

            Console.WriteLine(lipidList.Count);

            foreach (var lipid in lipidList)
            {
                var lipidTarget = lipid.LipidTarget;
            }
        }
Exemplo n.º 5
0
        public void TestMassCalibration()
        {
            var rawFileLocation = @"../../../testFiles/synaptosome_lipid_rafts_lipidomics_synlr_1_bottom__NEG_Polaroid_17Mar14_14-02-04.raw";
            var globalWorkflow  = new GlobalWorkflow(rawFileLocation);

            var fileLocation = @"../../../testFiles/Global_LipidMaps_NEG_3.txt";
            var fileInfo     = new FileInfo(fileLocation);
            var lipidReader  = new LipidMapsDbReader <Lipid>();
            var lipidList    = lipidReader.ReadFile(fileInfo);

            var massCalibrationResults = globalWorkflow.RunMassCalibration(lipidList, 50);

            Console.WriteLine(massCalibrationResults.PpmError);
            Console.WriteLine(massCalibrationResults.ErrorWidth);
        }
Exemplo n.º 6
0
        public void TestGlobalWorkflowNegative()
        {
            var rawFileLocation = @"../../../testFiles/Dey_Lipids_Top_2_3_rerun_Neg_05Jul13_Gimli_12-07-05.raw";
            var globalWorkflow  = new GlobalWorkflow(rawFileLocation);

            var fileLocation = @"../../../testFiles/Global_LipidMaps_Neg.txt";
            var fileInfo     = new FileInfo(fileLocation);
            var lipidReader  = new LipidMapsDbReader <Lipid>();
            var lipidList    = lipidReader.ReadFile(fileInfo);

            globalWorkflow.RunGlobalWorkflow(lipidList, 30, 500);

            // Assure that the source data file is closed
            globalWorkflow.LcMsRun.Close();
        }
Exemplo n.º 7
0
        public void TestGlobalWorkflowPositive()
        {
            var rawFileLocation = @"../../../testFiles/Dey_lipids_Bottom_2_1_pos_dil_Gimli_RZ-12-07-05.raw";
            var globalWorkflow  = new GlobalWorkflow(rawFileLocation);

            var fileLocation = @"../../../testFiles/Global_LipidMaps_Pos.txt";
            var fileInfo     = new FileInfo(fileLocation);
            var lipidReader  = new LipidMapsDbReader <Lipid>();
            var lipidList    = lipidReader.ReadFile(fileInfo);

            var lipidGroupSearchResults = globalWorkflow.RunGlobalWorkflow(lipidList, 30, 500);

            var filteredLipidGroupSearchResults = new List <LipidGroupSearchResult>();

            // Group results of same scan together
            var resultsGroupedByScan = lipidGroupSearchResults.GroupBy(x => x.SpectrumSearchResult.HcdSpectrum.ScanNum);

            // Grab the result(s) with the best score
            foreach (var group in resultsGroupedByScan)
            {
                var groupOrdered = group.OrderByDescending(x => x.SpectrumSearchResult.Score).ToList();

                for (var i = 0; i < 1 && i < groupOrdered.Count; i++)
                {
                    var resultToAdd = groupOrdered[i];

                    if (resultToAdd.LipidTarget.LipidClass == LipidClass.PC && resultToAdd.LipidTarget.AcylChainList.Count(x => x.NumCarbons > 0) == 2 && resultToAdd.LipidTarget.AcylChainList.Count(x => x.AcylChainType == AcylChainType.Standard) == 2)
                    {
                        filteredLipidGroupSearchResults.Add(resultToAdd);
                    }
                }
            }

            if (File.Exists("fragmentOutput.csv"))
            {
                File.Delete("fragmentOutput.csv");
            }
            TextWriter textWriter = new StreamWriter("fragmentOutput.csv");

            LipidGroupSearchResultWriter.AddHeaderForScoring(filteredLipidGroupSearchResults[0], textWriter);
            LipidGroupSearchResultWriter.WriteToCsvForScoring(filteredLipidGroupSearchResults, textWriter, "Dey_lipids_Bottom_2_1_pos_dil_Gimli_RZ-12-07-05");

            // Assure that the source data file is closed
            globalWorkflow.LcMsRun.Close();

            textWriter.Close();
        }
Exemplo n.º 8
0
        public void LoadMoreLipidTargets(string fileLocation)
        {
            IProgress <int> progress = new Progress <int>(ReportLipidTargetLoadProgress);

            var fileInfo = new FileInfo(fileLocation);

            var lipidReader = new LipidMapsDbReader <Lipid>();
            var lipidList   = lipidReader.ReadFile(fileInfo, progress);

            foreach (var lipid in lipidList)
            {
                LipidTargetList.Add(lipid);
            }

            OnPropertyChanged("LipidTargetList");

            //// Reset and populate the list of lipid classes
            //this.LipidClassList = new List<LipidClass>();
            //var groupByLipidClass = this.LipidTargetList.GroupBy(x => x.LipidTarget.LipidClass);
            //foreach (LipidClass lipidClass in groupByLipidClass.Select(@group => @group.Key))
            //{
            //  this.LipidClassList.Add(lipidClass);
            //}

            //if (this.LipidClassList.Count > 0)
            //{
            //  LipidClass lipidClass = this.LipidClassList[0];
            //  this.CurrentLipidClass = lipidClass;
            //  this.CurrentLipidTargetList = this.LipidTargetList.Where(x => x.LipidClass == lipidClass).ToList();

            //  OnPropertyChanged("CurrentLipidClass");
            //}

            //OnPropertyChanged("LipidClassList");
            //OnPropertyChanged("CurrentLipidTargetList");

            // Reset the progress bar back to 0
            progress.Report(0);
        }
Exemplo n.º 9
0
        public void CreateNewScoringModelNegative()
        {
            var datasetNames = new List <string>
            {
                "FECB_ATCC_29133_616_Dark_Lipid_NEG_150mm_20Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_616_Light_Lipid_NEG_150mm_20Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_819_Dark_Lipid_NEG_150mm_20Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_819_Light_Lipid_NEG_150mm_20Mar15_Polaroid_14-12-16",
                "FSFA_Isolate_HL53_0700_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL53_1000_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_1_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_2_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_3_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_1_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_2_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_3_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_1_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_2_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_3_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_1_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_2_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_3_lipid_NEG_150mm_24Aug15_Polaroid_HSST3-02",
                "Kleb_11pt5Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_12Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_13Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_14Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_15Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_16Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_17Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_18Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_19Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "Kleb_20Hr_Lipid_Neg_150mm_4Sept15_Polaroid_HSST3-02",
                "LCA_Ariadna_B_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Ariadna_M_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Ariadna_T_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Ariadna_T_lipid_NEG_150mm_31Mar15_Polaroid_14-12-16",
                "LCA_Dora_B_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Dora_B_lipid_NEG_150mm_31Mar15_Polaroid_14-12-16",
                "LCA_Dora_M_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Dora_M_lipid_NEG_150mm_31Mar15_Polaroid_14-12-16",
                "LCA_Dora_T_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Dora_T_lipid_NEG_150mm_31Mar15_Polaroid_14-12-16",
                "LCA_Emma_B_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Emma_B_lipid_NEG_150mm_31Mar15_Polaroid_14-12-16",
                "LCA_Emma_M_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_Emma_T_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "LCA_leaf_lipid_NEG_150mm_2Apr15_Polaroid_14-12-16",
                "MinT_Kans_Gly_A_Neg_rep1_10__lip_NEG_150mm_27May15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Neg_rep2_11__lip_NEG_150mm_27May15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Neg_rep3_12__lip_NEG_150mm_27May15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Plus_rep1_01__lip_NEG_150mm_27May15_Polaroid_HSST3",
                "MinT_Kans_Gly_A_Plus_rep2_02__lip_NEG_150mm_27May15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Plus_rep3_03__lip_NEG_150mm_27May15_Polaroid_HSST3-02",
                "mLM_CC_T2_002_lipid_19Dec14_Polaroid_14-12-16",
                "mLM_CC_T2_010_lipid_19Dec14_Polaroid_14-12-16",
                "mLM_CC_T2_011-014_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_012-015_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_013-016_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_018-019_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_020-023_P_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_022-024_P_Lipid_NEG_9Jan15_Polaroid_14-12-16",
                "mLM_Sub_Test_Mito_NEG_150mm_4Sept15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_1__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_2__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_3__lipid_NEG_150mm_17Jun15_Polaroid_HSST3-02",
                "OMICS_ICL102_691_0hr_Lipid_4_056_Neg_rr_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_0hr_Lipid_5_081_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_12hr_Lipid_4_053_Neg_rr_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_12hr_Lipid_5_079_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_18hr_Lipid_4_094_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_18hr_Lipid_5_097_Neg_rr_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_24hr_Lipid_4_114_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_24hr_Lipid_5_093_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_3hr_Lipid_4_044_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_3hr_Lipid_5_063_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_7hr_Lipid_4_057_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_7hr_Lipid_5_002_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_0hr_Lipid_4_088_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_0hr_Lipid_5_120_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_12hr_Lipid_4_065_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_12hr_Lipid_5_110_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_18hr_Lipid_4_030_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_18hr_Lipid_5_086_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_24hr_Lipid_4_078_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_24hr_Lipid_5_109_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_3hr_Lipid_4_117_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_3hr_Lipid_5_089_Neg_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_7hr_Lipid_4_047_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_7hr_Lipid_5_119_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_0hr_Lipid_4_112_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_0hr_Lipid_5_048_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_12hr_Lipid_4_061_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_12hr_Lipid_5_050_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_18hr_Lipid_4_072_Neg_rr_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_18hr_Lipid_5_113_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_24hr_Lipid_4_046_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_24hr_Lipid_5_008_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_3hr_Lipid_4_020_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_3hr_Lipid_5_060_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_7hr_Lipid_4_115_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_7hr_Lipid_5_038_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_0hr_Lipid_4_107_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_0hr_Lipid_5_034_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_12hr_Lipid_4_023_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_12hr_Lipid_5_052_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_18hr_Lipid_4_070_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_18hr_Lipid_5_102_Neg_23Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_24hr_Lipid_4_118_Neg_30Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_24hr_Lipid_5_064_Neg_rr_28Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_3hr_Lipid_4_091_NEG_19Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_3hr_Lipid_5_074_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_7hr_Lipid_4_111_NEG_15Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_7hr_Lipid_5_068_Neg_30Jan15_Polaroid_14-12-16",
                "PVD_Test_lipid_1_PVD_test_lipids_NEG_150mm_22Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_2_PVD_test_lipids_NEG_150mm_22Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_3_PVD_test_lipids_NEG_150mm_22Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_4_PVD_test_lipids_NEG_150mm_22Mar15_Polaroid_14-12-16",
                "SOM_LIPIDS_1C_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_2C_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-1_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-3_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-4_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_SOF_NEG_150mm_10Jun15_Polaroid_HSST3-02",
                "Sullivan_Cbaltica_5E6_test_NEG_150mm_28May15_Polaroid_HSST3-02",
                "Sullivan_Cbaltica_5E7_test_NEG_150mm_28May15_Polaroid_HSST3-02"
            };
            var x = new Stopwatch();

            x.Start();

            const string negativeTargetsFileLocation = @"../../../testFiles/Global_LipidMaps_NEG_4.txt";
            var          negativeTargetsFileInfo     = new FileInfo(negativeTargetsFileLocation);
            var          lipidReader = new LipidMapsDbReader <Lipid>();
            var          lipidList   = lipidReader.ReadFile(negativeTargetsFileInfo);

            var liquidScoreModelCreator = new ScoreModelCreator();

            //liquidScoreModelCreator.AddDmsDatasets(new List<string> {datasetNames[0]});
            liquidScoreModelCreator.AddDmsDatasets(datasetNames);
            liquidScoreModelCreator.AddLipidTargets(lipidList);
            var scoreModel = liquidScoreModelCreator.CreateScoreModel(30, 500);

            //Console.WriteLine(scoreModel.ToString());

            ScoreModelSerialization.Serialize(scoreModel, "scoringTestNegative_Grant.xml");

            Console.WriteLine("Time Elapsed: " + x.Elapsed);
        }
Exemplo n.º 10
0
        public void CreateNewScoringModelPositive()
        {
            var datasetNames = new List <string>
            {
                "BTL_MeOH_a_HF_POS_112414_150mm_12Dec14_Polaroid_14-06-12",
                "BTL_MeOH_a_HF_POS_120514m_12Dec14_Polaroid_14-06-12",
                "BTL_MeOH_a_HF_POS_120914m_12Dec14_Polaroid_14-06-12",
                "BTL_MeOH_a_HF_POS_120914V2m_12Dec14_Polaroid_14-06-12",
                "FECB_ATCC_29133_616_Dark_Lipid_POS_150mm_24Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_616_Light_Lipid_POS_150mm_24Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_819_Dark_Lipid_POS_150mm_24Mar15_Polaroid_14-12-16",
                "FECB_ATCC_29133_819_Light_Lipid_POS_150mm_24Mar15_Polaroid_14-12-16",
                "FSFA_Isolate_HL53_0700_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL53_1000_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_1_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_2_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0050_3_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_1_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_2_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0200_3_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_1_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_2_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_0400_3_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_1_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_2_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "FSFA_Isolate_HL91_1000_3_lipid_POS_150mm_21Aug15_Polaroid_HSST3-02",
                "LCA_Ariadna_B_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Ariadna_M_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Ariadna_T_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_conc_mix_lipid_POS_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Dora_B_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Dora_B_lipid_POS_rr_150mm_30Mar15_Polaroid_14-12-16",
                "LCA_Dora_M_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Dora_M_lipid_POS_rr_150mm_30Mar15_Polaroid_14-12-16",
                "LCA_Dora_T_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Dora_T_lipid_POS_rr_150mm_30Mar15_Polaroid_14-12-16",
                "LCA_Emma_B_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Emma_B_lipid_POS_rr_150mm_30Mar15_Polaroid_14-12-16",
                "LCA_Emma_M_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_Emma_T_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "LCA_leaf_lipid_POS_150mm_25Mar15_Polaroid_14-12-16",
                "MinT_Kans_Gly_A_NEG_rep1_10__lip_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_NEG_rep2_11__lip_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_NEG_rep3_12__lip_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Plus_rep1_01__lip_POS_150mm_2Jun15_Polaroid_HSST3",
                "MinT_Kans_Gly_A_Plus_rep2_02__lip_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "MinT_Kans_Gly_A_Plus_rep3_03__lip_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "mLM_CC_T2_011-014_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_012-015_P_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_013-016_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_018-019_P_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_020-023_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_CC_T2_022-024_Lipid_POS_9Jan15_Polaroid_14-12-16",
                "mLM_Sub_Test_Mito_POS_150mm_01Sept15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6573_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6716_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6764_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6882_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6927_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6935_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO6976_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7117_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7324_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_1__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_2__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OHSUblotter_PO7355_3__lipid_POS_150mm_12Jun15_Polaroid_HSST3-02",
                "OMICS_ICL102_691_0hr_Lipid_4_056_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_0hr_Lipid_5_081_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_12hr_Lipid_4_053_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_12hr_Lipid_5_079_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_18hr_Lipid_4_094_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_18hr_Lipid_5_097_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_24hr_Lipid_4_114_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_24hr_Lipid_5_093_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_3hr_Lipid_4_044_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_3hr_Lipid_5_063_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_691_7hr_Lipid_4_057_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_691_7hr_Lipid_5_002_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_0hr_Lipid_4_088_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_0hr_Lipid_5_120_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_12hr_Lipid_4_065_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_12hr_Lipid_5_110_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_18hr_Lipid_4_030_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_18hr_Lipid_5_086_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_24hr_Lipid_4_078_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_24hr_Lipid_5_109_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_3hr_Lipid_4_117_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_3hr_Lipid_5_089_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_7hr_Lipid_4_047_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_AH1_7hr_Lipid_5_119_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_0hr_Lipid_4_112_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_0hr_Lipid_5_048_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_12hr_Lipid_4_061_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_12hr_Lipid_5_050_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_18hr_Lipid_4_072_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_18hr_Lipid_5_113_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_24hr_Lipid_4_046_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_24hr_Lipid_5_008_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_3hr_Lipid_4_020_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_3hr_Lipid_5_060_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_FM_7hr_Lipid_4_115_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_FM_7hr_Lipid_5_038_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_0hr_Lipid_4_107_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_0hr_Lipid_5_034_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_12hr_Lipid_4_023_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_12hr_Lipid_5_052_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_18hr_Lipid_4_070_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_18hr_Lipid_5_102_POS_27Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_24hr_Lipid_4_118_POS_6Jan15_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_24hr_Lipid_5_064_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_3hr_Lipid_4_091_POS_22Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_3hr_Lipid_5_074_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_7hr_Lipid_4_111_POS_17Dec14_Polaroid_14-12-16",
                "OMICS_ICL102_Mock_7hr_Lipid_5_068_POS_6Jan15_Polaroid_14-12-16",
                "PVD_Test_lipid_1_PVD_test_lipids_POS_150mm_23Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_1_PVD_test_lipids_POS_150mm_24Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_2_PVD_test_lipids_POS_150mm_23Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_2_PVD_test_lipids_POS_150mm_24Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_3_PVD_test_lipids_POS_150mm_23Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_3_PVD_test_lipids_POS_150mm_24Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_4_PVD_test_lipids_POS_150mm_23Mar15_Polaroid_14-12-16",
                "PVD_Test_lipid_4_PVD_test_lipids_POS_150mm_24Mar15_Polaroid_14-12-16",
                "SOM_LIPIDS_1C_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_2C_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-1_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-3_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_Hol-4_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "SOM_LIPIDS_SOF_POS_150mm_8Jun15_Polaroid_HSST3-02",
                "Sullivan_Cbaltica_5E6_test_POS_150mm_2Jun15_Polaroid_HSST3-02",
                "Sullivan_Cbaltica_5E7_test_POS_150mm_2Jun15_Polaroid_HSST3-02"
            };
            const string positiveTargetsFileLocation = @"../../../testFiles/Global_LipidMaps_POS_7b.txt";
            var          positiveTargetsFileInfo     = new FileInfo(positiveTargetsFileLocation);
            var          lipidReader = new LipidMapsDbReader <Lipid>();
            var          lipidList   = lipidReader.ReadFile(positiveTargetsFileInfo);

            var liquidScoreModelCreator = new ScoreModelCreator();

            //liquidScoreModelCreator.AddDmsDatasets(new List<string> {datasetNames[0]});
            liquidScoreModelCreator.AddDmsDatasets(datasetNames);
            liquidScoreModelCreator.AddLipidTargets(lipidList);
            var scoreModel = liquidScoreModelCreator.CreateScoreModel(30, 500);

            //Console.WriteLine(scoreModel.ToString());

            ScoreModelSerialization.Serialize(scoreModel, "scoringTestPositive.xml");
        }
Exemplo n.º 11
0
        public void TestCreatePositiveScoringModel()
        {
            var datasetNames = new List <string>
            {
                "XGA121_lipid_Calu3_1",
                "XGA121_lipid_Calu3_2",
                "XGA121_lipid_Calu3_3",
                "XGA121_lipid_Skin_1",
                "XGA121_lipid_Skin_2",
                "XGA121_lipid_Skin_3",
                "XGA121_lipid_plasma_1",
                "XGA121_lipid_plasma_2",
                "XGA121_lipid_plasma_3",
                "Vero_01_CM_0d_4_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_2_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_3_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_1_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_4_Lipid_POS_Gimli_15Jan14_13-07-04",
                "Vero_01_MTBE_0d_3_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_2_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_1_Lipid_POS_Gimli_15Jan14_13-07-01",
                "LCA_Atta_B_gar2_b_Reruns_31May13_Gimli_12-07-01",
                "LCA_Atta_T_gar1_a1_Reruns_31May13_Gimli_12-07-01",
                "LCA_Atta_M_gar3_a_Reruns_31May13_Gimli_12-07-01",
                "Da_12_1_POS_3K_Gimli_9Oct13_13-07-01",
                "Da_24_1_POS_3K_Gimli_9Oct13_13-07-01",
                "Daphnia_gut_TLE_POS_Gimli_21Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_01_POS_Gimli_24Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_02_POS_Gimli_24Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_03_POS_Gimli_24Jan14_13-07-01",
                "Oscar_28days_TLE__POS_04Feb14_13-07-01",
                "Oscar_21days_TLE__POS_04Feb14_13-07-01",
                "Oscar_21days_dark_TLE__POS_04Feb14_13-07-01",
                "Oscar_14day_TLE__POS_04Feb14_13-07-01"
            };
            //datasetNames.Add("Dey_lipids_Top_1_1_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Top_1_2_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Top_1_3_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_1_1_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_1_2_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_1_3_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Top_2_1_pos_dil_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Top_2_2_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Top_2_3_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_2_1_pos_dil_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_2_2_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Dey_lipids_Bottom_2_3_pos_Gimli_RZ-12-07-05");
            //datasetNames.Add("Lipid_QC_1_14Jan_POS_Gimli_14Jan14_13-07-01");
            //datasetNames.Add("Lipid_QC_1_14Jan_POS_Gimli_17JAN_13-07-01");

            const string positiveTargetsFileLocation = @"../../../testFiles/Global_LipidMaps_POS_5.txt";
            var          positiveTargetsFileInfo     = new FileInfo(positiveTargetsFileLocation);
            var          lipidReader = new LipidMapsDbReader <Lipid>();
            var          lipidList   = lipidReader.ReadFile(positiveTargetsFileInfo);

            var liquidScoreModelCreator = new ScoreModelCreator();

            //liquidScoreModelCreator.AddDmsDatasets(new List<string> {datasetNames[0]});
            liquidScoreModelCreator.AddDmsDatasets(datasetNames);
            liquidScoreModelCreator.AddLipidTargets(lipidList);
            var scoreModel = liquidScoreModelCreator.CreateScoreModel(30, 500);

            //Console.WriteLine(scoreModel.ToString());

            ScoreModelSerialization.Serialize(scoreModel, "scoringTestPositive.xml");
            //ScoreModel deserializedScoreModel = ScoreModelSerialization.Deserialize("scoringTestPositive.xml");

            //Console.WriteLine(deserializedScoreModel);

            //foreach (string datasetName in datasetNames)
            //{
            //  // Setup workflow
            //  GlobalWorkflow globalWorkflow = new GlobalWorkflow(datasetName);

            //  // Run workflow
            //  List<LipidGroupSearchResult> lipidGroupSearchResults = globalWorkflow.RunGlobalWorkflow(lipidList, 30, 500);

            //  foreach (var lipidGroupSearchResult in lipidGroupSearchResults)
            //  {
            //      double score = scoreModel.ScoreLipid(lipidGroupSearchResult);

            //      //Console.WriteLine(score + "\t" + lipidGroupSearchResult.LipidTarget.StrippedDisplay);
            //  }
            //}
        }
Exemplo n.º 12
0
        public void TestCreateScoringOutput()
        {
            const string positiveTargetsFileLocation = @"../../../testFiles/Global_LipidMaps_POS_v3.txt";
            var          positiveTargetsFileInfo     = new FileInfo(positiveTargetsFileLocation);
            var          lipidReader = new LipidMapsDbReader <Lipid>();
            var          lipidList   = lipidReader.ReadFile(positiveTargetsFileInfo);

            if (File.Exists("fragmentOutput.csv"))
            {
                File.Delete("fragmentOutput.csv");
            }
            TextWriter textWriter = new StreamWriter("fragmentOutput.csv");

            var datasetNames = new List <string>
            {
                //datasetNames.Add("Dey_lipids_Top_1_1_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Top_1_2_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Top_1_3_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_1_1_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_1_2_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_1_3_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Top_2_1_pos_dil_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Top_2_2_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Top_2_3_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_2_1_pos_dil_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_2_2_pos_Gimli_RZ-12-07-05");
                //datasetNames.Add("Dey_lipids_Bottom_2_3_pos_Gimli_RZ-12-07-05");
                "XGA121_lipid_Calu3_1",
                "XGA121_lipid_Calu3_2",
                "XGA121_lipid_Calu3_3",
                "XGA121_lipid_Skin_1",
                "XGA121_lipid_Skin_2",
                "XGA121_lipid_Skin_3",
                "XGA121_lipid_plasma_1",
                "XGA121_lipid_plasma_2",
                "XGA121_lipid_plasma_3",
                "Vero_01_CM_0d_4_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_2_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_3_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_CM_0d_1_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_4_Lipid_POS_Gimli_15Jan14_13-07-04",
                "Vero_01_MTBE_0d_3_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_2_Lipid_POS_Gimli_15Jan14_13-07-01",
                "Vero_01_MTBE_0d_1_Lipid_POS_Gimli_15Jan14_13-07-01",
                "LCA_Atta_B_gar2_b_Reruns_31May13_Gimli_12-07-01",
                "LCA_Atta_T_gar1_a1_Reruns_31May13_Gimli_12-07-01",
                "LCA_Atta_M_gar3_a_Reruns_31May13_Gimli_12-07-01",
                "Da_12_1_POS_3K_Gimli_9Oct13_13-07-01",
                "Da_24_1_POS_3K_Gimli_9Oct13_13-07-01",
                //datasetNames.Add("Lipid_QC_1_14Jan_POS_Gimli_14Jan14_13-07-01");
                //datasetNames.Add("Lipid_QC_1_14Jan_POS_Gimli_17JAN_13-07-01");
                "Daphnia_gut_TLE_POS_Gimli_21Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_01_POS_Gimli_24Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_02_POS_Gimli_24Jan14_13-07-01",
                "OMICS_HH_CDT_Lip_108_03_POS_Gimli_24Jan14_13-07-01",
                "Oscar_28days_TLE__POS_04Feb14_13-07-01",
                "Oscar_21days_TLE__POS_04Feb14_13-07-01",
                "Oscar_21days_dark_TLE__POS_04Feb14_13-07-01",
                "Oscar_14day_TLE__POS_04Feb14_13-07-01"
            };

            for (var datasetIndex = 0; datasetIndex < datasetNames.Count; datasetIndex++)
            {
                var datasetName = datasetNames[datasetIndex];
                var rawFileName = datasetName + ".raw";

                Console.WriteLine(DateTime.Now + ": Processing " + datasetName);

                if (File.Exists(rawFileName))
                {
                    Console.WriteLine(DateTime.Now + ": Dataset already exists");
                }
                else
                {
                    Console.WriteLine(DateTime.Now + ": Dataset does not exist locally, so we will go get it");

                    // Lookup in DMS via Mage
                    var dmsFolder         = DmsDatasetFinder.FindLocationOfDataset(datasetName);
                    var dmsDirectoryInfo  = new DirectoryInfo(dmsFolder);
                    var fullPathToDmsFile = Path.Combine(dmsDirectoryInfo.FullName, rawFileName);

                    // Copy Locally
                    // TODO: Handle files that are on MyEMSL
                    Console.WriteLine(DateTime.Now + ": Copying dataset from " + dmsDirectoryInfo.FullName);
                    File.Copy(fullPathToDmsFile, rawFileName);
                    Console.WriteLine(DateTime.Now + ": Copy complete");
                }

                // Setup workflow
                var globalWorkflow = new GlobalWorkflow(rawFileName);

                // Run workflow
                var lipidGroupSearchResults = globalWorkflow.RunGlobalWorkflow(lipidList, 30, 500);

                var filteredLipidGroupSearchResults = new List <LipidGroupSearchResult>();

                // Group results of same scan together
                var resultsGroupedByScan = lipidGroupSearchResults.GroupBy(x => x.SpectrumSearchResult.HcdSpectrum.ScanNum);

                // Grab the result(s) with the best score
                foreach (var group in resultsGroupedByScan)
                {
                    var groupOrdered = group.OrderByDescending(x => x.SpectrumSearchResult.Score).ToList();

                    for (var i = 0; i < 1 && i < groupOrdered.Count; i++)
                    {
                        var resultToAdd = groupOrdered[i];

                        if (resultToAdd.LipidTarget.LipidClass == LipidClass.PC &&
                            resultToAdd.LipidTarget.AcylChainList.Count(x => x.NumCarbons > 0) == 2 &&
                            resultToAdd.LipidTarget.AcylChainList.Count(x => x.AcylChainType == AcylChainType.Standard) == 2)
                        {
                            filteredLipidGroupSearchResults.Add(resultToAdd);
                        }
                    }
                }

                // Output results
                if (datasetIndex == 0)
                {
                    LipidGroupSearchResultWriter.AddHeaderForScoring(filteredLipidGroupSearchResults[0], textWriter);
                }
                LipidGroupSearchResultWriter.WriteToCsvForScoring(filteredLipidGroupSearchResults, textWriter, datasetName);

                // Assure that the source data file is closed
                globalWorkflow.LcMsRun.Close();
            }

            textWriter.Close();
        }
Exemplo n.º 13
0
        public void RunTrainingOnFileList(
            string fileListPath,
            string posTargetFilePath,
            string posDecoyFilePath,
            string negTargetFilePath,
            string negDecoyFilePath,
            double hcdError = 30,
            double cidError = 500)
        {
            // Read positive target file
            var posTargetReader = new LipidMapsDbReader <Lipid>();
            var posTargets      = posTargetReader.ReadFile(new FileInfo(posTargetFilePath));

            // Read positive decoy file
            var posDecoyReader = new LipidMapsDbReader <Lipid>();
            var posDecoys      = posDecoyReader.ReadFile(new FileInfo(posDecoyFilePath));

            // Read positive target file
            var negTargetReader = new LipidMapsDbReader <Lipid>();
            var negTargets      = negTargetReader.ReadFile(new FileInfo(negTargetFilePath));

            // Read positive decoy file
            var negDecoyReader = new LipidMapsDbReader <Lipid>();
            var negDecoys      = negDecoyReader.ReadFile(new FileInfo(negDecoyFilePath));

            var outputDirectory = Path.GetDirectoryName(fileListPath);
            var errorFile       = Path.Combine(outputDirectory, "failedDatasets.txt");

            foreach (var datasetName in File.ReadLines(fileListPath))
            {
                if (datasetName.StartsWith("//"))
                {
                    continue;
                }

                try
                {
                    // create output paths
                    var rawFilePath       = GetRawFilePath(outputDirectory, datasetName);
                    var rawFileName       = Path.GetFileName(rawFilePath);
                    var targetResultsPath = Path.Combine(outputDirectory, string.Format("{0}_target.tsv", datasetName));
                    var decoyResultsPath  = Path.Combine(outputDirectory, string.Format("{0}_decoy.tsv", datasetName));

                    IEnumerable <Lipid> targets;
                    IEnumerable <Lipid> decoys;

                    // Select targets and decoys
                    var lowerCaseName = datasetName.ToLower();
                    if (lowerCaseName.Contains("pos"))
                    {
                        targets = posTargets;
                        decoys  = posDecoys;
                    }
                    else
                    {
                        targets = negTargets;
                        decoys  = negDecoys;
                    }

                    // Run liquid global workflow
                    var globalWorkflow = new GlobalWorkflow(rawFilePath);
                    var targetResults  = GetBestResultPerSpectrum(globalWorkflow.RunGlobalWorkflow(targets, hcdError, cidError));
                    var decoyResults   = GetBestResultPerSpectrum(globalWorkflow.RunGlobalWorkflow(decoys, hcdError, cidError));

                    // Output results
                    LipidGroupSearchResultWriter.OutputResults(targetResults, targetResultsPath, rawFileName);
                    LipidGroupSearchResultWriter.OutputResults(decoyResults, decoyResultsPath, rawFileName);

                    // Assure that the source data file is closed
                    globalWorkflow.LcMsRun.Close();
                }
                catch (Exception)
                {
                    Console.WriteLine("ERROR: Could not process dataset {0}.", datasetName);
                    using (var streamWriter = new StreamWriter(errorFile, true))
                    {
                        streamWriter.WriteLine(datasetName);
                    }
                }
            }
        }