Esempio n. 1
0
            [Test] public void Align2()
            {
                string matrixPath = @"../../matrices/TEST1";

                if (!File.Exists(matrixPath))
                {
                    matrixPath = @"TEST1";
                }

                Matrix customMatrix = Matrix.Load(matrixPath);

                Sequence seq1 = Sequence.Parse(@"AACCC");
                Sequence seq2 = Sequence.Parse(@"CCACC");

                float opengap   = 2.0f;
                float extendgap = 1.0f;

                Alignment alignment = SmithWatermanGotoh.Align(seq1, seq2, customMatrix, opengap, extendgap);

                Assert.AreEqual(alignment.Sequence1.Length, 3, "#A00 Unexpected aligment");
                Assert.AreEqual(alignment.Sequence2.Length, 3, "#A01 Unexpected aligment");

                Assert.AreEqual(alignment.Sequence1[0], 'A', "#A02 Unexpected alignement");
                Assert.AreEqual(alignment.Sequence1[1], 'C', "#A03 Unexpected alignement");
                Assert.AreEqual(alignment.Sequence1[2], 'C', "#A04 Unexpected alignement");
                Assert.AreEqual(alignment.Sequence2[0], 'A', "#A05 Unexpected alignement");
                Assert.AreEqual(alignment.Sequence2[1], 'C', "#A06 Unexpected alignement");
                Assert.AreEqual(alignment.Sequence2[2], 'C', "#A07 Unexpected alignement");

                Assert.AreEqual(15.0f, alignment.Score, "#A08 Unexpected score.");
            }
Esempio n. 2
0
            [Test] public void Align()
            {
                string matrixPath = @"../../matrices/PAM250";

                if (!File.Exists(matrixPath))
                {
                    matrixPath = @"PAM250";
                }

                Matrix pam250 = Matrix.Load(matrixPath);

                float opengap   = 15.0f;
                float extendgap = 3.0f;

                string str1 = @">100K_RAT  100 kDa protein (EC 6.3.2.-)." + NL +
                              "MMSARGDFLN YALSLMRSHN DEHSDVLPVL DVCSLKHVAY VFQALIYWIK AMNQQTTLDT" +
                              "PQLERKRTRE LLELGIDNED SEHENDDDTS QSATLNDKDD ESLPAETGQN HPFFRRSDSM" +
                              "TFLGCIPPNP FEVPLAEAIP LADQPHLLQP NARKEDLFGR PSQGLYSSSA GSGKCLVEVT" +
                              "MDRNCLEVLP TKMSYAANLK NVMNMQNRQK KAGEDQSMLA EEADSSKPGP SAHDVAAQLK" +
                              "SSLLAEIGLT ESEGPPLTSF RPQCSFMGMV ISHDMLLGRW RLSLELFGRV FMEDVGAEPG" +
                              "SILTELGGFE VKESKFRREM EKLRNQQSRD LSLEVDRDRD LLIQQTMRQL NNHFGRRCAT" +
                              "TPMAVHRVKV TFKDEPGEGS GVARSFYTAI AQAFLSNEKL PNLDCIQNAN KGTHTSLMQR" +
                              "LRNRGERDRE REREREMRRS SGLRAGSRRD RDRDFRRQLS IDTRPFRPAS EGNPSDDPDP" +
                              "LPAHRQALGE RLYPRVQAMQ PAFASKITGM LLELSPAQLL LLLASEDSLR ARVEEAMELI" +
                              "VAHGRENGAD SILDLGLLDS SEKVQENRKR HGSSRSVVDM DLDDTDDGDD NAPLFYQPGK" +
                              "RGFYTPRPGK NTEARLNCFR NIGRILGLCL LQNELCPITL NRHVIKVLLG RKVNWHDFAF" +
                              "FDPVMYESLR QLILASQSSD ADAVFSAMDL AFAVDLCKEE GGGQVELIPN GVNIPVTPQN" +
                              "VYEYVRKYAE HRMLVVAEQP LHAMRKGLLD VLPKNSLEDL TAEDFRLLVN GCGEVNVQML" +
                              "ISFTSFNDES GENAEKLLQF KRWFWSIVER MSMTERQDLV YFWTSSPSLP ASEEGFQPMP" +
                              "SITIRPPDDQ HLPTANTCIS RLYVPLYSSK QILKQKLLLA IKTKNFGFV";

                string str2 = @">104K_THEPA  104 kDa microneme-rhoptry antigen." + NL +
                              "MKFLILLFNI LCLFPVLAAD NHGVGPQGAS GVDPITFDIN SNQTGPAFLT AVEMAGVKYL" +
                              "QVQHGSNVNI HRLVEGNVVI WENASTPLYT GAIVTNNDGP YMAYVEVLGD PNLQFFIKSG" +
                              "DAWVTLSEHE YLAKLQEIRQ AVHIESVFSL NMAFQLENNK YEVETHAKNG ANMVTFIPRN" +
                              "GHICKMVYHK NVRIYKATGN DTVTSVVGFF RGLRLLLINV FSIDDNGMMS NRYFQHVDDK" +
                              "YVPISQKNYE TGIVKLKDYK HAYHPVDLDI KDIDYTMFHL ADATYHEPCF KIIPNTGFCI" +
                              "TKLFDGDQVL YESFNPLIHC INEVHIYDRN NGSIICLHLN YSPPSYKAYL VLKDTGWEAT" +
                              "THPLLEEKIE ELQDQRACEL DVNFISDKDL YVAALTNADL NYTMVTPRPH RDVIRVSDGS" +
                              "EVLWYYEGLD NFLVCAWIYV SDGVASLVHL RIKDRIPANN DIYVLKGDLY WTRITKIQFT" +
                              "QEIKRLVKKS KKKLAPITEE DSDKHDEPPE GPGASGLPPK APGDKEGSEG HKGPSKGSDS" +
                              "SKEGKKPGSG KKPGPAREHK PSKIPTLSKK PSGPKDPKHP RDPKEPRKSK SPRTASPTRR" +
                              "PSPKLPQLSK LPKSTSPRSP PPPTRPSSPE RPEGTKIIKT SKPPSPKPPF DPSFKEKFYD" +
                              "DYSKAASRSK ETKTTVVLDE SFESILKETL PETPGTPFTT PRPVPPKRPR TPESPFEPPK" +
                              "DPDSPSTSPS EFFTPPESKR TRFHETPADT PLPDVTAELF KEPDVTAETK SPDEAMKRPR" +
                              "SPSEYEDTSP GDYPSLPMKR HRLERLRLTT TEMETDPGRM AKDASGKPVK LKRSKSFDDL" +
                              "TTVELAPEPK ASRIVVDDEG TEADDEETHP PEERQKTEVR RRRPPKKPSK SPRPSKPKKP" +
                              "KKPDSAYIPS ILAILVVSLI VGIL";


                Sequence seq1 = Sequence.Parse(str1);
                Sequence seq2 = Sequence.Parse(str2);

                Alignment alignment = SmithWatermanGotoh.Align(seq1, seq2, pam250, opengap, extendgap);

                Assert.AreEqual(98.0f, alignment.Score, "Unexpected score.");
            }
Esempio n. 3
0
            [Test] public void Align2()
            {
                string matrixPath = @"../../matrices/TEST1";

                if (!File.Exists(matrixPath))
                {
                    matrixPath = @"TEST1";
                }

                Matrix customMatrix = Matrix.Load(matrixPath);

                Sequence seq1 = Sequence.Parse(@"AACCC");
                Sequence seq2 = Sequence.Parse(@"CCACC");

                float opengap   = 2.0f;
                float extendgap = 1.0f;

                Alignment alignment = SmithWatermanGotoh.Align(seq1, seq2, customMatrix, opengap, extendgap);

                Assert.AreEqual(14.0f, alignment.Score, "Unexpected score.");
            }