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

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

<-- thread -->
<-- date -->
  • From: Hannes Hauswedell <hannes.hauswedell@fu-berlin.de>
  • To: seqan-dev@lists.fu-berlin.de
  • Date: Fri, 08 Sep 2017 17:18:03 +0200
  • Organization: MPI MolGen / FU-Berlin
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] Getting a sequence as a char *

Hi Nick,

Am Mittwoch, 6. September 2017, 03:38:54 schrieb Nick Mapsy:
> 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.

Are you sure you want to be passing around these char** ? This is C++ after 
all and we have references :D

> 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!

You can create a CharString from the alignment row and then call toCString() 
on the CharString. But, like I said, I would really recommend working with 
Strings and StringSets instead of pointers and [].

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

Please update to SeqAn2 as SeqAn1 has been deprecated for a while now. The 
ubuntu package is called libseqan2-dev. It is available since Ubuntu 17.04, 
but can also be installed manually:
http://seqan.readthedocs.io/en/master/Infrastructure/Use/Install.html#library-package

Best regards,
Hannes
-- 
Hannes Hauswedell

Scientific staff & PhD candidate
Freie Universität Berlin / Max Planck Institute for Molecular Genetics

address     Institut für Informatik
            Takustraße 9
            Room 019
            14195 Berlin
telephone   +49 (0)30 838-75241
fax         +49 (0)30 838-75218
e-mail      hannes.hauswedell@[molgen.mpg.de|fu-berlin.de]



<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [Seqan-dev] Getting a sequence as a char *
      • From: Nick Mapsy <nmapsy@gmail.com>
  • References:
    • [Seqan-dev] Getting a sequence as a char *
      • From: Nick Mapsy <nmapsy@gmail.com>
  • 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