public void ValidatePairwiseAlignmentAttributes()
        {
            var pwAlignAttrib = new PairwiseAlignmentAttributes();
            Dictionary<string, AlignmentInfo> attributes = pwAlignAttrib.Attributes;

            AlignmentInfo similarityMatrixObj = attributes["SIMILARITYMATRIX"];
            AlignmentInfo gapOpenCostObj = attributes["GAPOPENCOST"];
            AlignmentInfo gapExtensionCostObj = attributes["GAPEXTENSIONCOST"];

            Assert.AreEqual("Similarity Matrix", similarityMatrixObj.Name);

            var validator = new StringListValidator(
                "Diagonal (Match x Mismatch)",
                SimilarityMatrix.StandardSimilarityMatrix.AmbiguousDna.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.AmbiguousRna.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Blosum45.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Blosum50.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Blosum62.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Blosum80.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Blosum90.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.DiagonalScoreMatrix.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Pam250.ToString(),
                SimilarityMatrix.StandardSimilarityMatrix.Pam30.ToString());

            Assert.IsTrue(validator.IsValid(SimilarityMatrix.StandardSimilarityMatrix.AmbiguousDna.ToString()));
            validator.AddValidValues(SimilarityMatrix.StandardSimilarityMatrix.Pam70.ToString());
            Assert.AreEqual("Diagonal (Match x Mismatch)", validator.ValidValues[0]);
            Assert.AreEqual("Gap Cost", gapOpenCostObj.Name);
            Assert.AreEqual("Gap Extension Cost", gapExtensionCostObj.Name);

            ApplicationLog.WriteLine(
                "PairwiseAlignmentAttributes BVT: Successfully validated all the attributes.");
        }
Ejemplo n.º 2
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 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();
            }

            return alignmentAttributes;
        }