Created
July 30, 2012 12:39
-
-
Save soh-i/3206597 to your computer and use it in GitHub Desktop.
アライメント
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <seqan/sequence.h> | |
#include <seqan/align.h> | |
using namespace seqan; | |
int main () | |
{ | |
typedef String <char> TSequence; | |
typedef Align<TSequence,ArrayGaps> TAlign; | |
typedef Row<TAlign>::Type TRow; | |
TSequence seq1 = "LVLGEGPHLANGSARGLSQRKRPLEEGNKGHGHSKFRPKKRRKPQGPILP"; | |
TSequence seq2 = "AVLGEGPHLANGSARGLSCRKRPLEEGNKGHGHSKFRPKKRRKPQGPILP"; | |
TAlign align; | |
resize(rows(align), 2); | |
assignSource(row(align,0), seq1); | |
assignSource(row(align,1), seq2); | |
::std::cout << align; | |
TRow &row1 = row(align, 0); | |
TRow &row2 = row(align, 1); | |
insertGap(row1, 2); | |
insertGap(row2, 5); | |
::std::cout << align; | |
::std::cout << ::std::endl << "ViewToSource1"; | |
for ( unsigned i = 0; i <length(row1); i++ ) { | |
::std::cout << toSourcePosition(row1, i)<<","; | |
::std::cout << ::std::endl << "ViewToSource2"; | |
for ( unsigned i = 0; i < length(row2); i++){ | |
::std::cout << toViewPosition(row2, i); | |
::std::cout << ::std::endl; | |
return 0; | |
} | |
} | |
} | |
/* | |
0 . : . : . : . : . : | |
LVLGEGPHLANGSARGLSQRKRPLEEGNKGHGHSKFRPKKRRKPQGPILP | |
||||||||||||||||| ||||||||||||||||||||||||||||||| | |
AVLGEGPHLANGSARGLSCRKRPLEEGNKGHGHSKFRPKKRRKPQGPILP | |
0 . : . : . : . : . : | |
LV-LGEGPHLANGSARGLSQRKRPLEEGNKGHGHSKFRPKKRRKPQGPIL | |
| ||||||||||||| |||||||||||||||||||||||||||||| | |
AVLGE-GPHLANGSARGLSCRKRPLEEGNKGHGHSKFRPKKRRKPQGPIL | |
50 | |
P | |
| | |
P | |
ViewToSource10, | |
ViewToSource20 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment