示例#1
0
        public void MatePairMapper1()
        {
            IList <ISequence> sequences   = new List <ISequence>();
            IList <MatePair>  pairedreads = new List <MatePair>();
            Sequence          seq         = new Sequence(Alphabets.DNA, "GGGAAAAATCAGATT");

            seq.ID = ">gi|263191773|ref|NG_015830.1| H**o sapiens insulin receptor"
                     + "substrate 1 (IRS1) on chromosome 2.X1:2K";
            sequences.Add(seq);
            seq    = new Sequence(Alphabets.DNA, "ACGTGTGTGTCCCCC");
            seq.ID = ">gi|263191773|ref|NG_015830.1| H**o sapiens insulin receptor"
                     + "on chromosome 2.X1:10K";
            sequences.Add(seq);
            seq    = new Sequence(Alphabets.DNA, "ACGTGTGKAAAAAAA");
            seq.ID = ">gi|263191773|ref | H**o sapiens ........insulin receptor"
                     + "on chromosome 2.X1:50K";
            sequences.Add(seq);
            seq    = new Sequence(Alphabets.DNA, "GGGAAAAATCAGATT");
            seq.ID = ">gi|263191773|ref|NG_015830.1| H**o sapiens insulin receptor"
                     + "substrate 1 (IRS1) on chromosome 2.Y1:2K";
            sequences.Add(seq);
            seq    = new Sequence(Alphabets.DNA, "ACGTGTGTGTCCCCC");
            seq.ID = ">gi|263191773|ref|NG_015830.1| H**o sapiens insulin receptor"
                     + "on chromosome 2.Y1:10K";
            sequences.Add(seq);
            seq    = new Sequence(Alphabets.DNA, "ACGTGTGKAAAAAAA");
            seq.ID = ">gi|263191773|ref | H**o sapiens ........insulin receptor"
                     + "on chromosome 2.Y1:50K";
            sequences.Add(seq);

            MatePairMapper pair = new MatePairMapper();

            pairedreads = Sort(pair.Map(sequences), sequences);
            Assert.AreEqual(pairedreads.Count, 3);

            ISequence expectedForward = new Sequence(Alphabets.DNA, "ACGTGTGKAAAAAAA");
            ISequence expectedReverse = new Sequence(Alphabets.DNA, "ACGTGTGKAAAAAAA");
            string    lib             = "50K";

            Assert.AreEqual(pairedreads[0].GetForwardRead(sequences).ToString(), expectedForward.ToString());
            Assert.AreEqual(pairedreads[0].GetReverseRead(sequences).ToString(), expectedReverse.ToString());
            Assert.AreEqual(pairedreads[0].Library, lib);
            Assert.AreEqual(pairedreads[0].MeanLengthOfLibrary, 65000);
            Assert.AreEqual(pairedreads[0].StandardDeviationOfLibrary, 13334);

            expectedForward = new Sequence(Alphabets.DNA, "ACGTGTGTGTCCCCC");
            expectedReverse = new Sequence(Alphabets.DNA, "ACGTGTGTGTCCCCC");
            lib             = "10K";
            Assert.AreEqual(pairedreads[1].GetForwardRead(sequences).ToString(), expectedForward.ToString());
            Assert.AreEqual(pairedreads[1].GetReverseRead(sequences).ToString(), expectedReverse.ToString());
            Assert.AreEqual(pairedreads[1].Library, lib);
            Assert.AreEqual(pairedreads[1].MeanLengthOfLibrary, 10000);
            Assert.AreEqual(pairedreads[1].StandardDeviationOfLibrary, 1000);

            expectedForward = new Sequence(Alphabets.DNA, "GGGAAAAATCAGATT");
            expectedReverse = new Sequence(Alphabets.DNA, "GGGAAAAATCAGATT");
            lib             = "2K";
            Assert.AreEqual(pairedreads[2].GetForwardRead(sequences).ToString(), expectedForward.ToString());
            Assert.AreEqual(pairedreads[2].GetReverseRead(sequences).ToString(), expectedReverse.ToString());
            Assert.AreEqual(pairedreads[2].Library, lib);
            Assert.AreEqual(pairedreads[2].MeanLengthOfLibrary, 2000);
            Assert.AreEqual(pairedreads[2].StandardDeviationOfLibrary, 100);
        }