ARB
rdp_info.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : rdp_info.cxx //
4 // Purpose : //
5 // //
6 // =============================================================== //
7 
8 #include "rdp_info.h"
9 #include "defs.h"
10 #include "reader.h"
11 
12 bool parse_RDP_comment(RDP_comments& comments, RDP_comment_parser one_comment_entry, const char *key, int index, Reader& reader) {
13  OrgInfo& orginf = comments.orginf;
14  SeqInfo& seqinf = comments.seqinf;
15 
16  if (str_equal(key, "Source of strain:")) one_comment_entry(orginf.source, index, reader);
17  else if (str_equal(key, "Culture collection:")) one_comment_entry(orginf.cultcoll, index, reader);
18  else if (str_equal(key, "Former name:")) one_comment_entry(orginf.formname, index, reader);
19  else if (str_equal(key, "Alternate name:")) one_comment_entry(orginf.nickname, index, reader);
20  else if (str_equal(key, "Common name:")) one_comment_entry(orginf.commname, index, reader);
21  else if (str_equal(key, "Host organism:")) one_comment_entry(orginf.hostorg, index, reader);
22  else if (str_equal(key, "RDP ID:")) one_comment_entry(seqinf.RDPid, index, reader);
23  else if (str_equal(key, "Corresponding GenBank entry:")) one_comment_entry(seqinf.gbkentry, index, reader);
24  else if (str_equal(key, "Sequencing methods:")) one_comment_entry(seqinf.methods, index, reader);
25  else if (str_equal(key, "5' end complete:")) {
26  char flag[TOKENSIZE];
27  scan_token_or_die(flag, reader, index);
28  if (flag[0] == 'Y') seqinf.comp5 = 'y';
29  else seqinf.comp5 = 'n';
30  ++reader;
31  }
32  else if (str_equal(key, "3' end complete:")) {
33  char flag[TOKENSIZE];
34  scan_token_or_die(flag, reader, index);
35  if (flag[0] == 'Y') seqinf.comp3 = 'y';
36  else seqinf.comp3 = 'n';
37  ++reader;
38  }
39  else if (str_equal(key, "Sequence information ")) ++reader;
40  else if (str_equal(key, "Organism information")) ++reader;
41  else {
42  return false;
43  }
44  return true;
45 }
46 
47 
48 
49 
Definition: reader.h:21
char * nickname
Definition: rdp_info.h:18
char * formname
Definition: rdp_info.h:17
char * gbkentry
Definition: rdp_info.h:64
bool parse_RDP_comment(RDP_comments &comments, RDP_comment_parser one_comment_entry, const char *key, int index, Reader &reader)
Definition: rdp_info.cxx:12
char * commname
Definition: rdp_info.h:19
void(* RDP_comment_parser)(char *&datastring, int start_index, Reader &reader)
Definition: fun.h:49
char * source
Definition: rdp_info.h:15
char comp5
Definition: rdp_info.h:61
SeqInfo seqinf
Definition: rdp_info.h:98
char comp3
Definition: rdp_info.h:60
void scan_token_or_die(char *to, const char *from)
Definition: util.cxx:14
long int flag
Definition: f2c.h:39
OrgInfo orginf
Definition: rdp_info.h:97
char * hostorg
Definition: rdp_info.h:20
char * RDPid
Definition: rdp_info.h:63
CONSTEXPR_INLINE bool str_equal(const char *s1, const char *s2)
Definition: global.h:95
#define TOKENSIZE
Definition: defs.h:18
char * cultcoll
Definition: rdp_info.h:16
char * methods
Definition: rdp_info.h:65