Definition at line 59 of file StringFeatures.h.
Public Member Functions | |
CStringFeatures (E_ALPHABET alpha) | |
CStringFeatures (CAlphabet *alpha) | |
CStringFeatures (const CStringFeatures &orig) | |
CStringFeatures (char *fname, E_ALPHABET alpha=DNA) | |
virtual | ~CStringFeatures () |
void | cleanup () |
virtual EFeatureClass | get_feature_class () |
virtual EFeatureType | get_feature_type () |
CAlphabet * | get_alphabet () |
virtual CFeatures * | duplicate () const |
void | select_feature_vector (INT num) |
void | get_string (ST **dst, INT *len) |
virtual ST * | get_feature_vector (INT num, INT &len) |
virtual void | set_feature_vector (INT num, ST *string, INT len) |
virtual ST | get_feature (INT vec_num, INT feat_num) |
virtual INT | get_vector_length (INT vec_num) |
virtual INT | get_max_vector_length () |
virtual INT | get_num_vectors () |
LONGREAL | get_num_symbols () |
LONGREAL | get_max_num_symbols () |
LONGREAL | get_original_num_symbols () |
INT | get_order () |
ST | get_masked_symbols (ST symbol, BYTE mask) |
ST | shift_offset (ST offset, INT amount) |
ST | shift_symbol (ST symbol, INT amount) |
virtual bool | load (CHAR *fname) |
bool | load_dna_file (CHAR *fname, bool remap_to_bin=true) |
bool | load_from_directory (CHAR *dirname) |
bool | set_features (T_STRING< ST > *p_features, INT p_num_vectors, INT p_max_string_length) |
virtual T_STRING< ST > * | get_features (INT &num_str, INT &max_str_len) |
virtual bool | save (CHAR *dest) |
virtual INT | get_size () |
virtual bool | apply_preproc (bool force_preprocessing=false) |
INT | obtain_by_sliding_window (INT window_size, INT step_size, INT skip=0) |
INT | obtain_by_position_list (INT window_size, CDynamicArray< INT > *positions, INT skip=0) |
bool | obtain_from_char (CStringFeatures< CHAR > *sf, INT start, INT p_order, INT gap, bool rev) |
template<class CT> | |
bool | obtain_from_char_features (CStringFeatures< CT > *sf, INT start, INT p_order, INT gap, bool rev) |
bool | have_same_length (INT len) |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
template<> | |
EFeatureType | get_feature_type () |
virtual INT | add_preproc (CPreProc *p) |
set preprocessor | |
virtual CPreProc * | del_preproc (INT num) |
del current preprocessor | |
CPreProc * | get_preproc (INT num) |
get current preprocessor | |
void | set_preprocessed (INT num) |
bool | is_preprocessed (INT num) |
INT | get_num_preprocessed () |
get whether specified preprocessor (or all if num=1) was/were already applied | |
INT | get_num_preproc () |
void | clean_preprocs () |
clears all preprocs | |
INT | get_cache_size () |
virtual bool | reshape (INT num_features, INT num_vectors) |
void | list_feature_obj () |
bool | check_feature_compatibility (CFeatures *f) |
Static Public Attributes | |
static CParallel | parallel |
static CIO | io |
static CVersion | version |
Protected Member Functions | |
void | translate_from_single_order (ST *obs, INT sequence_length, INT start, INT p_order, INT max_val) |
void | translate_from_single_order_reversed (ST *obs, INT sequence_length, INT start, INT p_order, INT max_val) |
void | translate_from_single_order (ST *obs, INT sequence_length, INT start, INT p_order, INT max_val, INT gap) |
void | translate_from_single_order_reversed (ST *obs, INT sequence_length, INT start, INT p_order, INT max_val, INT gap) |
Protected Attributes | |
CAlphabet * | alphabet |
alphabet | |
INT | num_vectors |
number of string vectors | |
T_STRING< ST > * | features |
this contains the array of features. | |
ST * | single_string |
true when single string / created by sliding window | |
INT | length_of_single_string |
length of prior single string | |
INT | max_string_length |
length of longest string | |
LONGREAL | num_symbols |
number of used symbols | |
LONGREAL | original_num_symbols |
original number of used symbols (before higher order mapping) | |
INT | order |
order used in higher order mapping | |
INT | selected_vector |
vector to be obtained via get_string | |
ST * | symbol_mask_table |
order used in higher order mapping |
CStringFeatures< ST >::CStringFeatures | ( | E_ALPHABET | alpha | ) |
constructor
alpha | alphabet (type) to use for string features |
Definition at line 66 of file StringFeatures.h.
CStringFeatures< ST >::CStringFeatures | ( | CAlphabet * | alpha | ) |
constructor
alpha | alphabet to use for string features |
Definition at line 82 of file StringFeatures.h.
CStringFeatures< ST >::CStringFeatures | ( | const CStringFeatures< ST > & | orig | ) |
copy constructor
Definition at line 95 of file StringFeatures.h.
CStringFeatures< ST >::CStringFeatures | ( | char * | fname, | |
E_ALPHABET | alpha = DNA | |||
) |
constructor
fname | filename to load features from | |
alpha | alphabet (type) to use for string features |
Definition at line 135 of file StringFeatures.h.
virtual CStringFeatures< ST >::~CStringFeatures | ( | ) | [virtual] |
Definition at line 148 of file StringFeatures.h.
void CStringFeatures< ST >::cleanup | ( | ) |
cleanup string features
Definition at line 160 of file StringFeatures.h.
virtual EFeatureClass CStringFeatures< ST >::get_feature_class | ( | ) | [virtual] |
get feature class
Implements CFeatures.
Definition at line 186 of file StringFeatures.h.
virtual EFeatureType CStringFeatures< ST >::get_feature_type | ( | ) | [virtual] |
CAlphabet* CStringFeatures< ST >::get_alphabet | ( | ) |
get alphabet used in string features
Definition at line 198 of file StringFeatures.h.
virtual CFeatures* CStringFeatures< ST >::duplicate | ( | ) | const [virtual] |
duplicate feature object
Implements CFeatures.
Definition at line 208 of file StringFeatures.h.
void CStringFeatures< ST >::select_feature_vector | ( | INT | num | ) |
select feature vector
num | which feature vector to select |
Definition at line 217 of file StringFeatures.h.
void CStringFeatures< ST >::get_string | ( | ST ** | dst, | |
INT * | len | |||
) |
get feature vector for selected example
dst | destination where vector will be stored | |
len | number of features in vector |
Definition at line 230 of file StringFeatures.h.
virtual ST* CStringFeatures< ST >::get_feature_vector | ( | INT | num, | |
INT & | len | |||
) | [virtual] |
get feature vector for sample num
num | index of feature vector | |
len | length is returned by reference |
Definition at line 246 of file StringFeatures.h.
virtual void CStringFeatures< ST >::set_feature_vector | ( | INT | num, | |
ST * | string, | |||
INT | len | |||
) | [virtual] |
set feature vector for sample num
num | index of feature vector | |
string | string with the feature vector's content | |
len | length of the string |
Definition at line 261 of file StringFeatures.h.
virtual ST CStringFeatures< ST >::get_feature | ( | INT | vec_num, | |
INT | feat_num | |||
) | [virtual] |
get feature
vec_num | which vector | |
feat_num | which feature |
Definition at line 276 of file StringFeatures.h.
virtual INT CStringFeatures< ST >::get_vector_length | ( | INT | vec_num | ) | [virtual] |
get vector length
vec_num | which vector |
Definition at line 289 of file StringFeatures.h.
virtual INT CStringFeatures< ST >::get_max_vector_length | ( | ) | [virtual] |
get maximum vector length
Definition at line 299 of file StringFeatures.h.
virtual INT CStringFeatures< ST >::get_num_vectors | ( | ) | [virtual] |
get number of vectors
Implements CFeatures.
Definition at line 308 of file StringFeatures.h.
LONGREAL CStringFeatures< ST >::get_num_symbols | ( | ) |
get number of symbols
Note: LONGREAL sounds weird, but LONG is not long enough
Definition at line 316 of file StringFeatures.h.
LONGREAL CStringFeatures< ST >::get_max_num_symbols | ( | ) |
get maximum number of symbols
Note: LONGREAL sounds weird, but LONG is not long enough
Definition at line 324 of file StringFeatures.h.
LONGREAL CStringFeatures< ST >::get_original_num_symbols | ( | ) |
number of symbols before higher order mapping
Definition at line 332 of file StringFeatures.h.
INT CStringFeatures< ST >::get_order | ( | ) |
ST CStringFeatures< ST >::get_masked_symbols | ( | ST | symbol, | |
BYTE | mask | |||
) |
a higher order mapped symbol will be shaped such that the symbols specified by bits in the mask will be returned.
symbol | symbol to mask | |
mask | mask to apply |
Definition at line 347 of file StringFeatures.h.
ST CStringFeatures< ST >::shift_offset | ( | ST | offset, | |
INT | amount | |||
) |
shift offset to the left by amount
offset | offset to shift | |
amount | amount to shift the offset |
Definition at line 359 of file StringFeatures.h.
ST CStringFeatures< ST >::shift_symbol | ( | ST | symbol, | |
INT | amount | |||
) |
shift symbol to the right by amount (taking care of custom symbol sizes)
symbol | symbol to shift | |
amount | amount to shift the symbol |
Definition at line 371 of file StringFeatures.h.
virtual bool CStringFeatures< ST >::load | ( | CHAR * | fname | ) | [virtual] |
load features from file
fname | filename to load from |
Reimplemented from CFeatures.
Definition at line 382 of file StringFeatures.h.
bool CStringFeatures< ST >::load_dna_file | ( | CHAR * | fname, | |
bool | remap_to_bin = true | |||
) |
load DNA features from file
fname | filename to load from | |
remap_to_bin | if remap_to_bin |
Definition at line 442 of file StringFeatures.h.
bool CStringFeatures< ST >::load_from_directory | ( | CHAR * | dirname | ) |
load features from directory
dirname | directory name to load from |
Definition at line 575 of file StringFeatures.h.
bool CStringFeatures< ST >::set_features | ( | T_STRING< ST > * | p_features, | |
INT | p_num_vectors, | |||
INT | p_max_string_length | |||
) |
set features
p_features | new features | |
p_num_vectors | number of vectors | |
p_max_string_length | maximum string length |
Definition at line 648 of file StringFeatures.h.
virtual T_STRING<ST>* CStringFeatures< ST >::get_features | ( | INT & | num_str, | |
INT & | max_str_len | |||
) | [virtual] |
get_features
num_str | number of strings (returned) | |
max_str_len | maximal string length (returned) |
Definition at line 692 of file StringFeatures.h.
virtual bool CStringFeatures< ST >::save | ( | CHAR * | dest | ) | [virtual] |
save features to file
dest | filename to save to |
Reimplemented from CFeatures.
Definition at line 704 of file StringFeatures.h.
virtual INT CStringFeatures< ST >::get_size | ( | ) | [virtual] |
get memory footprint of one feature
Implements CFeatures.
Definition at line 713 of file StringFeatures.h.
virtual bool CStringFeatures< ST >::apply_preproc | ( | bool | force_preprocessing = false |
) | [virtual] |
apply preprocessor
force_preprocessing | if preprocssing shall be forced |
Definition at line 720 of file StringFeatures.h.
INT CStringFeatures< ST >::obtain_by_sliding_window | ( | INT | window_size, | |
INT | step_size, | |||
INT | skip = 0 | |||
) |
slides a window of size window_size over the current single string step_size is the amount by which the window is shifted. creates (string_len-window_size)/step_size many feature obj if skip is nonzero, skip the first 'skip' characters of each string
window_size | window size | |
step_size | step size | |
skip | skip |
Definition at line 748 of file StringFeatures.h.
INT CStringFeatures< ST >::obtain_by_position_list | ( | INT | window_size, | |
CDynamicArray< INT > * | positions, | |||
INT | skip = 0 | |||
) |
extracts windows of size window_size from first string using the positions in list
window_size | window size | |
positions | positions | |
skip | skip |
Definition at line 791 of file StringFeatures.h.
bool CStringFeatures< ST >::obtain_from_char | ( | CStringFeatures< CHAR > * | sf, | |
INT | start, | |||
INT | p_order, | |||
INT | gap, | |||
bool | rev | |||
) |
obtain string features from char features
wrapper for template method
sf | string features | |
start | start | |
p_order | order | |
gap | gap | |
rev | reverse |
Definition at line 857 of file StringFeatures.h.
bool CStringFeatures< ST >::obtain_from_char_features | ( | CStringFeatures< CT > * | sf, | |
INT | start, | |||
INT | p_order, | |||
INT | gap, | |||
bool | rev | |||
) |
template obtain from char features
sf | string features | |
start | start | |
p_order | order | |
gap | gap | |
rev | reverse |
Definition at line 872 of file StringFeatures.h.
bool CStringFeatures< ST >::have_same_length | ( | INT | len | ) |
check if length of each vector in this feature object equals the given length.
len | vector length to check against |
Definition at line 965 of file StringFeatures.h.
void CStringFeatures< ST >::translate_from_single_order | ( | ST * | obs, | |
INT | sequence_length, | |||
INT | start, | |||
INT | p_order, | |||
INT | max_val | |||
) | [protected] |
translate from single order
obs | observation | |
sequence_length | length of sequence | |
start | start | |
p_order | order | |
max_val | maximum value |
Definition at line 988 of file StringFeatures.h.
void CStringFeatures< ST >::translate_from_single_order_reversed | ( | ST * | obs, | |
INT | sequence_length, | |||
INT | start, | |||
INT | p_order, | |||
INT | max_val | |||
) | [protected] |
translate from single order reversed
obs | observation | |
sequence_length | length of sequence | |
start | start | |
p_order | order | |
max_val | maximum value |
Definition at line 1029 of file StringFeatures.h.
void CStringFeatures< ST >::translate_from_single_order | ( | ST * | obs, | |
INT | sequence_length, | |||
INT | start, | |||
INT | p_order, | |||
INT | max_val, | |||
INT | gap | |||
) | [protected] |
translate from single order
obs | observation | |
sequence_length | length of sequence | |
start | start | |
p_order | order | |
max_val | maximum value | |
gap | gap |
Definition at line 1071 of file StringFeatures.h.
void CStringFeatures< ST >::translate_from_single_order_reversed | ( | ST * | obs, | |
INT | sequence_length, | |||
INT | start, | |||
INT | p_order, | |||
INT | max_val, | |||
INT | gap | |||
) | [protected] |
translate from single order reversed
obs | observation | |
sequence_length | length of sequence | |
start | start | |
p_order | order | |
max_val | maximum value | |
gap | gap |
Definition at line 1138 of file StringFeatures.h.
EFeatureType CStringFeatures< CHAR >::get_feature_type | ( | ) | [virtual] |
get feature type the CHAR feature can deal with
Implements CFeatures.
Definition at line 1232 of file StringFeatures.h.
EFeatureType CStringFeatures< BYTE >::get_feature_type | ( | ) | [virtual] |
get feature type the BYTE feature can deal with
Implements CFeatures.
Definition at line 1241 of file StringFeatures.h.
EFeatureType CStringFeatures< SHORT >::get_feature_type | ( | ) | [virtual] |
get feature type the SHORT feature can deal with
Implements CFeatures.
Definition at line 1250 of file StringFeatures.h.
EFeatureType CStringFeatures< WORD >::get_feature_type | ( | ) | [virtual] |
get feature type the WORD feature can deal with
Implements CFeatures.
Definition at line 1259 of file StringFeatures.h.
EFeatureType CStringFeatures< INT >::get_feature_type | ( | ) | [virtual] |
get feature type the INT feature can deal with
Implements CFeatures.
Definition at line 1268 of file StringFeatures.h.
EFeatureType CStringFeatures< UINT >::get_feature_type | ( | ) | [virtual] |
get feature type the INT feature can deal with
Implements CFeatures.
Definition at line 1277 of file StringFeatures.h.
EFeatureType CStringFeatures< LONG >::get_feature_type | ( | ) | [virtual] |
get feature type the LONG feature can deal with
Implements CFeatures.
Definition at line 1286 of file StringFeatures.h.
EFeatureType CStringFeatures< ULONG >::get_feature_type | ( | ) | [virtual] |
get feature type the ULONG feature can deal with
Implements CFeatures.
Definition at line 1295 of file StringFeatures.h.
EFeatureType CStringFeatures< DREAL >::get_feature_type | ( | ) | [virtual] |
get feature type the DREAL feature can deal with
Implements CFeatures.
Definition at line 1304 of file StringFeatures.h.
set preprocessor
add preprocessor
p | preprocessor to set |
Definition at line 48 of file Features.cpp.
del current preprocessor
delete preprocessor from list caller has to clean up returned preproc
num | index of preprocessor in list |
Definition at line 107 of file Features.cpp.
get current preprocessor
get specified preprocessor
num | index of preprocessor in list |
Definition at line 78 of file Features.cpp.
void CFeatures::set_preprocessed | ( | INT | num | ) | [inherited] |
set applied flag for preprocessor
num | index of preprocessor in list |
Definition at line 95 of file Features.h.
bool CFeatures::is_preprocessed | ( | INT | num | ) | [inherited] |
get whether specified preprocessor was already applied
num | index of preprocessor in list |
Definition at line 101 of file Features.h.
INT CFeatures::get_num_preprocessed | ( | ) | [inherited] |
get whether specified preprocessor (or all if num=1) was/were already applied
get the number of applied preprocs
Definition at line 87 of file Features.cpp.
INT CFeatures::get_num_preproc | ( | ) | [inherited] |
get number of preprocessors
Definition at line 113 of file Features.h.
void CFeatures::clean_preprocs | ( | ) | [inherited] |
INT CFeatures::get_cache_size | ( | ) | [inherited] |
in case there is a feature matrix allow for reshaping
NOT IMPLEMENTED!
num_features | new number of features | |
num_vectors | new number of vectors |
Reimplemented in CSimpleFeatures< ST >, CSimpleFeatures< double >, CSimpleFeatures< float >, CSimpleFeatures< int >, CSimpleFeatures< short int >, CSimpleFeatures< unsigned char >, CSimpleFeatures< char >, and CSimpleFeatures< unsigned short int >.
Definition at line 140 of file Features.h.
void CFeatures::list_feature_obj | ( | ) | [inherited] |
list feature object
Definition at line 152 of file Features.cpp.
bool CFeatures::check_feature_compatibility | ( | CFeatures * | f | ) | [inherited] |
check feature compatibility
f | features to check for compatibility |
Definition at line 223 of file Features.cpp.
CAlphabet* CStringFeatures< ST >::alphabet [protected] |
INT CStringFeatures< ST >::num_vectors [protected] |
T_STRING<ST>* CStringFeatures< ST >::features [protected] |
ST* CStringFeatures< ST >::single_string [protected] |
true when single string / created by sliding window
Definition at line 1204 of file StringFeatures.h.
INT CStringFeatures< ST >::length_of_single_string [protected] |
INT CStringFeatures< ST >::max_string_length [protected] |
LONGREAL CStringFeatures< ST >::num_symbols [protected] |
LONGREAL CStringFeatures< ST >::original_num_symbols [protected] |
original number of used symbols (before higher order mapping)
Definition at line 1216 of file StringFeatures.h.
INT CStringFeatures< ST >::order [protected] |
INT CStringFeatures< ST >::selected_vector [protected] |
ST* CStringFeatures< ST >::symbol_mask_table [protected] |
CParallel CSGObject::parallel [static, inherited] |
Definition at line 105 of file SGObject.h.
CIO CSGObject::io [static, inherited] |
Definition at line 106 of file SGObject.h.
CVersion CSGObject::version [static, inherited] |
Definition at line 107 of file SGObject.h.