Beispiel #1
0
        /// <summary>
        /// Adds a new sequence item to the UI
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">Event arguments</param>
        private void OnAddSequenceClick(object sender, RoutedEventArgs e)
        {
            InputSequenceItem tmpSequenceItem = new InputSequenceItem();

            tmpSequenceItem.IsSequenceNameVisible = this.IsSequenceNameVisible;

            // Load sequence label if one exists for current index
            if (null != sequenceLabels)
            {
                if (sequenceLabels.Length > sequenceList.Children.Count)
                {
                    tmpSequenceItem.SequenceLabel = sequenceLabels[sequenceList.Children.Count];
                }
                else
                {
                    tmpSequenceItem.SequenceLabel = sequenceLabels[sequenceLabels.Length - 1];
                }
            }

            tmpSequenceItem.RemoveItemClick             += new RoutedEventHandler(OnRemoveItemClick);
            tmpSequenceItem.RequestSelectionHelper      += new RoutedEventHandler(OnRequestSelectionHelper);
            tmpSequenceItem.IsUseMetadataCheckBoxVisible = this.isUseMetadataCheckBoxVisible;
            tmpSequenceItem.UseMetadataSelected         += new RoutedEventHandler(OnUseMetadataSelected);
            sequenceList.Children.Add(tmpSequenceItem);
            UpdateAddSequenceButton();
        }
Beispiel #2
0
        /// <summary>
        /// Loads default values and minimum number of sequence items and so on
        /// </summary>
        public void Initialize()
        {
            // Set window title
            if (IsSequenceRangeSelection)
            {
                windowHeader.Text = Resources[RESOURCESELECTINPUTSEQUENCERANGES].ToString();
                sequenceConfigurationControls.Visibility = Visibility.Collapsed;
            }
            else
            {
                windowHeader.Text = Resources[RESOURCESELECTINPUTSEQUENCES].ToString();
                sequenceConfigurationControls.Visibility = Visibility.Visible;
            }

            // populate molecule type combo box
            this.moleculeTypeCombo.Items.Add(Properties.Resources.AutoDetectString);
            IEnumerable <IAlphabet> moleculeTypes = Alphabets.All.OrderBy(alpha => alpha.Name);

            foreach (IAlphabet alpha in moleculeTypes)
            {
                this.moleculeTypeCombo.Items.Add(alpha.Name);
            }

            this.moleculeTypeCombo.SelectedIndex = 0;

            // Populate minimum number of sequence selection controls to the list.
            InputSequenceItem tmpSequenceItem;

            sequenceList.Children.Clear();
            for (int i = 1; i <= minSequenceItems; i++)
            {
                tmpSequenceItem = new InputSequenceItem();
                tmpSequenceItem.IsUseMetadataCheckBoxVisible = this.isUseMetadataCheckBoxVisible;
                if (i == 1 && this.isUseMetadataCheckBoxVisible)
                {
                    tmpSequenceItem.IsUseMetadataSelected = true;
                }

                tmpSequenceItem.UseMetadataSelected += new RoutedEventHandler(OnUseMetadataSelected);
                if (sequenceLabels != null)
                {
                    if (sequenceLabels.Length >= i)
                    {
                        tmpSequenceItem.SequenceLabel = sequenceLabels[i - 1];
                    }
                }

                tmpSequenceItem.IsRemoveItemVisible             = false;
                tmpSequenceItem.IsSequenceNameVisible           = this.IsSequenceNameVisible;
                tmpSequenceItem.sequenceAddressBox.TextChanged += new TextChangedEventHandler(OnSequenceAddressChanged);
                tmpSequenceItem.RequestSelectionHelper         += new RoutedEventHandler(OnRequestSelectionHelper);
                sequenceList.Children.Add(tmpSequenceItem);
            }

            this.selectedSequenceItem = sequenceList.Children[0] as InputSequenceItem;
            UpdateAddSequenceButton();
            ValidateForBlankAddress();
        }
Beispiel #3
0
        /// <summary>
        /// Adds a new sequence item to the UI
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">Event arguments</param>
        private void OnAddSequenceClick(object sender, RoutedEventArgs e)
        {
            InputSequenceItem tmpSequenceItem = new InputSequenceItem();

            tmpSequenceItem.IsSequenceNameVisible   = this.IsSequenceNameVisible;
            tmpSequenceItem.IsMetadataVisible       = this.IsMetadataVisible;
            tmpSequenceItem.IsQualityScoresVisible  = this.IsQualityScoresVisible;
            tmpSequenceItem.RemoveItemClick        += new RoutedEventHandler(OnRemoveItemClick);
            tmpSequenceItem.RequestSelectionHelper += new RoutedEventHandler(OnRequestSelectionHelper);
            sequenceList.Children.Add(tmpSequenceItem);
            UpdateAddSequenceButton();
        }
Beispiel #4
0
        /// <summary>
        /// Removes the selected sequence item
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">Event arguments</param>
        private void OnRemoveItemClick(object sender, RoutedEventArgs e)
        {
            InputSequenceItem tmpSequenceItem = sender as InputSequenceItem;

            if (tmpSequenceItem != null)
            {
                tmpSequenceItem.UseMetadataSelected -= new RoutedEventHandler(OnUseMetadataSelected);
            }

            sequenceList.Children.Remove(sender as UIElement);
            UpdateAddSequenceButton();
        }
Beispiel #5
0
        /// <summary>
        /// Updates the InputSequenceItems so that at any given time 0 or 1 checkbox should be selected.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnUseMetadataSelected(object sender, RoutedEventArgs e)
        {
            InputSequenceItem tmpSequenceItem = sender as InputSequenceItem;

            if (tmpSequenceItem != null)
            {
                foreach (InputSequenceItem item in GetSequences())
                {
                    if (item != tmpSequenceItem && item.IsUseMetadataSelected)
                    {
                        item.IsUseMetadataSelected = false;
                    }
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// Loads default values and minimum number of sequence items and so on
        /// </summary>
        public void Initialize()
        {
            // Set window title
            if (IsSequenceRangeSelection)
            {
                windowHeader.Text = Resources[RESOURCESELECTINPUTSEQUENCERANGES].ToString();
                sequenceConfigurationControls.Visibility = Visibility.Collapsed;
            }
            else
            {
                windowHeader.Text = Resources[RESOURCESELECTINPUTSEQUENCES].ToString();
                sequenceConfigurationControls.Visibility = Visibility.Visible;
            }

            // populate molecule type combo box
            this.moleculeTypeCombo.Items.Add(Properties.Resources.AutoDetectString);
            IEnumerable <IAlphabet> moleculeTypes = Alphabets.All.OrderBy(alpha => alpha.Name);

            foreach (IAlphabet alpha in moleculeTypes)
            {
                this.moleculeTypeCombo.Items.Add(alpha.Name);
            }

            this.moleculeTypeCombo.SelectedIndex = 0;

            // Populate minimum number of sequence selection controls to the list.
            InputSequenceItem tmpSequenceItem;

            sequenceList.Children.Clear();

            tmpSequenceItem = new InputSequenceItem();
            tmpSequenceItem.IsRemoveItemVisible     = false;
            tmpSequenceItem.IsSequenceNameVisible   = this.IsSequenceNameVisible;
            tmpSequenceItem.IsMetadataVisible       = this.IsMetadataVisible;
            tmpSequenceItem.IsQualityScoresVisible  = this.IsQualityScoresVisible;
            tmpSequenceItem.RequestSelectionHelper += new RoutedEventHandler(OnRequestSelectionHelper);
            sequenceList.Children.Add(tmpSequenceItem);

            this.selectedSequenceItem = sequenceList.Children[0] as InputSequenceItem;
            UpdateAddSequenceButton();
        }