示例#1
0
        public static Dictionary <TCGATechnologyType, Dictionary <TCGASampleType, List <BarInfo> > > GetTumorSampleMap(string tumordir)
        {
            var result = new Dictionary <TCGATechnologyType, Dictionary <TCGASampleType, List <BarInfo> > >();

            List <DatasetInfo> microarray = TCGAUtils.GetMicroarrayDatasets(tumordir);
            var affy    = microarray.Find(m => m.Name.Equals("U133A"));
            var agilent = microarray.Find(m => m.Name.Equals("Agil3"));

            if (agilent == null)
            {
                agilent = microarray.Find(m => m.Name.Equals("Agil2"));
            }

            var rnaseqv1 = TCGAUtils.GetRnaSeqV1DataSet(tumordir);
            var rnaseqv2 = TCGAUtils.GetRnaSeqV2DataSet(tumordir);

            DatasetInfo[] dis          = new[] { affy, agilent, rnaseqv1, rnaseqv2 };
            var           technologies = EnumUtils.EnumToArray <TCGATechnologyType>();

            for (int i = 0; i < dis.Length; i++)
            {
                AddDataset(result, technologies[i], dis[i]);
            }
            return(result);
        }
        public IsobaricIonField()
        {
            InitializeComponent();

            Required = true;

            var plexTypes = EnumUtils.EnumToArray <IsobaricType>();
            var lst       = (from ptype in plexTypes
                             let definition = ptype.GetDefinition()
                                              from item in definition.Items
                                              select item.Index).Distinct().ToList();

            lst.Sort();

            foreach (var index in lst)
            {
                var cb = new CheckBox();
                cb.Parent = this;
                this.Controls.Add(cb);
                cb.Text     = index.ToString();
                cb.Name     = "cb" + cb.Text;
                cb.AutoSize = true;
                cb.Dock     = DockStyle.Left;
                cb.BringToFront();
                cb.TextAlign = ContentAlignment.MiddleLeft;
                AddCheckBox(cb, index);
            }
        }
示例#3
0
        public ITraqResultMultipleFileDistillerUI()
        {
            InitializeComponent();

            rawFiles.FileArgument = new OpenFileArgument("Raw Files", rawExtentions);

            RcpaMultipleFileComponent adaptor = new RcpaMultipleFileComponent(rawFiles.GetItemInfos(), "RawFiles", "Raw File", false, true);

            AddComponent(adaptor);

            individual = new RcpaCheckBox(cbIndividual, "Individual", false);
            AddComponent(individual);

            minPeakCount = new RcpaIntegerField(txtMinPeakCount, "MinPeakCount", "Minmum peak count", 4, true);
            AddComponent(minPeakCount);

            plexFiles = new string[] {
                new FileInfo(Application.ExecutablePath).Directory.FullName + "\\itraq-4plex.csv",
                new FileInfo(Application.ExecutablePath).Directory.FullName + "\\itraq-8plex.csv",
                new FileInfo(Application.ExecutablePath).Directory.FullName + "\\tmt-6plex.csv"
            };

            plexTypes = new RcpaComboBox <IsobaricType>(cbPlexType, "PlexType", EnumUtils.EnumToArray <IsobaricType>(), 0);
            AddComponent(plexTypes);

            txtIsotopeFileName.Items.AddRange(plexFiles);
            isotopeFile = new RcpaFileField2 <ComboBox>(btnIsotopeFile, txtIsotopeFileName, "IsotopeFile", new OpenFileArgument("Isotope Impurity Correction Table", "csv"), plexFiles[0], true, m => m.Text, (m, value) => m.Text = value);
            AddComponent(isotopeFile);

            readers = new RcpaComboBox <IITraqRawReader>(cbScanMode, "ScanMode", new IITraqRawReader[] { new ITraqRawHCDMS2Reader(), new ITraqRawHCDMS3Reader(), new ITraqRawHCDParallelMS3Reader(), new ITraqRawPQDCIDReader(), new ITraqRawPQDReader() }, 0);
            AddComponent(readers);

            normalizationBuilders = new RcpaComboBox <IITraqNormalizationBuilder>(cbNormalizationType, "NormalizationType",
                                                                                  new IITraqNormalizationBuilder[] { new ITraqNormalizationByMedianIntensityBuilder(), new ITraqNormalizationByTotalIntensityBuilder(), new ITraqNormalizationNoneBuilder() }, 1);

            AddComponent(normalizationBuilders);

            normalizationByIonInjectionTime = new RcpaCheckBox(cbNormalizeByIonInjectionTime, "normalizationByIonInjectionTime", false);
            AddComponent(normalizationByIonInjectionTime);

            precursorPPMTolerance = new RcpaDoubleField(txtPrecursorPPMTolerance, "precursorPPMTolerance", "Precursor Tolerance (ppm)", 10, true);
            AddComponent(precursorPPMTolerance);

            this.Text = Constants.GetSQHTitle(title, version);
        }
示例#4
0
        private static void AddDataset(Dictionary <TCGATechnologyType, Dictionary <TCGASampleType, List <BarInfo> > > tumormap, TCGATechnologyType technolyType, DatasetInfo datasetInfo)
        {
            var map = new Dictionary <TCGASampleType, List <BarInfo> >();

            tumormap[technolyType] = map;
            foreach (var type in EnumUtils.EnumToArray <TCGASampleType>())
            {
                map[type] = new List <BarInfo>();
            }

            if (datasetInfo == null)
            {
                return;
            }

            foreach (var key in datasetInfo.BarInfoListMap)
            {
                var type = TCGAUtils.GetSampleType(key.Key);
                map[type].Add(key.Value.First());
            }
        }
示例#5
0
        public IsobaricPeptideStatisticBuilderUI()
        {
            InitializeComponent();

            peptideFile = new RcpaFileField(btnPeptideFile, txtPeptideFile, "PeptideFile", new OpenFileArgument("Peptides", "peptides"), true);
            AddComponent(this.peptideFile);

            designFile = new RcpaFileField(btnDesignFile, txtDesignFile, "IsobaricDesignFile", new OpenFileArgument("Isobaric Labeling Experimental Design", "experimental.xml"), true);
            AddComponent(this.designFile);

            normalize = new RcpaCheckBox(cbNormalize, "Normalize", false);
            AddComponent(normalize);

            modes = new RcpaComboBox <QuantifyMode>(cbQuantifyMode, "QuantifyMode", EnumUtils.EnumToArray <QuantifyMode>(), 0, true);
            AddComponent(modes);

            modifiedAminoacids = new RcpaTextField(txtModifiedAminoacids, "ModifiedAminoacids", "Input modified amino acids", "STY", false);
            AddComponent(modifiedAminoacids);

            minimumSiteProbability = new RcpaDoubleField(txtMinimumSiteProbability, "MinimumSiteProbability", "Input minimum phosphylation site probability", 0.9, false);
            AddComponent(minimumSiteProbability);

            this.Text = Constants.GetSQHTitle(title, version);
        }
        public UniformSummaryBuilderUI()
        {
            InitializeComponent();

            Option = new BuildSummaryOptions();

            InsertButton(2, btnNew);

            InsertButton(3, this.btnLoadParam);

            InsertButton(4, this.btnSaveParam);

            this.minDecoyScan.DefaultValue = MascotGenericFormatShiftPrecursorProcessorOptions.DEFAULT_ShiftScan.ToString();

            this.decoyPattern = new RcpaTextField(this.txtDecoyPattern, "DecoyPattern", "Decoy Database Pattern", "^REVERSED_", false);
            AddComponent(this.decoyPattern);

            this.removeContamination = new RcpaCheckBox(cbRemoveContamination, "RemoveContamination", false);
            AddComponent(this.removeContamination);

            this.contaminationNamePattern = new RcpaTextField(this.txtContaminantString, "ContaminationNamePattern", "Contaminant Name Pattern", "CON_", false);
            AddComponent(this.contaminationNamePattern);

            this.contaminationDescriptionPattern = new RcpaTextField(this.txtContaminantDescriptionPattern, "ContaminantDescriptionPattern", "Contaminant Description Pattern", "KERATIN", false);
            AddComponent(this.contaminationDescriptionPattern);

            this.filterByFdr = new RcpaCheckBox(this.cbFilterByFDR, "FilterByFDR", true);
            AddComponent(this.filterByFdr);

            this.maxFdr = new RcpaDoubleField(this.txtMaxFdr, "MaxFdr", "Max False Discovery Rate", 0.01, true);
            AddComponent(this.maxFdr);

            this.maxPeptideFdr = new RcpaDoubleField(this.txtMaxPeptideFdr, "MaxPeptideFdr", "Max Peptide FDR", 0.01, true);
            AddComponent(this.maxPeptideFdr);

            this.filterProteinByPeptideCount = new RcpaCheckBox(this.cbPeptideCount, "FilterProteinByPeptideCount", false);
            AddComponent(this.filterProteinByPeptideCount);

            this.fdrLevel = new RcpaComboBox <FalseDiscoveryRateLevel>(this.cbFdrLevel, "FdrLevel",
                                                                       new[]
            {
                FalseDiscoveryRateLevel.Peptide,
                FalseDiscoveryRateLevel.Protein,
                FalseDiscoveryRateLevel.SimpleProtein,
                FalseDiscoveryRateLevel.UniquePeptide
            }, 1);
            AddComponent(this.fdrLevel);

            this.peptideRetrieval = new RcpaCheckBox(this.cbPeptideRetrieval, "PeptideRetrieval", true);
            AddComponent(this.peptideRetrieval);

            this.fdrType = new RcpaComboBox <FalseDiscoveryRateType>(this.cbFdrType, "FdrType",
                                                                     new[]
            {
                FalseDiscoveryRateType.Target,
                FalseDiscoveryRateType.Total
            },
                                                                     new[]
            {
                "Target : N(decoy) / N(target)",
                "Global : N(decoy) * 2 / (N(decoy) + N(target))"
            }, 0);
            AddComponent(this.fdrType);

            this.classifyByCharge = new RcpaCheckBox(this.cbClassifyByCharge, "ClassifyByCharge", ClassificationOptions.DEFAULT_ClassifyByCharge);
            AddComponent(this.classifyByCharge);

            this.classifyByMissCleavage = new RcpaCheckBox(this.cbClassifyByMissCleavage, "ClassifyByMissCleavage", ClassificationOptions.DEFAULT_ClassifyByMissCleavage);
            AddComponent(this.classifyByMissCleavage);

            this.classifyByNumberOfProteaseTermini = new RcpaCheckBox(this.cbClassifyByPreteaseTermini, "ClassifyByNumberOfProteaseTermini", ClassificationOptions.DEFAULT_ClassifyByNumProteaseTermini);
            AddComponent(this.classifyByNumberOfProteaseTermini);

            this.classifyByModification = new RcpaCheckBox(this.cbClassifyByModification, "ClassifyByModification", ClassificationOptions.DEFAULT_ClassifyByModification);
            AddComponent(this.classifyByModification);

            this.modifiedAminoacids = new RcpaTextField(this.txtFdrModifiedAminoacids, "ModifiedAminoacids", "Modified Aminoacids", "STY", true);
            this.modifiedAminoacids.PreCondition = this.cbClassifyByModification;
            AddComponent(this.modifiedAminoacids);

            this.classifyByProteinTag = new RcpaCheckBox(this.cbClassifyByProteinTag, "ClassifyByProteinTag", ClassificationOptions.DEFAULT_ClassifyByProteinTag);
            AddComponent(this.classifyByProteinTag);

            this.proteinTag = new RcpaTextField(this.txtProteinTag, "ProteinTag", "Protein Tag", "", false);
            this.proteinTag.PreCondition = this.cbClassifyByProteinTag;
            AddComponent(this.proteinTag);

            this.minimumSpectraPerGroup = new RcpaIntegerField(this.txtMinimumSpectraPerGroup, "MinimumSpectraPerGroup", "MinimumSpectraPerGroup", ClassificationOptions.DEFAULT_MinimumSpectraPerGroup, true);
            AddComponent(this.minimumSpectraPerGroup);

            this.filterSequenceLength = new RcpaCheckBox(this.cbSequenceLength, "FilterSequenceLength", false);
            AddComponent(this.filterSequenceLength);

            this.minSequenceLength = new RcpaIntegerField(this.txtMinSequenceLength, "MinSequenceLength", "Minmum Sequence Length", PeptideFilterOptions.DEFAULT_MinSequenceLength, false);
            this.minSequenceLength.PreCondition = cbSequenceLength;
            AddComponent(this.minSequenceLength);

            this.filterMaxMissCleavage = new RcpaCheckBox(this.cbMaxMissCleavage, "FilterMaxMisscleavage", false);
            AddComponent(this.filterMaxMissCleavage);

            this.maxMissCleagage = new RcpaIntegerField(this.txtMaxMissCleavage, "MaxMissCleavage", "Maximum Number of Internal Missed Cleavage", PeptideFilterOptions.DEFAULT_MaxMissCleavage, false);
            this.maxMissCleagage.PreCondition = cbMaxMissCleavage;
            AddComponent(this.maxMissCleagage);

            this.removeDecoyEntry = new RcpaCheckBox(this.cbRemoveDecoyEntry, "RemovePeptideFromDecoyDB", false);
            AddComponent(this.removeDecoyEntry);

            this.database = new RcpaFileField(btnDatabase, txtDatabase, "Database", new OpenFileArgument("Protein Database", "fasta"), "", true);
            AddComponent(this.database);

            this.acParsers = new RcpaComboBox <IAccessNumberParser>(this.cbAccessNumberPattern, "AccessNumberPattern", AccessNumberParserFactory.GetParsers().ToArray(), 0);
            AddComponent(this.acParsers);

            this.seConflictType = new RcpaComboBox <IResolveSearchEngineConflictType>(cbConflict, "ConflictType", ResolveSearchEngineConflictTypeFactory.GetTypes(), 1);
            AddComponent(this.seConflictType);

            this.conflictAsDecoy = new RcpaComboBox <ITargetDecoyConflictType>(cbConflictAsDecoy, "ConflictAsDecoy", ResolveTargetDecoyConflictTypeFactory.GetTypes(), 0);
            AddComponent(this.conflictAsDecoy);

            this.minAgreeCount = new RcpaIntegerField(txtMinAgreeCount, "MinAgreeCount", "Minimum agree count of engines", 1, true);
            AddComponent(this.minAgreeCount);

            minOneHitWonderPeptideCount = new RcpaIntegerField(txtMinOneHitWonderPeptideCount, "MinOneHitWonderPeptideCount", "minimum one-hit-wonder peptide count", 2, false);
            AddComponent(minOneHitWonderPeptideCount);
            minOneHitWonderPeptideCount.PreCondition = FilterOneHitWonder;

            this.AfterLoadOption += DoAfterLoadOption;

            Text = Constants.GetSQHTitle(title, version);

            var engines = EnumUtils.EnumToArray <SearchEngineType>().OrderByDescending(m => m.ToString()).ToArray();

            foreach (var engine in engines)
            {
                if (engine.HasFactory())
                {
                    var button = new Button();
                    pnlAdd.Controls.Add(button);
                    button.Dock = System.Windows.Forms.DockStyle.Top;
                    button.UseVisualStyleBackColor = true;
                    button.Text   = "Add " + engine.ToString();
                    button.Name   = "btnAdd" + engine.ToString();
                    button.Tag    = engine;
                    button.Click += button_Click;
                }
            }
            pnlAdd.Update();
        }
示例#7
0
        public static IsobaricType Find(string isobaricTypeName)
        {
            var types = EnumUtils.EnumToArray <IsobaricType>();

            return(types.FirstOrDefault(m => m.ToString().Equals(isobaricTypeName)));
        }