aboutsummaryrefslogtreecommitdiff
path: root/kmer_utils.h
blob: ae4813681074037e8f37b4b10dc1c99dadafed43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Kmer functions
void convert_kmer_to_num(char *str, const unsigned long length);
unsigned long num_to_index(const char *str, const int kmer, const long error_pos, long long *current_position);
char *index_to_kmer(unsigned long long index, long kmer);

// Utility functions
size_t strnstrip(char *s, int c, size_t len);
unsigned long long pow_four(unsigned long long x);

// Variables
const unsigned char alpha[256]; 

// file loading functions
unsigned long long load_specific_mers_from_file(const char *fn, unsigned int kmer, size_t width, size_t *arr);

unsigned long long * get_kmer_counts_from_filename(const char *fn, const unsigned int kmer);
unsigned long long * get_kmer_counts_from_file(FILE *fh, const int kmer);

unsigned long long * get_continuous_kmer_counts_from_filename(const char *fn, const unsigned int kmer);
unsigned long long * get_continuous_kmer_counts_from_file(FILE *fh, const unsigned int kmer);