Ejemplo n.º 1
0
        private void AddAFile(string filepath)
        {
            var theExtension = Path.GetExtension(filepath).ToLowerInvariant();

            theExtension = theExtension == ".gz" ? Path.GetExtension(Path.GetFileNameWithoutExtension(filepath)).ToLowerInvariant() : theExtension;
            switch (theExtension)
            {
            case ".fastq":
                RNASeqFastqDataGrid rnaSeqFastq = new RNASeqFastqDataGrid(filepath);
                RnaSeqFastqCollection.Add(rnaSeqFastq);
                UpdateOutputFolderTextbox();
                break;

            case ".toml":
                TomlTable tomlFile = null;
                try
                {
                    tomlFile = Toml.ReadFile(filepath);
                }
                catch (Exception)
                {
                    break;
                }
                var ye1 = Toml.ReadFile <Options>(filepath);
                AddTaskToCollection(ye1);
                break;
            }
        }
Ejemplo n.º 2
0
        private void AddAFile(string filepath)
        {
            if (SraCollection.Count == 0)
            {
                var theExtension = Path.GetExtension(filepath).ToLowerInvariant();
                theExtension = theExtension == ".gz" ? Path.GetExtension(Path.GetFileNameWithoutExtension(filepath)).ToLowerInvariant() : theExtension;
                switch (theExtension)
                {
                case ".fastq":
                    if (Path.GetFileName(filepath).Contains("_1") || Path.GetFileName(filepath).Contains("_2"))
                    {
                        RNASeqFastqDataGrid rnaSeqFastq = new RNASeqFastqDataGrid(filepath);
                        RnaSeqFastqCollection.Add(rnaSeqFastq);
                        UpdateOutputFolderTextbox();
                        break;
                    }
                    else
                    {
                        MessageBox.Show("FASTQ files must have *_1.fastq and *_2.fastq extensions.", "Run Workflows", MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    //case ".toml":
                    //    TomlTable tomlFile = null;
                    //    try
                    //    {
                    //        tomlFile = Toml.ReadFile(filepath);
                    //    }
                    //    catch (Exception)
                    //    {
                    //        break;
                    //    }
                    //    var ye1 = Toml.ReadFile<Options>(filepath);
                    //    AddTaskToCollection(ye1);
                    //    break;
                }
            }
            else
            {
                MessageBox.Show("User already added SRA number. Please only choose one input: 1) SRA accession 2) FASTQ files.", "Run Workflows", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
        }