File: sequenceUtil.hpp

package info (click to toggle)
trinityrnaseq 2.11.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 417,528 kB
  • sloc: perl: 48,420; cpp: 17,749; java: 12,695; python: 3,124; sh: 1,030; ansic: 983; makefile: 688; xml: 62
file content (52 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <vector>
#include <map>
#include <cctype>



#ifndef __SEQUENCEUTIL__

#define __SEQUENCEUTIL__

using namespace std;

// misc typedefs
typedef struct { string accession; string header; string sequence; } fastaRecord;

typedef unsigned long long kmer_int_type_t;

// function prototypes
string read_sequence_from_file (string filename);
string revcomp (const string);
fastaRecord readNextFastaRecord(ifstream& reader);
bool contains_non_gatc(string kmer);
string remove_whitespace(string s);


char int_to_base(int baseval); // 0 1 2 3 => G A T C
int base_to_int_value(char nucleotide); // (GATC) = {0 1 2 3}, others = -1

kmer_int_type_t kmer_to_intval(string kmer); // must be less than 32 bases for 64-bit conversion
string decode_kmer_from_intval (kmer_int_type_t intval, unsigned int kmer_length);
kmer_int_type_t revcomp_val(kmer_int_type_t kmer, unsigned int kmer_length);
kmer_int_type_t get_canonical_kmer_val(kmer_int_type_t kmer_val, unsigned int kmer_length);
kmer_int_type_t get_DS_kmer_val(kmer_int_type_t kmer_val, unsigned int kmer_length);
vector<kmer_int_type_t> sequence_string_to_kmer_int_type_vector(const string& sequence, int kmer_length);



float compute_entropy(string& kmer);
float compute_entropy(kmer_int_type_t kmer, unsigned int kmer_length);

string replace_nonGATC_chars_with_A(string& input_seq);

unsigned long long generateHash(string& s);


#endif