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

[Seqan-dev] Getting a sequence as a char *

thread -->
date -->
  • From: Nick Mapsy <nmapsy@gmail.com>
  • To: seqan-dev@lists.fu-berlin.de
  • Date: Wed, 6 Sep 2017 03:38:54 -0700
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: [Seqan-dev] Getting a sequence as a char *

Hi, I'm just getting started with SeqAn (and C++), so I'm sure I'm missing something simple here.

I've got a multiple sequence alignment working and producing an Align<String<Dna5> > object. Now all I need is to return the aligned sequences (with gaps) as C strings (char *) from the function.

It seems like a simple thing, but after hours reading through the documentation of all the types and functions (and yes, Language Entity Types), I can't find the path from Align to char *.

I found toCString(), but it takes a String, and I don't know how to get (gapped) Strings out of an Align.

Thank you for any help, and hopefully I'm able to make use of this great library!
Nick

P.S. Here's what I've written so far:
(I'm using SeqAn 1.4.1 on Ubuntu 16.04.)

#include <seqan/align.h>
#include <seqan/sequence.h>
#include <seqan/graph_msa.h>

char **align(int nseq, char *seqs[]) {

    Align<String <Dna5> > align;
    resize(rows(align), nseq);
    for (int i = 0; i < nseq; i++) {
        assignSource(row(align, i), seqs[i]);
    }

    Score<int> score(0, -1, -1, -2);
    globalMsaAlignment(align, score);

    for (int i = 0; i < nseq; i++) {
        seq[i] = toCString(row(align, i));
    }

    return seqs;
}
thread -->
date -->
  • Follow-Ups:
    • Re: [Seqan-dev] Getting a sequence as a char *
      • From: Hannes Hauswedell <hannes.hauswedell@fu-berlin.de>
  • seqan-dev - September 2017 - 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