ARB
|
#include "NT_local.h"
#include <aw_root.hxx>
#include <aw_msg.hxx>
#include <aw_awar.hxx>
#include <arbdbt.h>
#include <arb_strbuf.h>
#include <arb_defs.h>
#include <arb_progress.h>
#include <awt_config_manager.hxx>
#include <awt_misc.hxx>
#include <awt_sel_boxes.hxx>
#include <consensus.h>
#include <consensus_config.h>
#include <chartable.h>
Go to the source code of this file.
Macros | |
#define | AWAR_MAX_FREQ_PREFIX "tmp/CON_MAX_FREQ/" |
#define | AWAR_CONSENSUS_PREFIX "consensus/" |
#define | AWAR_CONSENSUS_PREFIX_TMP "tmp/" AWAR_CONSENSUS_PREFIX |
#define | AWAR_MAX_FREQ_IGNORE_GAPS AWAR_MAX_FREQ_PREFIX "no_gaps" |
#define | AWAR_MAX_FREQ_SAI_NAME AWAR_MAX_FREQ_PREFIX "sai_name" |
#define | AWAR_CONSENSUS_MARKED_ONLY AWAR_CONSENSUS_PREFIX_TMP "marked_only" |
#define | AWAR_CONSENSUS_ALIGNMENT AWAR_CONSENSUS_PREFIX_TMP "alignment" |
#define | AWAR_CONSENSUS_COUNTGAPS AWAR_CONSENSUS_PREFIX "countgaps" |
#define | AWAR_CONSENSUS_GAPBOUND AWAR_CONSENSUS_PREFIX "gapbound" |
#define | AWAR_CONSENSUS_GROUP AWAR_CONSENSUS_PREFIX "group" |
#define | AWAR_CONSENSUS_CONSIDBOUND AWAR_CONSENSUS_PREFIX "considbound" |
#define | AWAR_CONSENSUS_UPPER AWAR_CONSENSUS_PREFIX "upper" |
#define | AWAR_CONSENSUS_LOWER AWAR_CONSENSUS_PREFIX "lower" |
#define | AWAR_CONSENSUS_NAME AWAR_CONSENSUS_PREFIX_TMP "name" |
#define | CONSENSUS_AWAR_SOURCE CAS_NTREE |
Functions | |
static int | CON_insertSequences (GBDATA *gb_main, const char *aliname, long maxalignlen, bool onlymarked, BaseFrequencies &freqs) |
static GB_ERROR | CON_export (GBDATA *gb_main, const char *savename, const char *align, const char *result, bool onlymarked, long nrofspecies, const ConsensusBuildParams &BK) |
static GB_ERROR | CON_calculate (GBDATA *gb_main, const ConsensusBuildParams &BK, const char *aliname, bool onlymarked, const char *sainame) |
static void | CON_calculate_cb (AW_window *aw) |
static void | consensus_upper_lower_changed_cb (AW_root *awr, bool upper_changed) |
void | AP_create_consensus_var (AW_root *aw_root, AW_default aw_def) |
AW_window * | AP_create_con_expert_window (AW_root *aw_root) |
static GB_ERROR | CON_calc_max_freq (GBDATA *gb_main, bool ignore_gaps, const char *savename, const char *aliname) |
static void | CON_calc_max_freq_cb (AW_window *aw) |
AW_window * | AP_create_max_freq_window (AW_root *aw_root) |
Variables | |
static AWT_config_mapping_def | consensus_config_mapping [] |
#define AWAR_MAX_FREQ_PREFIX "tmp/CON_MAX_FREQ/" |
Definition at line 30 of file AP_consensus.cxx.
#define AWAR_CONSENSUS_PREFIX "consensus/" |
Definition at line 31 of file AP_consensus.cxx.
#define AWAR_CONSENSUS_PREFIX_TMP "tmp/" AWAR_CONSENSUS_PREFIX |
Definition at line 32 of file AP_consensus.cxx.
#define AWAR_MAX_FREQ_IGNORE_GAPS AWAR_MAX_FREQ_PREFIX "no_gaps" |
Definition at line 34 of file AP_consensus.cxx.
Referenced by AP_create_consensus_var(), AP_create_max_freq_window(), and CON_calc_max_freq_cb().
#define AWAR_MAX_FREQ_SAI_NAME AWAR_MAX_FREQ_PREFIX "sai_name" |
Definition at line 35 of file AP_consensus.cxx.
Referenced by AP_create_consensus_var(), AP_create_max_freq_window(), and CON_calc_max_freq_cb().
#define AWAR_CONSENSUS_MARKED_ONLY AWAR_CONSENSUS_PREFIX_TMP "marked_only" |
Definition at line 37 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), AP_create_consensus_var(), and CON_calculate_cb().
#define AWAR_CONSENSUS_ALIGNMENT AWAR_CONSENSUS_PREFIX_TMP "alignment" |
Definition at line 38 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), AP_create_consensus_var(), and CON_calculate_cb().
#define AWAR_CONSENSUS_COUNTGAPS AWAR_CONSENSUS_PREFIX "countgaps" |
Definition at line 39 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), and AP_create_consensus_var().
#define AWAR_CONSENSUS_GAPBOUND AWAR_CONSENSUS_PREFIX "gapbound" |
Definition at line 40 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), and AP_create_consensus_var().
#define AWAR_CONSENSUS_GROUP AWAR_CONSENSUS_PREFIX "group" |
Definition at line 41 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), and AP_create_consensus_var().
#define AWAR_CONSENSUS_CONSIDBOUND AWAR_CONSENSUS_PREFIX "considbound" |
Definition at line 42 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), and AP_create_consensus_var().
#define AWAR_CONSENSUS_UPPER AWAR_CONSENSUS_PREFIX "upper" |
Definition at line 43 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), AP_create_consensus_var(), and consensus_upper_lower_changed_cb().
#define AWAR_CONSENSUS_LOWER AWAR_CONSENSUS_PREFIX "lower" |
Definition at line 44 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), AP_create_consensus_var(), and consensus_upper_lower_changed_cb().
#define AWAR_CONSENSUS_NAME AWAR_CONSENSUS_PREFIX_TMP "name" |
Definition at line 45 of file AP_consensus.cxx.
Referenced by AP_create_con_expert_window(), AP_create_consensus_var(), and CON_calculate_cb().
#define CONSENSUS_AWAR_SOURCE CAS_NTREE |
Definition at line 47 of file AP_consensus.cxx.
|
static |
read sequence data and fill into 'freqs'
gb_main | database |
aliname | name of alignment |
maxalignlen | length of alignment |
onlymarked | true -> marked only |
freqs | sequences are inserted here (has to be empty) |
Definition at line 52 of file AP_consensus.cxx.
References BaseFrequencies::added_sequences(), arb_progress::auto_subtitles(), arb_progress::done(), GB_read_char_pntr(), GB_read_string_count(), GBS_global_string(), GBT_count_marked_species(), GBT_find_sequence(), GBT_first_marked_species(), GBT_first_species(), GBT_get_species_count(), GBT_message(), GBT_next_marked_species(), GBT_next_species(), length, and nt_assert.
Referenced by CON_calc_max_freq(), and CON_calculate().
|
static |
writes consensus SAI to DB
gb_main | database |
savename | name of SAI to save to |
align | alignment name |
result | SAI data to write |
onlymarked | true -> was calculated on marked only (used for SAI comment) |
nrofspecies | number of used sequences (used for SAI comment; if less than 20 -> add an explicit list to field '_SPECIES') |
BK | parameters used for consensus calculation (used for SAI comment) |
Definition at line 90 of file AP_consensus.cxx.
References buffer, GBS_strstruct::cat(), ConsensusBuildParams::considbound, ConsensusBuildParams::countgaps, ConsensusBuildParams::gapbound, GB_delete(), GB_FIND, GB_get_father(), GB_read_char_pntr(), GB_search(), GB_STRING, GB_write_string(), GBS_global_string(), GBT_add_data(), GBT_find_or_create_SAI(), GBT_find_sequence(), GBT_first_marked_species(), GBT_first_species(), GBT_next_marked_species(), GBT_next_species(), GBT_write_string(), GBS_strstruct::get_data(), ConsensusBuildParams::group, ConsensusBuildParams::lower, GBS_strstruct::put(), and ConsensusBuildParams::upper.
Referenced by CON_calculate().
|
static |
calculates the consensus and writes it to SAI 'sainame' Description how consensus is calculated: ../HELP_SOURCE/source/consensus_def.hlp
gb_main | database |
BK | parameters for consensus calculation |
aliname | alignment name |
onlymarked | true -> use marked sequences only |
sainame | name of destination SAI |
Definition at line 168 of file AP_consensus.cxx.
References arb_assert, BaseFrequencies::build_consensus_string(), CON_export(), CON_insertSequences(), error(), GB_append_exportedError(), GB_AT_UNKNOWN, GB_await_error(), GB_end_transaction(), GB_push_transaction(), GBT_get_alignment_len(), GBT_get_alignment_type(), ConsensusBuildParams::lower, NULp, result, BaseFrequencies::setup(), and ConsensusBuildParams::upper.
Referenced by CON_calculate_cb().
|
static |
Definition at line 212 of file AP_consensus.cxx.
References aw_message_if(), AW_root::awar(), AWAR_CONSENSUS_ALIGNMENT, AWAR_CONSENSUS_MARKED_ONLY, AWAR_CONSENSUS_NAME, CON_calculate(), AW_awar::deny_read, AW_awar::deny_write, error(), NT_global::gb_main, AW_window::get_root(), GLOBAL, AW_awar::read_int(), AW_awar::read_string(), and ta.
Referenced by AP_create_con_expert_window().
|
static |
Definition at line 235 of file AP_consensus.cxx.
References AW_root::awar(), AWAR_CONSENSUS_LOWER, AWAR_CONSENSUS_UPPER, AW_awar::read_int(), and AW_awar::write_int().
Referenced by AP_create_consensus_var().
void AP_create_consensus_var | ( | AW_root * | aw_root, |
AW_default | aw_def | ||
) |
Definition at line 248 of file AP_consensus.cxx.
References AW_awar::add_callback(), ARB_strdup(), AWAR_CONSENSUS_ALIGNMENT, AWAR_CONSENSUS_CONSIDBOUND, AWAR_CONSENSUS_COUNTGAPS, AWAR_CONSENSUS_GAPBOUND, AWAR_CONSENSUS_GROUP, AWAR_CONSENSUS_LOWER, AWAR_CONSENSUS_MARKED_ONLY, AWAR_CONSENSUS_NAME, AWAR_CONSENSUS_UPPER, AW_root::awar_int(), AWAR_MAX_FREQ_IGNORE_GAPS, AWAR_MAX_FREQ_SAI_NAME, AW_root::awar_string(), consensus_upper_lower_changed_cb(), GB_clear_error(), NT_global::gb_main, GBT_get_default_alignment(), GLOBAL, AW_awar::set_minmax(), and ta.
Referenced by nt_create_all_awars().
Definition at line 289 of file AP_consensus.cxx.
References AW_POPDOWN(), AW_ROOT_DEFAULT, AW_SCALER_LINEAR, AWAR_CONSENSUS_ALIGNMENT, AWAR_CONSENSUS_CONSIDBOUND, AWAR_CONSENSUS_COUNTGAPS, AWAR_CONSENSUS_GAPBOUND, AWAR_CONSENSUS_GROUP, AWAR_CONSENSUS_LOWER, AWAR_CONSENSUS_MARKED_ONLY, AWAR_CONSENSUS_NAME, AWAR_CONSENSUS_UPPER, awt_create_ALI_selection_list(), AWT_create_IUPAC_info_window(), awt_create_SAI_selection_list(), AWT_insert_config_manager(), CON_calculate_cb(), CONSENSUS_CONFIG_ID, NT_global::gb_main, GLOBAL, AW_window::load_xfig(), and makeHelpCallback().
Referenced by popup_new_main_window().
|
static |
calculates the maximum frequency for each column and write to SAI
gb_main | database |
ignore_gaps | true -> ignore gaps; see ../HELP_SOURCE/source/max_freq.hlp |
savename | name of destination SAI |
aliname | name of alignment to use |
Definition at line 368 of file AP_consensus.cxx.
References arb_assert, GB_transaction::close(), CON_insertSequences(), error(), GB_append_exportedError(), GB_AT_UNKNOWN, GB_await_error(), GB_have_error(), GB_STRING, GB_write_string(), GBS_global_string(), GBT_add_data(), GBT_find_or_create_SAI(), GBT_get_alignment_len(), GBT_get_alignment_type(), BaseFrequencies::max_frequency_at(), NULp, BaseFrequencies::setup(), ta, and type.
Referenced by CON_calc_max_freq_cb().
|
static |
Definition at line 450 of file AP_consensus.cxx.
References aw_message_if(), AW_root::awar(), AWAR_MAX_FREQ_IGNORE_GAPS, AWAR_MAX_FREQ_SAI_NAME, CON_calc_max_freq(), error(), GB_await_error(), NT_global::gb_main, GBT_get_default_alignment(), AW_window::get_root(), GLOBAL, AW_awar::read_char_pntr(), and AW_awar::read_int().
Referenced by AP_create_max_freq_window().
Definition at line 468 of file AP_consensus.cxx.
References AW_POPDOWN(), AWAR_MAX_FREQ_IGNORE_GAPS, AWAR_MAX_FREQ_SAI_NAME, awt_create_SAI_selection_list(), CON_calc_max_freq_cb(), NT_global::gb_main, GB_pop_transaction(), GB_push_transaction(), GLOBAL, AW_window::load_xfig(), and makeHelpCallback().
Referenced by popup_new_main_window().
|
static |
Definition at line 272 of file AP_consensus.cxx.