示例#1
0
        /// <summary>
        /// Get the alignment using pair wise
        /// </summary>
        /// <param name="seq1">Sequence 1</param>
        /// <param name="seq2">Sequence 2</param>
        /// <returns>A list of sequence alignments.</returns>
        private IList <IPairwiseSequenceAlignment> RunPairWise(ISequence seq1, ISequence seq2)
        {
            IList <IPairwiseSequenceAlignment> sequenceAlignment = null;

            if (PairWiseAlgorithm == null)
            {
                PairWiseAlgorithm = new NeedlemanWunschAligner();
            }

            PairWiseAlgorithm.SimilarityMatrix  = SimilarityMatrix;
            PairWiseAlgorithm.GapOpenCost       = GapOpenCost;
            PairWiseAlgorithm.ConsensusResolver = this.ConsensusResolver;

            if (UseGapExtensionCost)
            {
                PairWiseAlgorithm.GapExtensionCost = GapExtensionCost;
                sequenceAlignment = PairWiseAlgorithm.Align(seq1, seq2);
            }
            else
            {
                sequenceAlignment = PairWiseAlgorithm.AlignSimple(seq1, seq2);
            }

            // MUMmer does not support other aligners. Throw exception.
            //throw new NotSupportedException(Properties.Resource.MUMmerIncompatibleAligner);

            return(sequenceAlignment);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the MUMmer class.
        /// Constructor for all the pairwise aligner
        /// (NeedlemanWunsch, SmithWaterman, Overlap).
        /// Sets default similarity matrix and gap penalty.
        /// Users will typically reset these using parameters
        /// specific to their particular sequences
        /// and needs.
        /// </summary>
        protected MUMmer()
        {
            // Set default similarity matrix and gap penalty.
            // User will typically choose their own parameters, these
            // defaults are reasonable for many cases.

            // Default is set to 20
            LengthOfMUM = 20;

            SimilarityMatrix = null;

            GapOpenCost = -13; // 5, -4 diagonal matrix for Dna

            // default affine gap is -1
            GapExtensionCost = -8;

            // Set the default alignment algorithm to NeedlemanWunsch
            PairWiseAlgorithm = new NeedlemanWunschAligner();
        }