Example #1
0
 public void GetStringSequenceTest()
 {
     ISequence seqObj = new QualitativeSequence(Alphabets.DNA, FastQFormatType.Sanger,
                                     "GGCGCACTTACACCCTACATCCATTG", "IIIIG1?II;IIIII1IIII1%.I7I");
     string expected = "GGCGCACTTACACCCTACATCCATTG";
     string actual;
     actual = BioHelper.GetStringSequence(seqObj);
     Assert.AreEqual(expected, actual);
 }
Example #2
0
        public void FastaTrimRegex2()
        {
            Sequence    seqObj   = new Sequence(Alphabets.DNA, "TTTAAAGATTACATTTAAA");
            Sequence    expected = new Sequence(Alphabets.DNA, "TTTAAAGATTACA");
            TrimByRegex target   = new TrimByRegex(new FastAParser(), new FastAFormatter(), new FastAFormatter(), @"TTTAAA$");
            ISequence   actual   = target.Trim(seqObj);

            Assert.AreEqual(BioHelper.GetStringSequence(expected), BioHelper.GetStringSequence(actual));
        }
Example #3
0
        public void FastqTrimRegex1()
        {
            QualitativeSequence seqObj   = new QualitativeSequence(Alphabets.DNA, FastQFormatType.Sanger, "GGGCCCGATTACATTTAAA", "ABCABCIIIIIIIABCABC");
            QualitativeSequence expected = new QualitativeSequence(Alphabets.DNA, FastQFormatType.Sanger, "GGGCCCTTTAAA", "ABCABCABCABC");
            TrimByRegex         target   = new TrimByRegex(new FastQParser(), new FastQFormatter(), new FastQFormatter(), "GATTACA");
            ISequence           actual   = target.Trim(seqObj);

            Assert.AreEqual(BioHelper.GetStringSequence(expected), BioHelper.GetStringSequence(actual));
            Assert.AreEqual(BioHelper.GetEncodedQualityScoreStringSequence(expected), BioHelper.GetEncodedQualityScoreStringSequence(actual as QualitativeSequence));
        }
Example #4
0
        public void FastqTrimFromLeftTest2()
        {
            ISequence seqObj = new QualitativeSequence(Alphabets.DNA, FastQFormatType.Sanger,
                                                       "GGCGCACTTACACCCTACATCCATTG", "IIIIG1?II;IIIII1IIII1%.I7I");
            ISequence expected = new QualitativeSequence(Alphabets.DNA, FastQFormatType.Sanger,
                                                         "G", "I");
            double       trimLength    = 1;
            bool         trimFromStart = true;
            TrimByLength target        = new TrimByLength(new FastQParser(), new FastQFormatter(), null, trimLength, trimFromStart);
            ISequence    actual;

            actual = target.Trim(seqObj);
            Assert.AreEqual(BioHelper.GetStringSequence(expected), BioHelper.GetStringSequence(actual));
            Assert.AreEqual((expected as QualitativeSequence).QualityScores.ToString(), (actual as QualitativeSequence).QualityScores.ToString());
        }