예제 #1
0
        public TCGADatatableBuilderUI()
        {
            InitializeComponent();

            rootDir.SetDirectoryArgument("TCGARoot", "TCGA Data Root");

            targetFile.FileArgument = new SaveFileArgument("Target Data", "tsv");

            lbDataTypes.Items.AddRange(TCGATechnology.GetTechnologyNames().ToArray());

            lbSampleTypes.Items.AddRange(TCGASampleCode.GetSampleCodes().OrderBy(m => m.Code).ToList().ConvertAll(m => string.Format("{0}, {1}", m.ShortLetterCode, m.Definition)).ToArray());

            this.Text = Constants.GetSQHTitle(title, version);
        }
예제 #2
0
        public override bool PrepareOptions()
        {
            if (!Directory.Exists(this.TCGADirectory))
            {
                ParsingErrors.Add(string.Format("Directory not exists {0}.", this.TCGADirectory));
                return(false);
            }

            try
            {
                TCGATechnology.Parse(this.DataType);
            }
            catch (Exception ex)
            {
                ParsingErrors.Add(ex.Message);
                return(false);
            }

            foreach (var tumor in this.TumorTypes)
            {
                var tumordir = this.TCGADirectory + "/" + tumor;
                if (!Directory.Exists(tumordir))
                {
                    ParsingErrors.Add(string.Format("Directory not exists {0}.", tumordir));
                    return(false);
                }
            }

            if (TCGASampleCodeStrings == null || TCGASampleCodeStrings.Count == 0)
            {
                TCGASampleCodeStrings = (from v in TCGASampleCode.GetSampleCodes()
                                         select v.ShortLetterCode).ToList();
            }
            else
            {
                try
                {
                    GetTCGASampleCodes();
                }
                catch (Exception ex)
                {
                    ParsingErrors.Add(ex.Message);
                    return(false);
                }
            }

            try
            {
                GetTechnology();
            }
            catch (Exception ex)
            {
                ParsingErrors.Add(ex.Message);
                return(false);
            }

            if (this.Platforms == null || this.Platforms.Count == 0)
            {
                var tec = GetTechnology();
                this.Platforms = (from tumor in TumorTypes
                                  let dir = Path.Combine(this.TCGADirectory, tumor)
                                            let tecdir = tec.GetTechnologyDirectory(dir)
                                                         from subdir in Directory.GetDirectories(tecdir)
                                                         select Path.GetFileName(subdir)).Distinct().OrderBy(m => m).ToList();
            }

            return(true);
        }