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

Re: [Seqan-dev] 1/2/4/8 A/C/G/T representation

<-- thread
<-- date
  • From: Rahn, René <rene.maerker@fu-berlin.de>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Tue, 02 Aug 2016 09:58:20 +0200
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] 1/2/4/8 A/C/G/T representation

Hi Bayo, 

thank you for writing us. 
It depends on what you want to do. If you know your sequence only consists of Dna characters than you can simply cast it to Dna and use the ordValue function to map the characters to an interval [0, AlphabetSize[. This has no runtime overhead. But any symbol that is not in the Dna alphabet will be automatically converted to an 'A'.
If you want to preserve the Iupac meaning, you can use the function assign(Dna & target, Iupac const source).
This will convert the Iupac symbol to A,C,G or T depending on the bit mask of the current source character, where the bit for 'A' is preferred over the bit for 'C', which is preferred over 'G' and so on.

In the future it would be better to open a ticket for this on https://github.com/seqan/seqan/issues/.

IHTH!

cheers,

René


On 02 Aug 2016, at 03:02, Bayo Lau <bayo.lau@gmail.com> wrote:

Hello,

I've trying out the new seqan (f1ec3e8f9e91b8c6bb7c02cdaef1fe7577f94a19).

One thing I noticed when using BAM I/O (with seqan::BamFileIn and seqan::BamAlignmentRecord )is that the seqan::BamAlignmentRecord::seq type seems to be seqan::String<seqan::SimpleType<unsigned char, seqan::Iupac_>, seqan::Alloc<> >, and when I static_cast the base calls, the values are 1/2/4/8 for ACGT. I wonder if there's a formal way to map them back to 0/1/2/3 (I just hacked up my own mapping function now)? or am i doing anything wrong.

Thanks for the help.

Bayo
_______________________________________________
seqan-dev mailing list
seqan-dev@lists.fu-berlin.de
https://lists.fu-berlin.de/listinfo/seqan-dev

---

René Rahn
Ph.D. Student (de.NBI - CIBI)
--------------------------------
Tel:  (+49) 30 838 75137
Mail: rene.rahn@fu-berlin.de
--------------------------------
Institute of Computer Science
Algorithmic Bioinformatics (ABI)
--------------------------------
Freie Universität Berlin
Takustraße 9
14195 Berlin
--------------------------------

<-- thread
<-- date
  • References:
    • [Seqan-dev] 1/2/4/8 A/C/G/T representation
      • From: Bayo Lau <bayo.lau@gmail.com>
  • seqan-dev - August 2016 - 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