[Seqan-dev] Getting a sequence as a char *
- 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.Thank you for any help, and hopefully I'm able to make use of this great library!
Nick
(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;
}
- Follow-Ups:
- Re: [Seqan-dev] Getting a sequence as a char *
- From: Hannes Hauswedell <hannes.hauswedell@fu-berlin.de>
- Re: [Seqan-dev] Getting a sequence as a char *
-
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...