Skip to content

Commit

Permalink
Isolate RNA conversion problem \
Browse files Browse the repository at this point in the history
when nuc_ variable is assigned \
Cannot determine where the RNA mapping occurs though
  • Loading branch information
zmertens committed Dec 15, 2017
1 parent 73e27a2 commit f45912e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/error.dawg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tree.Tree = "(A:0.3, B:0.2)C;"
Tree.Scale = 0.99999
Root.Length = 100
Root.Code = TCAAAAGGGGTTTTCCCCAAATTAAGGCCCC
Root.Seq = "lawl"
Root.Seq = "bad root sequence"
Sim.Reps = 10
Sim.Seed = 42
Root.Seg = 0
Expand Down
2 changes: 1 addition & 1 deletion examples/rna.dawg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Output.Rna = 1
Tree.Tree = "(A:0.3, B:0.2)C;"
Tree.Scale = 0.99999
Root.Length = 100
Root.Code = TCAAAAGGGGTTTTCCCCAAATTAAGGCCCC
Root.Code = 2
Root.Seq = "AATGCTTTTTTTTTTGGCCAA"
Sim.Reps = 4
Sim.Seed = 42
Expand Down
7 changes: 5 additions & 2 deletions src/include/dawg/residue.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class residue_exchange {
static constexpr char sIns[] = "-+";
// table for going from base->char
// TODO: Allow codons to be translated into aa
// table is 63 wide and 30 down
static constexpr char mods[] =
"ACGT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-" // DNA
"acgt!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-" // dna
Expand Down Expand Up @@ -159,7 +160,7 @@ class residue_exchange {
rna_ = rna;

type_ = type; // set sequence type NA, AA, or CODON
nuc_ = ((rna) ? MODRNA : MODDNA) | ((lowercase) ? 1 : 0);
nuc_ = ((rna) ? MODRNA : MODDNA) | static_cast<unsigned int>((lowercase) ? 1 : 0);
code_ = code;
if(MODCOD+code_ >= MODEND || mods[(MODCOD+code_)*64] == '!')
return DAWG_ERROR("invalid genetic code.");
Expand All @@ -169,7 +170,9 @@ class residue_exchange {
cs_decode_ = &mods[nuc_*64];
break;
case AA:
cs_decode_ = &mods[(MODAA + (lowercase ? 1 : 0))*64];
// if (rna_) cs_decode_ = &mods[nuc_*64];
// else
cs_decode_ = &mods[(MODAA + (lowercase ? 1 : 0))*64];
break;
case CODON:
cs_decode_ = &mods[(MODCOD+code_)*64];
Expand Down

0 comments on commit f45912e

Please sign in to comment.