Hi Tianyang, Yes, each row of an Align is a Gaps<> object, in your case specialized as ArrayGaps. Using clippedBeginPosition() and clippedEndPosition() you get the start and end position of the local alignment in the original sequences. By iterating over the rows and using the function isGap() you can then get information about insertions and deletions or mismatches (see Task 1 in Tutorial). Have a look at how the SeqAn applications RazerS and Stellar turn Aligns into CIGAR strings: http://trac.seqan.de/browser/trunk/seqan/core/apps/razers2/outputFormat.h -> line 415 http://trac.seqan.de/browser/trunk/seqan/core/apps/stellar/stellar_output.h -> line 114 Birte -----Original Message----- From: Tianyang Li 李天阳 Tommy Li [mailto:tmy1018@gmail.com] Sent: Mittwoch, 1. August 2012 16:12 To: SeqAn Development Subject: Re: [Seqan-dev] How to extract alignment information from an Align object when doing a Smith-Waterman alignment? Hi Birte, I actually want to turn the alignment result into something similar to a CIGAR string in SAM. I've read the tutorial and I hope that I can get something more than `clippedBeginPosition` and `clippedEndPosition`. Should I treat each row as an ArrayGaps? Best, Tianyang On Wed, Aug 1, 2012 at 10:02 PM, Kehr, Birte <Birte.Kehr@fu-berlin.de> wrote: > Hi Tianyang, > > what kind of alignment information are you looking for? You can iterate the Align object (or the rows of the Align object) to extract information about the position of gaps. > > You might have found it yourself already but if not, the Alignments tutorial gives a good introduction to the Align data structure: > http://trac.seqan.de/wiki/Tutorial/Alignments > > > Birte > > > > -----Original Message----- > From: Tianyang Li 李天阳 Tommy Li [mailto:tmy1018@gmail.com] > Sent: Mittwoch, 1. August 2012 15:48 > To: SeqAn Development > Subject: [Seqan-dev] How to extract alignment information from an Align object when doing a Smith-Waterman alignment? > > Hi, > > I have a question about how to extract alignment information from an Align object when doing Smith-Waterman alignment. > > For example, > > #include <iostream> > #include <seqan/align.h> > #include <string> > > using namespace seqan; > > int main() > { > Align< String<Dna> > ali; > ::std::string s1 = "CGCGGGGCATATATTTTTTTA"; > ::std::string s2 = "ATTTATTTTTTATATGCGGCCG"; > appendValue(rows(ali), s1); > appendValue(rows(ali), s2); > ::std::cout << "Score = " << localAlignment(ali, Score<int>(3,-3,-2, -2), SmithWaterman()) << ::std::endl; > ::std::cout << ali; > ::std::cout << "Aligns Seq1[" << clippedBeginPosition(row(ali, > 0)) << ":" << (clippedEndPosition(row(ali, 0))-1) << "]"; > ::std::cout << " and Seq2[" << clippedBeginPosition(row(ali, 1)) << ":" << (clippedEndPosition(row(ali, 1))-1) << "]" << ::std::endl << ::std::endl; > return 0; > } > > I'd like to get the the information when I do `::std::cout << ali;` as some kind of object that I can use without parsing the output. > > Thanks! > > Best, > Tianyang > > _______________________________________________ > seqan-dev mailing list > seqan-dev@lists.fu-berlin.de > https://lists.fu-berlin.de/listinfo/seqan-dev > _______________________________________________ > seqan-dev mailing list > seqan-dev@lists.fu-berlin.de > https://lists.fu-berlin.de/listinfo/seqan-dev _______________________________________________ seqan-dev mailing list seqan-dev@lists.fu-berlin.de https://lists.fu-berlin.de/listinfo/seqan-dev