Exemplo n.º 1
0
        /// <summary>
        /// Export data from sheets to a particulat sequence file format
        /// </summary>
        private void OnExportClick(object sender, RibbonControlEventArgs e)
        {
            var formatter = ((sender as RibbonButton).Tag as ISequenceFormatter);
            if (formatter is FastAFormatter || formatter is FastQFormatter || formatter is GenBankFormatter
                || formatter is GffFormatter)
            {
                var sequenceSelection = new InputSelection();

                if (formatter is GenBankFormatter)
                {
                    sequenceSelection.MaximumSequenceCount = 1;
                    sequenceSelection.MinimumSequenceCount = 1;
                }

                sequenceSelection.GetSequencesForExport(this.DoExportSequence, formatter);
            }
            else
            {
                // as its not a ISequenceFormatter try to cast it to ISequenceRangeFormatter
                var rangeformatter = ((sender as RibbonButton).Tag as ISequenceRangeFormatter);

                if (rangeformatter is ISequenceRangeFormatter)
                {
                    var sequenceSelection = new InputSelection();
                    sequenceSelection.SequenceLabels = new[] { Resources.Export_BED_SequenceRangeString };
                    sequenceSelection.MaximumSequenceCount = 1;
                    sequenceSelection.PromptForSequenceName = false;
                    sequenceSelection.GetInputSequenceRanges(
                        this.DoExportRangeSequence,
                        false,
                        false,
                        false,
                        rangeformatter);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method Subtracts two query regions.
        /// </summary>
        /// <param name="sender">btnSubtract instance.</param>
        /// <param name="e">Event data</param>
        private void OnSubtractClick(object sender, RibbonControlEventArgs e)
        {
            this.ResetStatus();

            var inputs = new InputSelection();
            inputs.MinimumSequenceCount = 2;
            inputs.MaximumSequenceCount = 2;
            inputs.SequenceLabels = new[]
                                    {
                                        Resources.InputSelection_SequenceLabel_BED1,
                                        Resources.InputSelection_SequenceLabel_BED2,
                                        Resources.Export_BED_SequenceRangeString
                                    };
            inputs.GetInputSequenceRanges(this.DoBEDSubtract, false, true, true);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a Venn diagram out of two/three SequenceRangeGrouping objects.
 /// This method gets the user input for creating the diagram
 /// </summary>
 private void OnVennDiagramClick(object sender, RibbonControlEventArgs e)
 {
     var inputs = new InputSelection();
     inputs.MinimumSequenceCount = 2;
     inputs.MaximumSequenceCount = 3;
     inputs.PromptForSequenceName = false;
     inputs.SequenceLabels = new[]
                             {
                                 Resources.InputSelection_SequenceLabel_Venn1,
                                 Resources.InputSelection_SequenceLabel_Venn2,
                                 Resources.InputSelection_SequenceLabel_Venn3
                             };
     inputs.GetInputSequenceRanges(this.DoDrawVenn, false, false, false);
 }