コード例 #1
0
ファイル: Program.cs プロジェクト: hilasharim/Irys-Intensity
        static int GenomeAlignmentFromCmd(string[] args)
        {
            string keyFilePath             = args[0];
            string rCmapFilePath           = args[1];
            string outputDirPath           = args[2];
            int    projectId               = int.Parse(args[3]);
            float  lengthFilter            = float.Parse(args[4]) * 1000;
            float  confidenceFilter        = float.Parse(args[5]);
            float  alignedLenPercentFilter = float.Parse(args[6]);
            string queryLocation           = args[7];
            bool   saveChannel1            = int.Parse(args[8]) == 1 ? true : false;
            bool   saveChannel2            = int.Parse(args[9]) == 1 ? true : false;

            int readKeyChroms = CMAPParser.ReadKeyFile(keyFilePath);
            Tuple <List <int>, List <Tuple <int, int, int> > > locations = UserInputParser.getLocations(queryLocation, null);
            List <int> chromIdsFilter = locations.Item1;
            List <Tuple <int, int, int> > chromStartEndFilter = locations.Item2;

            CMAPParser.rCmapPositions = CMAPParser.ParseCmap(rCmapFilePath, 1);

            List <Molecule> selectedMolecules = DatabaseManager.SelectMoleculesForGenomeAlignment(projectId, lengthFilter, confidenceFilter, alignedLenPercentFilter, null, chromIdsFilter,
                                                                                                  chromStartEndFilter);

            foreach (Molecule molecule in selectedMolecules)
            {
                CMAPParser.FitMoleculeToRef(molecule, saveChannel1, saveChannel2, outputDirPath);
            }

            return(0);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: hilasharim/Irys-Intensity
        private void get_output_button_Click(object sender, EventArgs e)
        {
            Stopwatch stopwatch   = new Stopwatch();
            string    rCmapPath   = r_cmap_file_path_txtbx.Text;
            string    keyFilePath = key_file_path_txtbx2.Text;
            string    outputDir   = output_dir_txtbx.Text;

            if (String.IsNullOrEmpty(rCmapPath) || String.IsNullOrEmpty(keyFilePath))
            {
                MessageBox.Show("r_cmap and key file required for analysis", "Missing file");
                return;
            }
            if (String.IsNullOrEmpty(outputDir))
            {
                MessageBox.Show("Missing output directory path", "Missing path");
                return;
            }
            stopwatch.Start();
            CMAPParser.rCmapPositions = CMAPParser.ParseCmap(rCmapPath, 1);
            if (CMAPParser.rCmapPositions == null)
            {
                MessageBox.Show("Unable to open file: " + rCmapPath, "Problem accessing file");
                return;
            }
            int chroms = CMAPParser.ReadKeyFile(keyFilePath);

            if (chroms < 0)
            {
                MessageBox.Show("Unable to open file: " + keyFilePath, "Problem accessing file");
                return;
            }
            List <Molecule> selectedMolecules = DatabaseManager.SelectMoleculesForGenomeAlignment(projectID, lengthFilter, confidenceFilter, alignedLenPercentFilter, molIdsFilterArray, chromIdsFilter,
                                                                                                  chromStartEndFilter);

            foreach (Molecule molecule in selectedMolecules)
            {
                CMAPParser.FitMoleculeToRef(molecule, save_ch1_checkbx.Checked, save_ch2_checkbx.Checked, outputDir);
            }
            MessageBox.Show(stopwatch.Elapsed.ToString());
        }