Example #1
0
        public void ConvertIlluminaToSangerAndSolexa()
        {
            // Gets the actual sequence and the Qual score from the Xml
            string illuminaSequence = utilityObj.xmlUtil.GetTextValue(
                Constants.IlluminaToSangerAndSolexaNode, Constants.IlluminaSequence);
            string illuminaQualScore = utilityObj.xmlUtil.GetTextValue(
                Constants.IlluminaToSangerAndSolexaNode, Constants.IlluminaQualScore);
            string expectedSangerQualScore = utilityObj.xmlUtil.GetTextValue(
                Constants.IlluminaToSangerAndSolexaNode, Constants.SangerQualScore);
            string expectedSolexaQualScore = utilityObj.xmlUtil.GetTextValue(
                Constants.IlluminaToSangerAndSolexaNode, Constants.SolexaQualScore);

            byte[] illuminaSequenceinBytes  = UTF8Encoding.UTF8.GetBytes(illuminaSequence);
            byte[] illuminaQualScoreinBytes = UTF8Encoding.UTF8.GetBytes(illuminaQualScore);
            byte[] sangerQualScore          = QualitativeSequence.ConvertFromIlluminaToSanger(illuminaQualScoreinBytes);

            string qualSequenceSanger = new string(UTF8Encoding.UTF8.GetChars(sangerQualScore));

            // Validate converted sanger score.
            Assert.AreEqual(expectedSangerQualScore, qualSequenceSanger);

            ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                                                   "Qualitative Sequence BVT:Qualitative Sanger score type {0} is as expected.",
                                                   sangerQualScore));
            byte[] solexaQualScore = QualitativeSequence.ConvertFromIlluminaToSolexa(illuminaQualScoreinBytes);

            string qualSequenceSolexa = new string(UTF8Encoding.UTF8.GetChars(solexaQualScore));

            // Validate converted illumina score.
            Assert.AreEqual(expectedSolexaQualScore, qualSequenceSolexa);
            ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                                                   "Qualitative Sequence BVT:Qualitative Solexa format type {0} is as expected.",
                                                   illuminaQualScore));
        }
Example #2
0
 public void TestConvertFromIlluminaToSolexa()
 {
     byte[] bs;
     byte[] bs1 = new byte[2];
     bs1[0] = (byte)65;
     bs1[1] = (byte)65;
     bs     = QualitativeSequence.ConvertFromIlluminaToSolexa(bs1);
     Assert.IsNotNull((object)bs);
     Assert.AreEqual <int>(2, bs.Length);
     Assert.AreEqual <byte>((byte)59, bs[0]);
     Assert.AreEqual <byte>((byte)59, bs[1]);
 }
Example #3
0
 public void TestConvertFromIlluminaToSolexa()
 {
     byte[] solexaScores;
     byte[] illuminaScores = new byte[2];
     illuminaScores[0] = (byte)65;
     illuminaScores[1] = (byte)65;
     solexaScores      = QualitativeSequence.ConvertFromIlluminaToSolexa(illuminaScores);
     Assert.IsNotNull((object)solexaScores);
     Assert.AreEqual <int>(2, solexaScores.Length);
     Assert.AreEqual <byte>((byte)59, solexaScores[0]);
     Assert.AreEqual <byte>((byte)59, solexaScores[1]);
 }