 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
29 cout <<
"DEBUG get_genetic_code: Initializing atomic parameters" << endl;
34 Bstring gcfile =
"gencode.star";
35 if ( filename.
c_str() ) gcfile = filename;
44 if ( code.
length() != 64 ) {
46 cout <<
"Genetic code file " << gcfile <<
" not opened! Using default code" << endl;
50 cout <<
"DEBUG get_genetic_code: " << code << endl;
82 cerr <<
"Error: File " << propfile <<
" does contain only " << ncode <<
" codons, 64 required!" << endl;
87 cout <<
"DEBUG read_gencode_star: " << *(item_res->
data) << endl << *(item_codon->
data) << endl;
92 for ( data_res = item_res->
data, data_codon = item_codon->
data; data_res && data_codon;
93 data_res = data_res->
next, data_codon = data_codon->
next ) {
95 gc[index] = data_res[0][0];
101 cout <<
"DEBUG read_gencode_star: " << gc << endl;
114 int i, j, index(0), e;
115 char acgt[8] =
"ACGT";
118 for ( i=0; i<3; i++ ) {
119 upcodon[i] = toupper(codon[i]);
120 e = (int) pow(4.0, 2.0 - i);
121 for ( j=0; j<4; j++ ) {
122 if ( upcodon[i] == acgt[j] ) index += e*j;
Bstring parameter_file_path(Bstring filename)
Finds the parameter file path.
Header file for reading a genetic code from a file.
long item_get_number_for_block(Bstar_block *block, const char *tag)
Gets the number of values associated with a tag in a STAR data block.
Header file for general utilities.
Bstring read_gencode_star(Bstring &propfile)
int read_star(const char *filename, Bstar *star)
Reads paramaters and data into a STAR data base from a list of files.
int kill_star(Bstar *star)
Destroys a STAR data base.
int index_from_codon(const char codon[3])
Gets the index associated with a specific codon.
Bstring get_genetic_code(Bstring &filename)
Gets the genetic code from a parameter file.
Bstar_item * item_find(Bstar_block *block, const char *tag)
Gets the STAR item associated with a tag in a STAR data block.
int write_genetic_code(Bstring &filename, Bstring &gc)
Writing genetic code.
A header file for STAR format files.
bool contains(const Bstring &s)
Bstar * init_star()
Creates a STAR data base.
Bstar_block * block_find_with_tag(Bstar *star, const char *tag)
Gets the first block associated with a tag in a STAR data base.