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

Re: [Seqan-dev] getting vertex descriptors from graphs

<-- thread -->
<-- date -->
  • From: "Weese, David" <weese@campus.fu-berlin.de>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Thu, 13 Jan 2011 15:50:59 +0100
  • Acceptlanguage: de-DE
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] getting vertex descriptors from graphs

Hi Mat,

Property maps are one-way maps from SeqAn's point of view. If you need an efficient reverse map, you have to use a STL map that maps strings to IDs (=VertexDescriptor).

Cheers,
David

--
David Weese weese@inf.fu-berlin.de
Freie Universität Berlin http://www.inf.fu-berlin.de/
Institut für Informatik Phone: +49 30 838 75246
Takustraße 9 Algorithmic Bioinformatics
14195 Berlin Room 021 

Am 12.01.2011 um 14:26 schrieb Mat:

Hi seqan-users!

Anybody could give me a hint on the following problem?

I created a directed graph and added some nodes. Each node has an additional datastructure (VertexProperty - node name and size...) which is linked to each node by a vertexMap.
Now: Later on i would like to add some edges to my graph, so i need two VertexDescriptor's to add an edge.

Is there a standard way to search a vertexMap's via VertexProperties and get the corresponding VertexDescriptor?

One way would be to iterate on the vertexMap and look for a VertexProperty but this might be to slow...

Thanks!

>>>
//EdgeProperty and VertexProperty store additional information...

typedef Graph<Directed<EdgeProperty> > GraphType;
GraphType *contigGraph = new GraphType();

typedef VertexDescriptor<GraphType>::Type TVertexDescriptor;
typedef EdgeDescriptor<GraphType>::Type TEdgeDescriptor;

typedef seqan::String<VertexProperty > TVertexProperty;
TVertexProperty *vertexPropertyMap = new TVertexProperty();

TVertexDescriptor vertDesc1;

...

for(unsigned int n=0;n<numberOfContigs;++n){
     //get a vertex descriptor
     vertDesc1 = addVertex(*m_g);

     //create a vertex property
     VertexProperty vp1;
     vp1.contigId = n;
     vp1.length = length(fragStore.contigStore[n].seq);

     //store descriptor:vertexproperty
     seqan::resizeVertexMap(*m_g, *vertexMap);
     seqan::assignProperty(*vertexMap,vertDesc1,vp1);
}
<<<


<ATT00001..txt>

<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [Seqan-dev] getting vertex descriptors from graphs
      • From: Mat <matthias.dodt@mdc-berlin.de>
  • References:
    • [Seqan-dev] getting vertex descriptors from graphs
      • From: Mat <matthias.dodt@mdc-berlin.de>
  • seqan-dev - January 2011 - 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