Changeset 3487


Ignore:
Timestamp:
Mar 24, 2016, 5:24:05 AM (6 years ago)
Author:
Peter
Message:

add function amino_acid_long

Location:
trunk/yat/omic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/Codon.cc

    r3330 r3487  
    22
    33/*
    4   Copyright (C) 2010, 2011, 2012, 2014 Peter Johansson
     4  Copyright (C) 2010, 2011, 2012, 2014, 2016 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    9696    assert(iter_!=map_.end());
    9797    return iter_->second;
     98  }
     99
     100
     101  std::string Codon::amino_acid_long(void) const
     102  {
     103    switch (iter_->second) {
     104    case('A'): return "Ala";
     105    case('L'): return "Leu";
     106    case('R'): return "Arg";
     107    case('K'): return "Lys";
     108    case('N'): return "Asn";
     109    case('M'): return "Met";
     110    case('D'): return "Asn";
     111    case('F'): return "Phe";
     112    case('C'): return "Cys";
     113    case('P'): return "Pro";
     114    case('Q'): return "Gln";
     115    case('S'): return "Ser";
     116    case('E'): return "Glu";
     117    case('T'): return "Thr";
     118    case('G'): return "Gly";
     119    case('W'): return "Trp";
     120    case('H'): return "His";
     121    case('Y'): return "Tyr";
     122    case('I'): return "Ile";
     123    case('V'): return "Val";
     124    case('*'): return "Ter";
     125    default:
     126      assert(0);
     127    }
     128    return "";
    98129  }
    99130
  • trunk/yat/omic/Codon.h

    r3114 r3487  
    55
    66/*
    7   Copyright (C) 2010, 2011, 2012, 2013 Peter Johansson
     7  Copyright (C) 2010, 2011, 2012, 2013, 2016 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    9494
    9595    /**
     96       \return three characters describing which amino acid the Codon
     97       translates to.
     98
     99       \since New in yat 0.14
     100     */
     101    std::string amino_acid_long(void) const;
     102
     103    /**
    96104       \return \a i th DNA
    97105     */
Note: See TracChangeset for help on using the changeset viewer.