FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

Re: [Seqan-dev] multiLocalAlignment function

<-- thread -->
<-- date -->
  • From: andres.burgos@irisa.fr
  • To: seqan-dev@lists.fu-berlin.de
  • Date: Wed, 26 Aug 2009 15:38:34 +0200
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] multiLocalAlignment function

Ok I will do it the way you suggest, thanks for your time!

Best regards,
Andres.

> Send seqan-dev mailing list submissions to
> 	seqan-dev@lists.fu-berlin.de
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.fu-berlin.de/listinfo/seqan-dev
> or, via email, send a message with subject or body 'help' to
> 	seqan-dev-request@lists.fu-berlin.de
>
> You can reach the person managing the list at
> 	seqan-dev-owner@lists.fu-berlin.de
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of seqan-dev digest..."
>
>
> Today's Topics:
>
>    1. Re: multiLocalAlignment function (andres.burgos@irisa.fr)
>    2. Re: multiLocalAlignment function (Rausch, Tobias)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 25 Aug 2009 14:34:01 +0200
> From: andres.burgos@irisa.fr
> Subject: Re: [Seqan-dev] multiLocalAlignment function
> To: "Rausch, Tobias" <Tobias.Rausch@fu-berlin.de>
> Cc: "'seqan-dev@lists.fu-berlin.de'" <seqan-dev@lists.fu-berlin.de>
> Message-ID: <d8389f2e7afb34e71e356e1aabb0bc94.squirrel@mail.irisa.fr>
> Content-Type: text/plain;charset=iso-8859-1
>
>
> Hi Tobias, thanks for the example, it is now working fine!
> But I still have a doubt, in your example's output you say that the first
> alignment consists of these two fragments:
>
> 0,5,ATGC,1,5,TTGC
> 0,1,TCG,1,2,TCG
>
> and the other alignment consist of two other fragments. So my question is,
> how can you tell that? The variable containing the fragment's info is
> matches, and its length is 4 in that case.
>
> Regards,
> Andres.
>
>> 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
>>>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 25 Aug 2009 14:46:56 +0200
> From: "Rausch, Tobias" <Tobias.Rausch@fu-berlin.de>
> Subject: Re: [Seqan-dev] multiLocalAlignment function
> To: 'SeqAn Development' <seqan-dev@lists.fu-berlin.de>
> Message-ID:
> 	<6AB91D0276C1E744892C72E49C9DFFF7376A489ACE@exchange6.fu-berlin.de>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Andres,
>
> You can tell that only from the scores.
> If I remember it correctly each fragment gets the local alignment score it
> stems from.
>
> This is indeed not perfect but I haven't implemented an iterator yet
> giving you each local alignment one after another.
> If you look at the code, however, the SmithWatermanClump (Waterman-Eggert)
> algorithm simply iteratively calls
> the standard SmithWaterman
> algorithm with an array of forbidden paths. You can simply reuse that loop
> and do your stuff with each
> local alignment within that loop.
>
> 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: Tuesday, August 25, 2009 2:34 PM
>> An: Rausch, Tobias
>> Cc: 'seqan-dev@lists.fu-berlin.de'
>> Betreff: Re: [Seqan-dev] multiLocalAlignment function
>>
>>
>> Hi Tobias, thanks for the example, it is now working fine!
>> But I still have a doubt, in your example's output you say
>> that the first alignment consists of these two fragments:
>>
>> 0,5,ATGC,1,5,TTGC
>> 0,1,TCG,1,2,TCG
>>
>> and the other alignment consist of two other fragments. So my
>> question is, how can you tell that? The variable containing
>> the fragment's info is matches, and its length is 4 in that case.
>>
>> Regards,
>> Andres.
>>
>> > 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
>> >>
>>
>>
>>
>> _______________________________________________
>> 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
>
>
> End of seqan-dev Digest, Vol 1, Issue 9
> ***************************************
>





<-- thread -->
<-- date -->
  • seqan-dev - August 2009 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal