Changeset 573


Ignore:
Timestamp:
04/28/10 17:45:28 (4 months ago)
Author:
reed
Message:

framework for aa models

Location:
current/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • current/src/include/dawg/details/subst_aa.h

    r568 r573  
    167167    return create_aagtr("wagstar", &s[0], &s[190], &p[0], &p[20]); 
    168168} 
    169   
     169 
     170template<typename It1, typename It2> 
     171bool subst_model::create_lg(const char *, It1 first1, It1 last1, It2 first2, It2 last2) { 
     172    static double s[190]; 
     173    static double p[20]; 
     174    if(first2 != last2) { //+F model 
     175        return create_aagtr("lg+f", &s[0], &s[190], first2, last2); 
     176    } 
     177    return create_aagtr("lg", &s[0], &s[190], &p[0], &p[20]); 
     178} 
     179 
     180template<typename It1, typename It2> 
     181bool subst_model::create_jtt(const char *, It1 first1, It1 last1, It2 first2, It2 last2) { 
     182    static double s[190]; 
     183    static double p[20]; 
     184    if(first2 != last2) { //+F model 
     185        return create_aagtr("jtt+f", &s[0], &s[190], first2, last2); 
     186    } 
     187    return create_aagtr("jtt", &s[0], &s[190], &p[0], &p[20]); 
     188} 
     189 
     190template<typename It1, typename It2> 
     191bool subst_model::create_dayhoff(const char *, It1 first1, It1 last1, It2 first2, It2 last2) { 
     192    static double s[190]; 
     193    static double p[20]; 
     194    if(first2 != last2) { //+F model 
     195        return create_aagtr("dayhoff+f", &s[0], &s[190], first2, last2); 
     196    } 
     197    return create_aagtr("dayhoff", &s[0], &s[190], &p[0], &p[20]); 
     198} 
     199 
     200template<typename It1, typename It2> 
     201bool subst_model::create_molphy(const char *, It1 first1, It1 last1, It2 first2, It2 last2) { 
     202    static double s[190]; 
     203    static double p[20]; 
     204    if(first2 != last2) { //+F model 
     205        return create_aagtr("molphy+f", &s[0], &s[190], first2, last2); 
     206    } 
     207    return create_aagtr("molphy", &s[0], &s[190], &p[0], &p[20]); 
     208} 
     209 
    170210} // namespace dawg 
    171211  
  • current/src/include/dawg/subst.h

    r568 r573  
    9494 
    9595    template<typename It1, typename It2> 
     96    bool create_lg(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
     97 
     98    template<typename It1, typename It2> 
    9699    bool create_wag(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
    97100 
    98101    template<typename It1, typename It2> 
    99102    bool create_wagstar(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
     103     
     104    template<typename It1, typename It2> 
     105    bool create_jtt(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
     106 
     107    template<typename It1, typename It2> 
     108    bool create_dayhoff(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
     109 
     110    template<typename It1, typename It2> 
     111    bool create_molphy(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2); 
    100112}; 
    101113 
    102114template<typename It1, typename It2> 
    103115bool subst_model::create(const char *mod_name, It1 first1, It1 last1, It2 first2, It2 last2) { 
    104     static const char name_keys[][10] = { 
     116    static const char name_keys[][16] = { 
    105117        "jc",  "gtr", "k2p", "hky", "f84", "f81", "tn", "tn-f04", 
    106         "aagtr", "wag", "wagstar" 
     118        "aagtr", "lg", "wag", "wagstar", "jtt-dcmut", "dayhoff-dcmut", "molphy" 
    107119    }; 
    108120     
     
    111123        &subst_model::create_hky, &subst_model::create_f84, &subst_model::create_f81, 
    112124        &subst_model::create_tn, &subst_model::create_tn_f04, 
    113         &subst_model::create_aagtr, &subst_model::create_wag, &subst_model::create_wagstar, 
     125        &subst_model::create_aagtr, &subst_model::create_lg, &subst_model::create_wag, 
     126        &subst_model::create_wagstar, &subst_model::create_jtt, &subst_model::create_dayhoff, 
     127        &subst_model::create_molphy 
    114128    }; 
    115129    std::size_t pos = key_switch(mod_name, name_keys); 
  • current/src/lib/output.cpp

    r572 r573  
    108108 
    109109    string::iterator it = split_file_name.begin()+split_id_offset; 
    110     generate(it, right_align(split_width,lit('0'))[uint_], rep); 
     110    generate(it, right_align(split_width, "0")[uint_], rep); 
    111111     
    112112    if(!open_file(split_file_name.c_str())) 
Note: See TracChangeset for help on using the changeset viewer.