Esempio n. 1
0
        /// <summary>
        /// Gets the list of alignment argument based on the algorithm selected
        /// </summary>
        /// <returns>Alignment arguments</returns>
        private IAlignmentAttributes GetAlignmentAttribute(string algo)
        {
            IAlignmentAttributes alignmentAttributes = null;

            ISequenceAligner sequenceAligner = ChooseAlgorithm(algo);

            if (sequenceAligner is NucmerPairwiseAligner)
            {
                alignmentAttributes = new NUCmerAttributes();
            }
            else if (sequenceAligner is MUMmerAligner)
            {
                alignmentAttributes = new MUMmerAttributes();
            }
            else if ((sequenceAligner is SmithWatermanAligner) ||
                     (sequenceAligner is NeedlemanWunschAligner) ||
                     (sequenceAligner is PairwiseOverlapAligner))
            {
                alignmentAttributes = new PairwiseAlignmentAttributes();
            }
            else if (sequenceAligner is PAMSAMMultipleSequenceAligner)
            {
                alignmentAttributes = new PamsamAlignmentAttributes();
            }

            return(alignmentAttributes);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the AssemblerDialog class.
        /// </summary>
        /// <param name="defaultSM">default similarity matrix name</param>
        public AlignerDialog(string defaultSM)
        {
            InitializeComponent();
            this.defaultSM = defaultSM;

            // Add aligners to the drop down
            foreach (ISequenceAligner aligner in SequenceAligners.All)
            {
                cmbAlgorithms.Items.Add(aligner.Name);
            }

            this.cmbAlgorithms.SelectedIndex = 0;

            if (this.cmbAlgorithms.Items.Count > 0)
            {
                IAlignmentAttributes alignmentAttributes = this.GetAlignmentAttribute(this.cmbAlgorithms.SelectedItem.ToString());
                this.LoadAlignmentArguments(alignmentAttributes);
            }

            this.cmbAlgorithms.SelectionChanged += new SelectionChangedEventHandler(cmbAlgorithms_SelectionChanged);

            this.Owner            = Application.Current.MainWindow;
            this.btnSubmit.Click += new RoutedEventHandler(this.OnSubmitButtonClicked);
            this.btnCancel.Click += new RoutedEventHandler(this.OnCancelClicked);
            this.btnSubmit.Focus();
        }
Esempio n. 3
0
        /// <summary>
        /// Load the list of arguments as appropriate control on the UI.
        /// </summary>
        /// <param name="alignmentAttributes">List of Alignment parameters</param>
        private void LoadAlignmentArguments(IAlignmentAttributes alignmentAttributes)
        {
            stkAlingerParam.Children.Clear();
            if (null != alignmentAttributes)
            {
                foreach (KeyValuePair <string, AlignmentInfo> attribute in alignmentAttributes.Attributes)
                {
                    if (attribute.Value.DataType.Equals(AlignmentInfo.StringListType))
                    {
                        this.CreateComboField(
                            attribute.Value,
                            stkAlingerParam,
                            attribute.Key);
                    }
                    else
                    {
                        this.CreateTextField(
                            attribute.Value,
                            stkAlingerParam,
                            attribute.Key);
                    }
                }
            }

            this.UpdateLayout();
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the AssemblerDialog class.
        /// </summary>
        /// <param name="algorithms">Algorithms</param>
        /// <param name="defaultSM">Default similarity matrix</param>
        /// <param name="sequences">Sequences to assemble</param>
        public AssemblerDialog(IEnumerable <string> algorithms, string defaultSM, IList <ISequence> sequences)
        {
            InitializeComponent();
            this.defaultSM = defaultSM;

            this.InitializeAlignmentAlgorithms(algorithms);
            if (this.cmbAlgorithms.Items.Count > 0)
            {
                IAlignmentAttributes alignmentAttributes = this.GetAlignmentAttribute(this.cmbAlgorithms.SelectedItem.ToString());
                this.LoadAlignmentArguments(alignmentAttributes);
            }

            this.cmbAlgorithms.SelectionChanged += new SelectionChangedEventHandler(cmbAlgorithms_SelectionChanged);

            this.Owner = Application.Current.MainWindow;

            this.simpleSequenceAssemblerOptionButton.Checked += new RoutedEventHandler(OnAssemblerSelectionChanged);
            this.padenaOptionButton.Checked += new RoutedEventHandler(OnAssemblerSelectionChanged);
            this.btnSubmit.Click            += new RoutedEventHandler(this.OnSubmitButtonClicked);
            this.btnCancel.Click            += new RoutedEventHandler(this.OnCancelClicked);

            // Get default values for padena
            int estimatedKmerLength = ParallelDeNovoAssembler.EstimateKmerLength(sequences);

            txtKmerLength.Text                     = estimatedKmerLength.ToString();
            txtDangleThreshold.Text                = (estimatedKmerLength + 1).ToString();
            txtRedundantThreshold.Text             = (3 * (estimatedKmerLength + 1)).ToString();
            this.cmbLibraryNames.SelectionChanged += new SelectionChangedEventHandler(OnLibraryNames_SelectionChanged);
            this.InitializeLibraryNames();
            this.btnSubmit.Focus();
        }
Esempio n. 5
0
        /// <summary>
        /// Load the list of arguments as appropriate control on the UI.
        /// </summary>
        /// <param name="alignmentAttributes">List of Alignment parameters</param>
        private void LoadAlignmentArguments(string algoName)
        {
            IAlignmentAttributes alignmentAttributes = this.GetAlignmentAttribute(algoName);

            stkAlingerParam.Children.Clear();

            if (null != alignmentAttributes)
            {
                foreach (KeyValuePair <string, AlignmentInfo> attribute in alignmentAttributes.Attributes)
                {
                    if (attribute.Value.DataType.Equals(AlignmentInfo.StringListType))
                    {
                        this.CreateComboField(
                            attribute.Value,
                            stkAlingerParam,
                            attribute.Key);
                    }
                    else
                    {
                        this.CreateTextField(
                            attribute.Value,
                            stkAlingerParam,
                            attribute.Key);
                    }
                }

                this.InvalidateVisual();
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Gets the list of alignment argument based on the algorithm selected
        /// </summary>
        /// <param name="algoName">Name of the algorithm used</param>
        /// <returns>Alignment arguments</returns>
        private IAlignmentAttributes GetAlignmentAttribute(string algoName)
        {
            IAlignmentAttributes alignmentAttributes = null;

            ISequenceAligner sequenceAligner = ChooseAlgorithm(algoName);

            this.Aligner = sequenceAligner;

            if (sequenceAligner is NUCmer3)
            {
                alignmentAttributes = new NUCmerAttributes();
            }
            else if (sequenceAligner is MUMmer3)
            {
                alignmentAttributes = new MUMmerAttributes();
            }
            else if ((sequenceAligner is SmithWatermanAligner) ||
                     (sequenceAligner is NeedlemanWunschAligner) ||
                     (sequenceAligner is PairwiseOverlapAligner))
            {
                alignmentAttributes = new PairwiseAlignmentAttributes();
            }

            return(alignmentAttributes);
        }
Esempio n. 7
0
        /// <summary>
        /// Selection change event of Aligner combo.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Selection Changed EventArgs.</param>
        private void cmbAlgorithms_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string algo = string.Empty;

            if (e.AddedItems.Count > 0)
            {
                algo = e.AddedItems[0].ToString();
            }

            IAlignmentAttributes alignmentAttributes = this.GetAlignmentAttribute(algo);

            this.LoadAlignmentArguments(alignmentAttributes);
        }