00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _GENE_H
00023 #define _GENE_H
00024
00025 #include "global.h"
00026 #include "read.h"
00027
00028
00029 class MyAffyGene: public MyInfo
00030 {
00031 public:
00032
00033 MyAffyGene(MyString id = "", MyString sid = "")
00034 : MyInfo(id, sid)
00035 {}
00036
00037 MyAffyGene(const MyAffyGene& copy)
00038 : MyInfo(copy)
00039 {}
00040
00041 virtual ~MyAffyGene()
00042 {}
00043
00044
00045 virtual MyInfo* clone() const
00046 {
00047 MyAffyGene* clone = new MyAffyGene(*this);
00048 return(clone);
00049 }
00050
00051
00052
00053
00054 void read(istream &istr, char delim = '\t', int numNames = 1);
00055 void read(istream &istr, vector< MyNT >& coords, unsigned int& dimension,
00056 char delim = '\t', int numNames = 1, bool hasCallData = false);
00057 bool read(istream &istr, vector< MyNT >& coords, unsigned int& dimension,
00058 const MyAffyFileFormat &format,
00059 set< unsigned int > &missing);
00060
00061 void write(ostream &ostr) const
00062 {
00063 ostr << "Name = " << getName() << endl;
00064 ostr << "Short name = " << getShortName() << endl;
00065 }
00066
00067
00068 void addMissingIndex(unsigned int i)
00069 {
00070 missingIndices.insert(i);
00071 }
00072
00073
00074 bool isMissing(unsigned int i) const
00075 {
00076 return(missingIndices.end() != missingIndices.find(i));
00077 }
00078
00079 private:
00080 set< unsigned int > missingIndices;
00081 };
00082
00083 inline istream& operator>>(istream& istr, MyAffyGene &gene)
00084 {
00085 gene.read(istr);
00086 return istr;
00087 }
00088
00089 inline ostream& operator<<(ostream& ostr, const MyAffyGene& gene)
00090 {
00091 gene.write(ostr);
00092 return ostr;
00093 }
00094
00095
00096 #endif // _GENE_H