head.h

Go to the documentation of this file.
00001 #ifndef PHEAD_H
00002 #define PHEAD_H
00003 #include <iostream.h>
00004 #include <fstream.h>
00005 #include <string>
00006 #include <list>
00007 #include <map>
00008 
00009 #define LINE 83
00010 #define DATAIDX 17    //starting index of data field
00011         
00012 void getField(ifstream &ins, string &tit, char ll[]);
00013 void getAccField(ifstream &ins, string &ff, char ll[]);
00014 void getf(ifstream &ins, string &s, char l[], int fs);
00015 
00016 class accession {  //for accession subfield in ref
00017         private:
00018         char acc[15];
00019         string status;
00020         string moltype;  //only required field
00021         string residu;
00022         string label;
00023         string crossRef;
00024         string expSource;
00025         char genetics[20];
00026         string note;
00027 
00028         public:
00029         void read(ifstream &ins, char ln[]);
00030         void clear();  //change to default empty values of all members
00031 };
00032         
00033 
00034 class ref {  //references one or more
00035         private:
00036         char key[20];
00037         string auth;
00038         string cit;  //one of journal, book, submission, citation
00039         string descrip; //for submission type only
00040         string titl;
00041         //string crossRef;
00042         string cont;
00043         string note;
00044         string acc;
00045         char citype[15]; //citation type
00046         char medid[15];
00047         list<accession> refacc;
00048 
00049         public:
00050         void read(ifstream &ins, char ln[]);
00051         void clear();
00052 
00053 };
00054 
00055 class genetics {
00056         private:
00057         char key[15];
00058         string gene;
00059         string gxref;
00060         string mapos; //map_position
00061         char genome[70];
00062         string gorigin;  //no occurance in pir1.dat
00063         char gcode[30];
00064         char startCodon[5];
00065         string intron;
00066         string otherProduct; //not found in pir1.dat
00067         string note;
00068         string mobele;
00069         
00070         public:
00071         genetics();
00072         void read(ifstream &ins, char ln[]);
00073         void clear();
00074 };
00075 
00076 class func {
00077         private:
00078         char key[60];  //this field not being used now
00079         string descrip;
00080         string pathway;
00081         string note;
00082 
00083         public:
00084         func();
00085         void read(ifstream &ins, char ln[]);
00086         void clear();
00087         void write(ostream &ou) const;
00088 };
00089 
00090 class feature {
00091         private:
00092         string loc;
00093         string feat;
00094 
00095         public:
00096         void read(ifstream &ins, char ln[]);
00097         void write(ostream &ous) const;
00098         void clear();
00099 };
00100 
00101 class protein {
00102  private:
00103    char entry[24];  //this is the key of the protein 
00104         char type[24];
00105         string title;
00106         string altName;  //alternate_name
00107         string contains;
00108         string org;
00109         string date;
00110         string acc;  //this field not processed now
00111         list<ref> reflist;
00112         string comm;
00113         list<genetics> genlist;
00114         string cplx;  //complex
00115         list<func> funclist;
00116         string superfam;
00117         string keywd;
00118         list<feature> felist;
00119         char *seq;
00120         int seqlen;
00121         int seqmaxlen;
00122         int cksm;  //checksum defined in GCG
00123 
00124         void creatDate(ostream &ous) const;
00125         void revDate(ostream &ous) const;
00126         void tcDate(ostream &ous) const;
00127         bool seqRevised() const {return date.find("#sequence_revision") != string::npos; }
00128         bool textChanged() const {return date.find("#text_change") != string::npos;}
00129 
00130  public:
00131         static char rel[12];  //for the release version of pir
00132         protein();
00133         ~protein();
00134         void read(ifstream &ins, char ln[]);  //ln should be first line
00135         void write(ostream &ous);
00136         string fname() const; //return the species object name
00137         string cname() const;
00138         bool orgNamed() const {return org.find("#formal_name") != string::npos;}
00139         //got scientific name
00140         const char *key() const {return entry;}
00141         void clear();
00142 };
00143 
00144 #endif

Generated on Wed Aug 10 11:56:50 2011 for Softwares from Orpara by  doxygen 1.5.6