Re: [Seqan-dev] multiLocalAlignment function
Hi Andres,
So here is an example:
#include <iostream>
#include <seqan/align.h>
#include <seqan/graph_align.h>
#include <seqan/graph_msa.h>
using namespace seqan;
int main()
{
typedef String<Dna> TSequence;
TSequence seq1 = "atcgaatgcgga";
TSequence seq2 = "actcgttgca";
Score<int> score(2, -1, -1, -2);
typedef StringSet<TSequence, Dependent<> > TStringSet;
TStringSet string_set;
appendValue(string_set, seq1);
appendValue(string_set, seq2);
typedef String<Fragment<> > TFragmentString;
TFragmentString matches;
typedef String<int> TScoreValues;
TScoreValues scores;
multiLocalAlignment(string_set, matches, scores, score, 2, SmithWatermanClump());
_debugMatches(string_set, matches);
return 0;
}
It returns the two best local alignments as a string of fragments. The fragments are the gapless
aligned segments of an alignment:
0,5,ATGC,1,5,TTGC
0,1,TCG,1,2,TCG
The first number is the sequence id, then comes the begin position. So the alignment is:
TCGAAATGC
TCG--TTGC
The second local alignment is:
0,8,CG,1,3,CG
0,4,AAT,1,0,ACT
The score string has the same length as the string of segment matches. Each fragment gets
the score of the local alignment it comes from.
I am not sure if this was already working in the last release, so please use the SVN.
http://trac.mi.fu-berlin.de/seqan/wiki/Development
Best regards, Tobias
> -----Ursprüngliche Nachricht-----
> Von: seqan-dev-bounces@lists.fu-berlin.de
> [mailto:seqan-dev-bounces@lists.fu-berlin.de] Im Auftrag von
> andres.burgos@irisa.fr
> Gesendet: Sunday, August 23, 2009 7:55 PM
> An: Rausch, Tobias
> Cc: seqan-dev@lists.fu-berlin.de
> Betreff: Re: [Seqan-dev] multiLocalAlignment function
>
>
> Hi Tobias, thanks for your reply, I'll take a closer look at
> the code so maybe I'll figure it out, but the example will
> still be helpful.
>
> Danke schoen!
> Andres
>
> > Hello Andres,
> >
> > The multi-local alignment algorithm we have implemented is the one
> > from Waterman and Eggert.
> > It returns possibly overlapping local alignments, so it is not a
> > repeated match finder.
> >
> > It is implemented in
> > ./seqan/graph_align/graph_align_smith_waterman_clump.h and
> as you can
> > see at the bottom of the file it repeatedly calls the standard
> > smith-waterman alignment algorithm. Each found local
> alignment is then
> > forbidden in the next run.
> >
> > I send you an example on how to use it on Monday.
> >
> > Best regards,
> > Tobias
> >
> >
> > ________________________________________
> > From: seqan-dev-bounces@lists.fu-berlin.de
> > [seqan-dev-bounces@lists.fu-berlin.de] On Behalf Of
> > andres.burgos@irisa.fr [andres.burgos@irisa.fr]
> > Sent: Friday, August 21, 2009 6:01 PM
> > To: seqan-dev@lists.fu-berlin.de
> > Subject: [Seqan-dev] multiLocalAlignment function
> >
> > Hi!
> >
> > I'm currently trying to make work the function
> >
> > multiLocalAlignment(graph, edgeMap, score, numAlign, tag)
> >
> > but I can't success, so I was hoping to get some help,
> since it's not
> > documented on the web site. I was also wondering weather
> this function
> > would return overlapping or non-overlapping alignments.
> >
> > Ok, so here is the code I'm working on:
> >
> > typedef seqan::String<seqan::AminoAcid> TString;
> > typedef seqan::StringSet<TString, seqan::Dependent<> >
> TStringSet;
> > typedef seqan::Graph<seqan::Alignment<TStringSet,
> > seqan::AminoAcid> > TGraph;
> >
> > TStringSet str;
> > TString s1 ("some string");
> > TString s2 ("some other string");
> >
> > seqan::appendValue(str, s1);
> > seqan::appendValue(str, s2);
> >
> > seqan::Score<int, seqan::Pam<> > pam (250, -1, 0);
> > TGraph g(str);
> >
> >
> seqan::String<seqan::IntervalTreeNode<seqan::IntervalAndCargo<int,
> > int> > > propMap;
> > seqan::resizeEdgeMap(g, propMap);
> >
> > seqan::multiLocalAlignment(g, propMap, pam, 10,
> > seqan::SmithWaterman());
> >
> > This won't compile, throwing this error:
> >
> > ../seqan-1.1/seqan/graph_align/graph_align_interface.h: In function
> > 'void
> > seqan::multiLocalAlignment(seqan::Graph<seqan::Alignment<TStringSet,
> > TCargo, TSpec> >&, TPropertyMap&, const seqan::Score<TScoreValue,
> > TSpec2>&, TSize, TTag) [with TStringSet =
> > seqan::StringSet<seqan::String<seqan::SimpleType<unsigned char,
> > seqan::_AminoAcid>, seqan::Alloc<void> >, seqan::Dependent<const
> > seqan::Tag<seqan::TagGenerous_> > >, TCargo =
> > seqan::SimpleType<unsigned char, seqan::_AminoAcid>, TSpec = const
> > seqan::Tag<seqan::Default_>, TPropertyMap =
> > seqan::String<seqan::IntervalTreeNode<seqan::IntervalAndCargo<int,
> > char>, seqan::StorePointsOnly>, seqan::Alloc<void> >, TScoreValue =
> > int, TSpec2 = seqan::Pam<seqan::SimpleType<unsigned char,
> > seqan::_AminoAcid>, seqan::Pam_Data_Dayhoff_MDM78>, TSize =
> int, TTag
> > =
> > seqan::Tag<seqan::SmithWaterman_>]':
> > readers/SWReader.cc:26: instantiated from here
> > ../seqan-1.1/seqan/graph_align/graph_align_interface.h:234:
> error: no
> > matching function for call to
> > '_localAlignment(seqan::String<seqan::Fragment<unsigned int,
> > seqan::ExactFragment<const seqan::Tag<seqan::Default_> > >,
> > seqan::Alloc<void> >&,
> > seqan::StringSet<seqan::String<seqan::SimpleType<unsigned char,
> > seqan::_AminoAcid>, seqan::Alloc<void> >, seqan::Dependent<const
> > seqan::Tag<seqan::TagGenerous_> > >&,
> > seqan::String<seqan::IntervalTreeNode<seqan::IntervalAndCargo<int,
> > char>, seqan::StorePointsOnly>, seqan::Alloc<void> >&, const
> > seqan::Score<int, seqan::Pam<seqan::SimpleType<unsigned char,
> > seqan::_AminoAcid>, seqan::Pam_Data_Dayhoff_MDM78> >&, int&,
> > seqan::Tag<seqan::SmithWaterman_>)'
> > make: *** [readers/SWReader.o] Error 1
> >
> > So, maybe an example would make things clearer...
> >
> > Thanks in advance,
> > Andres
> >
> >
> > _______________________________________________
> > 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
>