Browse code

Updated to Fusion release 1.0.7. This might break stuff...

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@19161 bc3139a8-67e5-0310-9ffc-ced21a209358

Kasper D. Hansen authored on 11/08/2006 22:57:54
Showing 108 changed files

... ...
@@ -21,11 +21,9 @@ PKG_CPPFLAGS=\
21 21
  -Ifusion_sdk/calvin_files/writers/src\
22 22
  -Ifusion_sdk/file\
23 23
  -Ifusion_sdk/portability\
24
- -Ifusion_sdk/gcast/src\
25 24
  -D_USE_MEM_MAPPING_
26 25
 
27 26
 SOURCES.fusion = \
28
-	fusion_sdk/calvin_files/data/src/BitFlag.cpp\
29 27
 	fusion_sdk/calvin_files/data/src/CDFData.cpp\
30 28
 	fusion_sdk/calvin_files/data/src/CDFProbeGroupInformation.cpp\
31 29
 	fusion_sdk/calvin_files/data/src/CDFProbeInformation.cpp\
... ...
@@ -16,11 +16,9 @@ PKG_CPPFLAGS+=\
16 16
  -Ifusion_sdk/calvin_files/writers/src\
17 17
  -Ifusion_sdk/file\
18 18
  -Ifusion_sdk/portability\
19
- -Ifusion_sdk/gcast/src\
20 19
  -D_USE_MEM_MAPPING_
21 20
 
22 21
 SOURCES.fusion = \
23
-	fusion_sdk/calvin_files/data/src/BitFlag.cpp\
24 22
 	fusion_sdk/calvin_files/data/src/CDFData.cpp\
25 23
 	fusion_sdk/calvin_files/data/src/CDFProbeGroupInformation.cpp\
26 24
 	fusion_sdk/calvin_files/data/src/CDFProbeInformation.cpp\
... ...
@@ -145,10 +145,12 @@ extern "C" {
145 145
 
146 146
     char* celFileName = CHAR(STRING_ELT(fname,0));
147 147
     cel.SetFileName(celFileName);
148
-    if (cel.ReadHeader() == false) {
148
+    // if (cel.ReadHeader() == false) {
149
+    if (cel.Exists() == false) {
149 150
       Rprintf("Unable to read file: %s\n", celFileName);
150 151
       return R_NilValue;
151 152
     }
153
+    cel.Read();
152 154
 
153 155
     return R_affx_extract_cel_file_meta(cel);
154 156
   }
155 157
deleted file mode 100644
... ...
@@ -1,60 +0,0 @@
1
-#include "BitFlag.h"
2
-
3
-using namespace affymetrix_calvin_io;
4
-
5
-BitFlag::BitFlag()
6
-{
7
-	Clear();
8
-}
9
-
10
-BitFlag::BitFlag(u_int16_t p)
11
-{
12
-	SetFlags(p);
13
-}
14
-
15
-BitFlag::~BitFlag() {}
16
-
17
-void BitFlag::Clear()
18
-{
19
-	flags.reset();
20
-}
21
-
22
-u_int16_t BitFlag::GetFlags() const
23
-{
24
-	return (u_int16_t)flags.to_ulong();
25
-}
26
-
27
-void BitFlag::SetFlags(u_int16_t p)
28
-{
29
-	for(int i = 0; i < 8; i++)
30
-	{
31
-		if(p & (1 << i))
32
-		{
33
-			SetFlag(i, true);
34
-		}
35
-		else
36
-		{
37
-			SetFlag(i, false);
38
-		}
39
-	}
40
-}
41
-
42
-bool BitFlag::GetFlag(u_int32_t index) const
43
-{
44
-	return flags.test(index);
45
-}
46
-
47
-void BitFlag::SetFlag(u_int32_t index, bool p)
48
-{
49
-	flags.set(index, p);
50
-}
51
-
52
-bool BitFlag::HasDefaultDataSetHdr() const
53
-{
54
-	return GetFlag(DEFAULT_DATA_SET_HDR_FLAG);
55
-}
56
-
57
-void BitFlag::SetDefaultDataSetHdr(bool p)
58
-{
59
-	SetFlag(DEFAULT_DATA_SET_HDR_FLAG, p);
60
-}
61 0
deleted file mode 100644
... ...
@@ -1,84 +0,0 @@
1
-/////////////////////////////////////////////////////////////////
2
-//
3
-// Copyright (C) 2005 Affymetrix, Inc.
4
-//
5
-// This library is free software; you can redistribute it and/or modify
6
-// it under the terms of the GNU Lesser General Public License as published
7
-// by the Free Software Foundation; either version 2.1 of the License,
8
-// or (at your option) any later version.
9
-//
10
-// This library is distributed in the hope that it will be useful, but
11
-// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
-// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
-// for more details.
14
-//
15
-// You should have received a copy of the GNU Lesser General Public License
16
-// along with this library; if not, write to the Free Software Foundation, Inc.,
17
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
18
-//
19
-/////////////////////////////////////////////////////////////////
20
-
21
-#ifndef _BitFlag_HEADER_
22
-#define _BitFlag_HEADER_
23
-
24
-#include "AffymetrixBaseTypes.h"
25
-#include <bitset>
26
-
27
-
28
-#ifdef _MSC_VER
29
-#pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
30
-#endif
31
-
32
-namespace affymetrix_calvin_io
33
-{
34
-
35
-static u_int8_t DEFAULT_DATA_SET_HDR_FLAG = 0;
36
-
37
-class BitFlag
38
-{
39
-private:
40
-
41
-	std::bitset<16> flags;
42
-
43
-public:
44
-
45
-	BitFlag();
46
-
47
-	BitFlag(u_int16_t p);
48
-
49
-	~BitFlag();
50
-
51
-	/*! Clear all flags. */
52
-	void Clear();
53
-
54
-	/*! Get all flags.
55
-	 * @return number with flags set.
56
-	 */
57
-	u_int16_t GetFlags() const;
58
-
59
-	/*! Set all flags.
60
-	 * @param p number with flags set.
61
-	 */
62
-	void SetFlags(u_int16_t p);
63
-
64
-	/*! True if the default data set header flag has been set.
65
-	 * @return true if the default data set header flag has been set.
66
-	 */
67
-	bool HasDefaultDataSetHdr() const;
68
-
69
-	/*! Set the default data set header flag.
70
-	 * @param p true or false.
71
-	 */
72
-	void SetDefaultDataSetHdr(bool p);
73
-
74
-private:
75
-
76
-	bool GetFlag(u_int32_t index) const;
77
-
78
-	void SetFlag(u_int32_t index, bool p);
79
-
80
-};
81
-
82
-}
83
-
84
-#endif // _BitFlag_HEADER_
85 0
similarity index 69%
86 1
rename from src/fusion_sdk/calvin_files/data/src/CHPSignalData.cpp
87 2
rename to src/fusion_sdk/calvin_files/data/src/CHPQuantificationData.cpp
... ...
@@ -18,7 +18,7 @@
18 18
 //
19 19
 /////////////////////////////////////////////////////////////////
20 20
 
21
-#include "CHPSignalData.h"
21
+#include "CHPQuantificationData.h"
22 22
 #include "DataSetHeader.h"
23 23
 #include "StringUtils.h"
24 24
 
... ...
@@ -29,7 +29,7 @@ using namespace affymetrix_calvin_utilities;
29 29
 /*! A prefix for chip summary parameter ids. */
30 30
 static const std::wstring CHIP_SUMMARY_PARAMETER_NAME_PREFIX = L"affymetrix-chipsummary-";
31 31
 
32
-CHPSignalData::CHPSignalData()
32
+CHPQuantificationData::CHPQuantificationData()
33 33
 {
34 34
     maxProbeSetName = -1;
35 35
 	firstColumnType = UnicodeCharColType;
... ...
@@ -37,47 +37,47 @@ CHPSignalData::CHPSignalData()
37 37
 	Clear();
38 38
 }
39 39
 
40
-CHPSignalData::CHPSignalData(const std::string& filename) 
40
+CHPQuantificationData::CHPQuantificationData(const std::string& filename) 
41 41
 { 
42 42
     maxProbeSetName = -1;
43 43
 	firstColumnType = UnicodeCharColType;
44 44
 	entries = NULL;
45 45
 	Clear();
46 46
 	SetFilename(filename);
47
-	DataGroupHeader dcHdr(SIGNAL_SIGNAL_NAME);
47
+	DataGroupHeader dcHdr(QUANTIFICATION_QUANTIFICATION_NAME);
48 48
 	genericData.Header().AddDataGroupHdr(dcHdr);
49
-	genericData.Header().GetGenericDataHdr()->SetFileTypeId(CHP_SIGNAL_TYPE);
49
+	genericData.Header().GetGenericDataHdr()->SetFileTypeId(CHP_QUANTIFICATION_TYPE);
50 50
 }
51 51
 
52
-CHPSignalData::~CHPSignalData() 
52
+CHPQuantificationData::~CHPQuantificationData() 
53 53
 { 
54 54
 	Clear(); 
55 55
 }
56 56
 
57
-void CHPSignalData::Clear()
57
+void CHPQuantificationData::Clear()
58 58
 {
59 59
 	if (entries){ entries->Delete();  entries = 0; }
60 60
 	genericData.Header().Clear();
61 61
 }
62 62
 
63
-void CHPSignalData::SetFilename(const std::string &p)
63
+void CHPQuantificationData::SetFilename(const std::string &p)
64 64
 {
65 65
 	genericData.Header().SetFilename(p);
66 66
 }
67 67
 
68
-std::string CHPSignalData::GetFilename() const
68
+std::string CHPQuantificationData::GetFilename() const
69 69
 {
70 70
 	return ((GenericData&)genericData).Header().GetFilename();
71 71
 }
72 72
 
73
-int32_t CHPSignalData::GetEntryCount()
73
+int32_t CHPQuantificationData::GetEntryCount()
74 74
 {
75 75
 	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
76 76
 	DataSetHeader dpHdr = dcHdr->GetDataSet(0);
77 77
 	return dpHdr.GetRowCnt();
78 78
 }
79 79
 
80
-void CHPSignalData::SetEntryCount(int32_t ln, int32_t maxln)
80
+void CHPQuantificationData::SetEntryCount(int32_t ln, int32_t maxln)
81 81
 {
82 82
     firstColumnType = ASCIICharColType;
83 83
 	maxProbeSetName = maxln;
... ...
@@ -85,12 +85,12 @@ void CHPSignalData::SetEntryCount(int32_t ln, int32_t maxln)
85 85
 	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
86 86
 	DataSetHeader dpHdr;
87 87
 	dpHdr.SetRowCnt(ln);
88
-	dpHdr.SetName(SIGNAL_SIGNAL_NAME);
88
+	dpHdr.SetName(QUANTIFICATION_QUANTIFICATION_NAME);
89 89
 	AddColumns(dpHdr, false);
90 90
 	dcHdr->AddDataSetHdr(dpHdr);
91 91
 }
92 92
 
93
-void CHPSignalData::SetEntryCount(int32_t ln)
93
+void CHPQuantificationData::SetEntryCount(int32_t ln)
94 94
 {
95 95
     firstColumnType = IntColType;
96 96
 	maxProbeSetName = -1;
... ...
@@ -98,14 +98,14 @@ void CHPSignalData::SetEntryCount(int32_t ln)
98 98
 	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
99 99
 	DataSetHeader dpHdr;
100 100
 	dpHdr.SetRowCnt(ln);
101
-	dpHdr.SetName(SIGNAL_SIGNAL_NAME);
101
+	dpHdr.SetName(QUANTIFICATION_QUANTIFICATION_NAME);
102 102
 	AddColumns(dpHdr, true);
103 103
 	dcHdr->AddDataSetHdr(dpHdr);
104 104
 }
105 105
 
106
-void CHPSignalData::GetSignalEntry(int index, affymetrix_calvin_data::ProbeSetSignalData &entry)
106
+void CHPQuantificationData::GetQuantificationEntry(int index, affymetrix_calvin_data::ProbeSetQuantificationData &entry)
107 107
 {
108
-	OpenSignalDataSet();
108
+	OpenQuantificationDataSet();
109 109
 	if (entries && entries->IsOpen())
110 110
 	{
111 111
         entry.id = -1;
... ...
@@ -120,20 +120,20 @@ void CHPSignalData::GetSignalEntry(int index, affymetrix_calvin_data::ProbeSetSi
120 120
 		}
121 121
         else if (firstColumnType == IntColType)
122 122
             entries->GetData(index, 0, entry.id);
123
-		entries->GetData(index, 1, entry.signal);
123
+        entries->GetData(index, 1, entry.quantification);
124 124
 	}
125 125
 }
126 126
 
127
-void CHPSignalData::AddColumns(DataSetHeader& hdr, bool keyIsID)
127
+void CHPQuantificationData::AddColumns(DataSetHeader& hdr, bool keyIsID)
128 128
 {
129 129
     if (keyIsID == false)
130
-        hdr.AddAsciiColumn(SIGNAL_PROBE_SET_NAME, maxProbeSetName);
130
+        hdr.AddAsciiColumn(QUANTIFICATION_PROBE_SET_NAME, maxProbeSetName);
131 131
     else
132
-        hdr.AddIntColumn(SIGNAL_PROBE_SET_ID);
133
-	hdr.AddFloatColumn(SIGNAL_SIGNAL_NAME);
132
+        hdr.AddIntColumn(QUANTIFICATION_PROBE_SET_ID);
133
+	hdr.AddFloatColumn(QUANTIFICATION_QUANTIFICATION_NAME);
134 134
 }
135 135
 
136
-void CHPSignalData::OpenSignalDataSet()
136
+void CHPQuantificationData::OpenQuantificationDataSet()
137 137
 {
138 138
 	if (entries == NULL)
139 139
 	{
... ...
@@ -146,37 +146,37 @@ void CHPSignalData::OpenSignalDataSet()
146 146
 	}
147 147
 }
148 148
 
149
-std::wstring CHPSignalData::GetArrayType()
149
+std::wstring CHPQuantificationData::GetArrayType()
150 150
 {
151 151
 	return GetWStringFromGenericHdr(ARRAY_TYPE_PARAM_NAME);
152 152
 }
153 153
 
154
-void CHPSignalData::SetArrayType(const std::wstring& value)
154
+void CHPQuantificationData::SetArrayType(const std::wstring& value)
155 155
 {
156 156
 	SetWStringToGenericHdr(ARRAY_TYPE_PARAM_NAME, value, ARRAY_TYPE_MAX_LEN);
157 157
 }
158 158
 
159
-std::wstring CHPSignalData::GetAlgName()
159
+std::wstring CHPQuantificationData::GetAlgName()
160 160
 {
161 161
 	return GetWStringFromGenericHdr(ALGORITHM_NAME_PARAM_NAME);
162 162
 }
163 163
 
164
-void CHPSignalData::SetAlgName(const std::wstring& value)
164
+void CHPQuantificationData::SetAlgName(const std::wstring& value)
165 165
 {
166 166
 	SetWStringToGenericHdr(ALGORITHM_NAME_PARAM_NAME, value);
167 167
 }
168 168
 
169
-std::wstring CHPSignalData::GetAlgVersion()
169
+std::wstring CHPQuantificationData::GetAlgVersion()
170 170
 {
171 171
 	return GetWStringFromGenericHdr(ALG_VERSION_PARAM_NAME);
172 172
 }
173 173
 
174
-void CHPSignalData::SetAlgVersion(const std::wstring& value)
174
+void CHPQuantificationData::SetAlgVersion(const std::wstring& value)
175 175
 {
176 176
 	SetWStringToGenericHdr(ALG_VERSION_PARAM_NAME, value);
177 177
 }
178 178
 
179
-ParameterNameValueTypeList CHPSignalData::GetAlgParams()
179
+ParameterNameValueTypeList CHPQuantificationData::GetAlgParams()
180 180
 {
181 181
 	ParameterNameValueTypeList nvt;
182 182
 	ParameterNameValueTypeIt begin, end;
... ...
@@ -198,7 +198,7 @@ ParameterNameValueTypeList CHPSignalData::GetAlgParams()
198 198
 	return nvt;
199 199
 }
200 200
 
201
-void CHPSignalData::AddAlgParams(const ParameterNameValueTypeList& params)
201
+void CHPQuantificationData::AddAlgParams(const ParameterNameValueTypeList& params)
202 202
 {
203 203
 	ParameterNameValueType param;
204 204
 	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
... ...
@@ -210,7 +210,7 @@ void CHPSignalData::AddAlgParams(const ParameterNameValueTypeList& params)
210 210
 	}
211 211
 }
212 212
 
213
-ParameterNameValueTypeList CHPSignalData::GetSummaryParams()
213
+ParameterNameValueTypeList CHPQuantificationData::GetSummaryParams()
214 214
 {
215 215
 	ParameterNameValueTypeList nvt;
216 216
 	ParameterNameValueTypeIt begin, end;
... ...
@@ -232,7 +232,7 @@ ParameterNameValueTypeList CHPSignalData::GetSummaryParams()
232 232
 	return nvt;
233 233
 }
234 234
 
235
-void CHPSignalData::AddSummaryParams(const ParameterNameValueTypeList& params)
235
+void CHPQuantificationData::AddSummaryParams(const ParameterNameValueTypeList& params)
236 236
 {
237 237
 	ParameterNameValueType param;
238 238
 	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
... ...
@@ -244,7 +244,7 @@ void CHPSignalData::AddSummaryParams(const ParameterNameValueTypeList& params)
244 244
 	}
245 245
 }
246 246
 
247
-std::wstring CHPSignalData::GetWStringFromGenericHdr(const std::wstring& name)
247
+std::wstring CHPQuantificationData::GetWStringFromGenericHdr(const std::wstring& name)
248 248
 {
249 249
 	std::wstring result;
250 250
 	ParameterNameValueType paramType;
... ...
@@ -256,7 +256,7 @@ std::wstring CHPSignalData::GetWStringFromGenericHdr(const std::wstring& name)
256 256
 	return result;
257 257
 }
258 258
 
259
-void CHPSignalData::SetWStringToGenericHdr(const std::wstring& name, const std::wstring value, int32_t reserve)
259
+void CHPQuantificationData::SetWStringToGenericHdr(const std::wstring& name, const std::wstring value, int32_t reserve)
260 260
 {
261 261
 	ParameterNameValueType paramType;
262 262
 	paramType.SetName(name);
263 263
similarity index 80%
264 264
rename from src/fusion_sdk/calvin_files/data/src/CHPSignalData.h
265 265
rename to src/fusion_sdk/calvin_files/data/src/CHPQuantificationData.h
... ...
@@ -18,44 +18,44 @@
18 18
 //
19 19
 /////////////////////////////////////////////////////////////////
20 20
 
21
-#ifndef _CHPSignalData_HEADER_
22
-#define _CHPSignalData_HEADER_
21
+#ifndef _CHPQuantificationData_HEADER_
22
+#define _CHPQuantificationData_HEADER_
23 23
 
24 24
 #include <string>
25 25
 #include "FileHeader.h"
26 26
 #include "GenericData.h"
27 27
 #include "AffymetrixBaseTypes.h"
28
-#include "ProbeSetSignalData.h"
28
+#include "ProbeSetQuantificationData.h"
29 29
 
30 30
 namespace affymetrix_calvin_io
31 31
 {
32 32
 
33
-/*! The identifier to identify a signal CHP file. */
34
-#define CHP_SIGNAL_TYPE std::string("affymetrix-signal-analysis")
33
+/*! The identifier to identify a quantification CHP file. */
34
+#define CHP_QUANTIFICATION_TYPE std::string("affymetrix-quantification-analysis")
35 35
 
36
-/*! The group and data set and column name to store the signal data. */
37
-#define SIGNAL_SIGNAL_NAME std::wstring(L"Signal")
36
+/*! The group and data set and column name to store the quantification data. */
37
+#define QUANTIFICATION_QUANTIFICATION_NAME std::wstring(L"Quantification")
38 38
 
39 39
 /*! The column name for the probe set name. */
40
-#define SIGNAL_PROBE_SET_NAME std::wstring(L"ProbeSetName")
40
+#define QUANTIFICATION_PROBE_SET_NAME std::wstring(L"ProbeSetName")
41 41
 
42 42
 /*! The column name for the probe set id. */
43
-#define SIGNAL_PROBE_SET_ID std::wstring(L"ProbeSetId")
43
+#define QUANTIFICATION_PROBE_SET_ID std::wstring(L"ProbeSetId")
44 44
 
45
-/*! Holds data associated with signal array CHP files. */
46
-class CHPSignalData
45
+/*! Holds data associated with quantification CHP files. */
46
+class CHPQuantificationData
47 47
 {
48 48
 public:
49 49
 	/*! Constructor */
50
-	CHPSignalData();
50
+	CHPQuantificationData();
51 51
 
52 52
 	/*! Constructor with file name.
53 53
 	 * @param filename The name of the CHP file.
54 54
 	 */
55
-	CHPSignalData(const std::string& filename);
55
+	CHPQuantificationData(const std::string& filename);
56 56
 
57 57
 	/*! Destructor */
58
-	~CHPSignalData();
58
+	~CHPQuantificationData();
59 59
 
60 60
 private:
61 61
 	/*! Flag indicating if the probe set names were stored in wide character format. */
... ...
@@ -160,12 +160,12 @@ public:
160 160
 
161 161
 	/*! Gets the sequence data.
162 162
 	 * @param index The row index.
163
-	 * @param entry The signal value.
163
+	 * @param entry The quantification value.
164 164
 	 */
165
-	void GetSignalEntry(int index, affymetrix_calvin_data::ProbeSetSignalData &entry);
165
+	void GetQuantificationEntry(int index, affymetrix_calvin_data::ProbeSetQuantificationData &entry);
166 166
 
167 167
 	/*! Opens a group for reading. */
168
-	void OpenSignalDataSet();
168
+	void OpenQuantificationDataSet();
169 169
 
170 170
 private:
171 171
 
172 172
new file mode 100644
... ...
@@ -0,0 +1,269 @@
1
+/////////////////////////////////////////////////////////////////
2
+//
3
+// Copyright (C) 2006 Affymetrix, Inc.
4
+//
5
+// This library is free software; you can redistribute it and/or modify
6
+// it under the terms of the GNU Lesser General Public License as published
7
+// by the Free Software Foundation; either version 2.1 of the License,
8
+// or (at your option) any later version.
9
+//
10
+// This library is distributed in the hope that it will be useful, but
11
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
+// for more details.
14
+//
15
+// You should have received a copy of the GNU Lesser General Public License
16
+// along with this library; if not, write to the Free Software Foundation, Inc.,
17
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
18
+//
19
+/////////////////////////////////////////////////////////////////
20
+
21
+#include "CHPQuantificationDetectionData.h"
22
+#include "DataSetHeader.h"
23
+#include "StringUtils.h"
24
+
25
+using namespace affymetrix_calvin_io;
26
+using namespace affymetrix_calvin_parameter;
27
+using namespace affymetrix_calvin_utilities;
28
+
29
+/*! A prefix for chip summary parameter ids. */
30
+static const std::wstring CHIP_SUMMARY_PARAMETER_NAME_PREFIX = L"affymetrix-chipsummary-";
31
+
32
+CHPQuantificationDetectionData::CHPQuantificationDetectionData()
33
+{
34
+    maxProbeSetName = -1;
35
+	firstColumnType = UnicodeCharColType;
36
+	entries = NULL;
37
+	Clear();
38
+}
39
+
40
+CHPQuantificationDetectionData::CHPQuantificationDetectionData(const std::string& filename) 
41
+{ 
42
+    maxProbeSetName = -1;
43
+	firstColumnType = UnicodeCharColType;
44
+	entries = NULL;
45
+	Clear();
46
+	SetFilename(filename);
47
+	DataGroupHeader dcHdr(QUANTIFICATION_DETECTION_NAME);
48
+	genericData.Header().AddDataGroupHdr(dcHdr);
49
+	genericData.Header().GetGenericDataHdr()->SetFileTypeId(CHP_QUANTIFICATION_DETECTION_TYPE);
50
+}
51
+
52
+CHPQuantificationDetectionData::~CHPQuantificationDetectionData() 
53
+{ 
54
+	Clear(); 
55
+}
56
+
57
+void CHPQuantificationDetectionData::Clear()
58
+{
59
+	if (entries){ entries->Delete();  entries = 0; }
60
+	genericData.Header().Clear();
61
+}
62
+
63
+void CHPQuantificationDetectionData::SetFilename(const std::string &p)
64
+{
65
+	genericData.Header().SetFilename(p);
66
+}
67
+
68
+std::string CHPQuantificationDetectionData::GetFilename() const
69
+{
70
+	return ((GenericData&)genericData).Header().GetFilename();
71
+}
72
+
73
+int32_t CHPQuantificationDetectionData::GetEntryCount()
74
+{
75
+	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
76
+	DataSetHeader dpHdr = dcHdr->GetDataSet(0);
77
+	return dpHdr.GetRowCnt();
78
+}
79
+
80
+void CHPQuantificationDetectionData::SetEntryCount(int32_t ln, int32_t maxln)
81
+{
82
+    firstColumnType = ASCIICharColType;
83
+	maxProbeSetName = maxln;
84
+	ParameterNameValueType param;
85
+	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
86
+	DataSetHeader dpHdr;
87
+	dpHdr.SetRowCnt(ln);
88
+	dpHdr.SetName(QUANTIFICATION_DETECTION_NAME);
89
+	AddColumns(dpHdr, false);
90
+	dcHdr->AddDataSetHdr(dpHdr);
91
+}
92
+
93
+void CHPQuantificationDetectionData::SetEntryCount(int32_t ln)
94
+{
95
+    firstColumnType = IntColType;
96
+	maxProbeSetName = -1;
97
+	ParameterNameValueType param;
98
+	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
99
+	DataSetHeader dpHdr;
100
+	dpHdr.SetRowCnt(ln);
101
+	dpHdr.SetName(QUANTIFICATION_DETECTION_NAME);
102
+	AddColumns(dpHdr, true);
103
+	dcHdr->AddDataSetHdr(dpHdr);
104
+}
105
+
106
+void CHPQuantificationDetectionData::GetQuantificationDetectionEntry(int index, affymetrix_calvin_data::ProbeSetQuantificationDetectionData &entry)
107
+{
108
+	OpenQuantificationDetectionDataSet();
109
+	if (entries && entries->IsOpen())
110
+	{
111
+        entry.id = -1;
112
+        entry.name.clear();
113
+		if (firstColumnType == ASCIICharColType)
114
+			entries->GetData(index, 0, entry.name);
115
+		else if (firstColumnType == UnicodeCharColType)
116
+		{
117
+            std::wstring wprobeSetName;
118
+            entries->GetData(index, 0, wprobeSetName);
119
+            entry.name = StringUtils::ConvertWCSToMBS(wprobeSetName);
120
+		}
121
+        else if (firstColumnType == IntColType)
122
+            entries->GetData(index, 0, entry.id);
123
+        entries->GetData(index, 1, entry.quantification);
124
+        entries->GetData(index, 2, entry.pvalue);
125
+	}
126
+}
127
+
128
+void CHPQuantificationDetectionData::AddColumns(DataSetHeader& hdr, bool keyIsID)
129
+{
130
+    if (keyIsID == false)
131
+        hdr.AddAsciiColumn(QUANTIFICATION_DETECTION_PROBE_SET_NAME, maxProbeSetName);
132
+    else
133
+        hdr.AddIntColumn(QUANTIFICATION_DETECTION_PROBE_SET_ID);
134
+	hdr.AddFloatColumn(QUANTIFICATION_DETECTION_QUANTIFICATION_NAME);
135
+    hdr.AddFloatColumn(QUANTIFICATION_DETECTION_DETECTION_NAME);
136
+}
137
+
138
+void CHPQuantificationDetectionData::OpenQuantificationDetectionDataSet()
139
+{
140
+	if (entries == NULL)
141
+	{
142
+		entries = genericData.DataSet(0, 0);
143
+		if (entries)
144
+		{
145
+			entries->Open();
146
+			firstColumnType = entries->Header().GetColumnInfo(0).GetColumnType();
147
+		}
148
+	}
149
+}
150
+
151
+std::wstring CHPQuantificationDetectionData::GetArrayType()
152
+{
153
+	return GetWStringFromGenericHdr(ARRAY_TYPE_PARAM_NAME);
154
+}
155
+
156
+void CHPQuantificationDetectionData::SetArrayType(const std::wstring& value)
157
+{
158
+	SetWStringToGenericHdr(ARRAY_TYPE_PARAM_NAME, value, ARRAY_TYPE_MAX_LEN);
159
+}
160
+
161
+std::wstring CHPQuantificationDetectionData::GetAlgName()
162
+{
163
+	return GetWStringFromGenericHdr(ALGORITHM_NAME_PARAM_NAME);
164
+}
165
+
166
+void CHPQuantificationDetectionData::SetAlgName(const std::wstring& value)
167
+{
168
+	SetWStringToGenericHdr(ALGORITHM_NAME_PARAM_NAME, value);
169
+}
170
+
171
+std::wstring CHPQuantificationDetectionData::GetAlgVersion()
172
+{
173
+	return GetWStringFromGenericHdr(ALG_VERSION_PARAM_NAME);
174
+}
175
+
176
+void CHPQuantificationDetectionData::SetAlgVersion(const std::wstring& value)
177
+{
178
+	SetWStringToGenericHdr(ALG_VERSION_PARAM_NAME, value);
179
+}
180
+
181
+ParameterNameValueTypeList CHPQuantificationDetectionData::GetAlgParams()
182
+{
183
+	ParameterNameValueTypeList nvt;
184
+	ParameterNameValueTypeIt begin, end;
185
+	ParameterNameValueType param;
186
+
187
+	genericData.Header().GetGenericDataHdr()->GetNameValIterators(begin, end);
188
+	while(begin != end)
189
+	{
190
+		std::wstring key = begin->GetName();
191
+		if(key.compare(0, ALGORITHM_PARAM_NAME_PREFIX_S.size(),ALGORITHM_PARAM_NAME_PREFIX_S) == 0)
192
+		{
193
+			param = *begin;
194
+			key.erase(0, ALGORITHM_PARAM_NAME_PREFIX_S.size());
195
+			param.SetName(key);
196
+			nvt.push_back(param);
197
+		}
198
+		begin++;
199
+	}
200
+	return nvt;
201
+}
202
+
203
+void CHPQuantificationDetectionData::AddAlgParams(const ParameterNameValueTypeList& params)
204
+{
205
+	ParameterNameValueType param;
206
+	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
207
+	for (ParameterNameValueTypeList::const_iterator it=params.begin(); it != params.end(); it++)
208
+	{
209
+		param = *it;
210
+		param.SetName(ALGORITHM_PARAM_NAME_PREFIX_S + param.GetName());
211
+		hdr->AddNameValParam(param);
212
+	}
213
+}
214
+
215
+ParameterNameValueTypeList CHPQuantificationDetectionData::GetSummaryParams()
216
+{
217
+	ParameterNameValueTypeList nvt;
218
+	ParameterNameValueTypeIt begin, end;
219
+	ParameterNameValueType param;
220
+
221
+	genericData.Header().GetGenericDataHdr()->GetNameValIterators(begin, end);
222
+	while(begin != end)
223
+	{
224
+		std::wstring key = begin->GetName();
225
+		if(key.compare(0, CHIP_SUMMARY_PARAMETER_NAME_PREFIX.size(),CHIP_SUMMARY_PARAMETER_NAME_PREFIX) == 0)
226
+		{
227
+			param = *begin;
228
+			key.erase(0, CHIP_SUMMARY_PARAMETER_NAME_PREFIX.size());
229
+			param.SetName(key);
230
+			nvt.push_back(param);
231
+		}
232
+		begin++;
233
+	}
234
+	return nvt;
235
+}
236
+
237
+void CHPQuantificationDetectionData::AddSummaryParams(const ParameterNameValueTypeList& params)
238
+{
239
+	ParameterNameValueType param;
240
+	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
241
+	for (ParameterNameValueTypeList::const_iterator it=params.begin(); it != params.end(); it++)
242
+	{
243
+		param = *it;
244
+		param.SetName(CHIP_SUMMARY_PARAMETER_NAME_PREFIX + param.GetName());
245
+		hdr->AddNameValParam(param);
246
+	}
247
+}
248
+
249
+std::wstring CHPQuantificationDetectionData::GetWStringFromGenericHdr(const std::wstring& name)
250
+{
251
+	std::wstring result;
252
+	ParameterNameValueType paramType;
253
+	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
254
+	if (hdr->FindNameValParam(name, paramType))
255
+	{
256
+		result = paramType.GetValueText();
257
+	}
258
+	return result;
259
+}
260
+
261
+void CHPQuantificationDetectionData::SetWStringToGenericHdr(const std::wstring& name, const std::wstring value, int32_t reserve)
262
+{
263
+	ParameterNameValueType paramType;
264
+	paramType.SetName(name);
265
+	paramType.SetValueText(value, reserve);
266
+	GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
267
+	hdr->AddNameValParam(paramType);
268
+}
269
+
0 270
new file mode 100644
... ...
@@ -0,0 +1,201 @@
1
+/////////////////////////////////////////////////////////////////
2
+//
3
+// Copyright (C) 2006 Affymetrix, Inc.
4
+//
5
+// This library is free software; you can redistribute it and/or modify
6
+// it under the terms of the GNU Lesser General Public License as published
7
+// by the Free Software Foundation; either version 2.1 of the License,
8
+// or (at your option) any later version.
9
+//
10
+// This library is distributed in the hope that it will be useful, but
11
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
+// for more details.
14
+//
15
+// You should have received a copy of the GNU Lesser General Public License
16
+// along with this library; if not, write to the Free Software Foundation, Inc.,
17
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
18
+//
19
+/////////////////////////////////////////////////////////////////
20
+
21
+#ifndef _CHPQuantificationDetectionData_HEADER_
22
+#define _CHPQuantificationDetectionData_HEADER_
23
+
24
+#include <string>
25
+#include "FileHeader.h"
26
+#include "GenericData.h"
27
+#include "AffymetrixBaseTypes.h"
28
+#include "ProbeSetQuantificationDetectionData.h"
29
+
30
+namespace affymetrix_calvin_io
31
+{
32
+
33
+/*! The identifier to identify a quantification/detection CHP file. */
34
+#define CHP_QUANTIFICATION_DETECTION_TYPE std::string("affymetrix-quantification-detection-analysis")
35
+
36
+/*! The group and data set to store the quantification/detection data. */
37
+#define QUANTIFICATION_DETECTION_NAME std::wstring(L"QuantificationDetection")
38
+
39
+/*! The column name for the probe set name. */
40
+#define QUANTIFICATION_DETECTION_PROBE_SET_NAME std::wstring(L"ProbeSetName")
41
+
42
+/*! The column name for the probe set id. */
43
+#define QUANTIFICATION_DETECTION_PROBE_SET_ID std::wstring(L"ProbeSetId")
44
+
45
+/*! The column name for the quantification value. */
46
+#define QUANTIFICATION_DETECTION_QUANTIFICATION_NAME std::wstring(L"Quantification")
47
+
48
+/*! The column name for the detection value. */
49
+#define QUANTIFICATION_DETECTION_DETECTION_NAME std::wstring(L"Detection")
50
+
51
+/*! Holds data associated with quantification/detection CHP files. */
52
+class CHPQuantificationDetectionData
53
+{
54
+public:
55
+	/*! Constructor */
56
+	CHPQuantificationDetectionData();
57
+
58
+	/*! Constructor with file name.
59
+	 * @param filename The name of the CHP file.
60
+	 */
61
+	CHPQuantificationDetectionData(const std::string& filename);
62
+
63
+	/*! Destructor */
64
+	~CHPQuantificationDetectionData();
65
+
66
+private:
67
+	/*! Flag indicating if the probe set names were stored in wide character format. */
68
+    DataSetColumnTypes firstColumnType;
69
+
70
+	/*! The generic data item. */
71
+	GenericData genericData;
72
+
73
+	/*! chp data sets */
74
+	DataSet* entries;
75
+
76
+	/*! The maximum length of a probe set name. */
77
+	int maxProbeSetName;
78
+
79
+public:
80
+
81
+	/*! The maximum length of a probe set name. */
82
+	int GetMaxProbeSetName() const { return maxProbeSetName; }
83
+
84
+	/*! Clears the members. */
85
+	void Clear();
86
+
87
+	/*! Sets the file name.
88
+	 * @param p The name of the CHP file
89
+	 */
90
+	void SetFilename(const std::string &p);
91
+
92
+	/*! Gets the file name.
93
+	 * @return The file name.
94
+	 */
95
+	std::string GetFilename() const;
96
+
97
+	/*! Sets the array type */
98
+	std::wstring GetArrayType();
99
+
100
+	/*! Sets the array type.  */
101
+	void SetArrayType(const std::wstring& value);
102
+	
103
+	/*! Sets the number of entries (probe sets). Use this function if names are to be stored.
104
+	 * @param ln The number of probe sets.
105
+	 * @param maxln The maximum length of a probe set name.
106
+	 */
107
+	void SetEntryCount(int32_t ln, int32_t maxln);
108
+	
109
+	/*! Sets the number of entries (probe sets). Use this function if ids are to be stored.
110
+	 * @param ln The number of probe sets.
111
+	 */
112
+	void SetEntryCount(int32_t ln);
113
+
114
+	/*! Gets the number of entries (probe sets) */
115
+	int32_t GetEntryCount();
116
+
117
+	/*! Gets the name of the algorithm.
118
+	 * @return The algorithm name.
119
+	 */
120
+	std::wstring GetAlgName();
121
+
122
+	/*! Sets the name of the algorithm.
123
+	 * @param value The algorithm name.
124
+	 */
125
+	void SetAlgName(const std::wstring& value);
126
+
127
+	/*! Gets the algorithm version.
128
+	 * @return The version.
129
+	 */
130
+	std::wstring GetAlgVersion();
131
+
132
+	/*! Sets the algorithm version.
133
+	 * @param value The version.
134
+	 */
135
+	void SetAlgVersion(const std::wstring& value);
136
+
137
+	/*! Gets the algorithm parameters
138
+	 * @return The algoirhtm parameters.
139
+	 */
140
+	ParameterNameValueTypeList GetAlgParams();
141
+
142
+	/*! Adds the algorithm parameters.
143
+	 * @param params The algorithm parameters.
144
+	 */
145
+	void AddAlgParams(const ParameterNameValueTypeList& params);
146
+
147
+	/*! Gets the summary parameters
148
+	 * @return The summary parameters.
149
+	 */
150
+	ParameterNameValueTypeList GetSummaryParams();
151
+
152
+	/*! Adds the summary parameters.
153
+	 * @param params The summary parameters.
154
+	 */
155
+	void AddSummaryParams(const ParameterNameValueTypeList& params);
156
+
157
+	/*! Gets the file header.
158
+	 * @return The file header.
159
+	 */
160
+	FileHeader* GetFileHeader() { return &genericData.Header(); }
161
+
162
+	/*! Gets the generic data object.
163
+	 * @return The data object.
164
+	 */
165
+	GenericData& GetGenericData() { return genericData; }
166
+
167
+	/*! Gets the sequence data.
168
+	 * @param index The row index.
169
+	 * @param entry The quantification/detection value.
170
+	 */
171
+	void GetQuantificationDetectionEntry(int index, affymetrix_calvin_data::ProbeSetQuantificationDetectionData &entry);
172
+
173
+	/*! Opens a group for reading. */
174
+	void OpenQuantificationDetectionDataSet();
175
+
176
+private:
177
+
178
+	/*! Gets a parameter value as a string.
179
+	 * @param name The name of the parameter.
180
+	 * @return The string representation.
181
+	 */
182
+	std::wstring GetWStringFromGenericHdr(const std::wstring& name);
183
+
184
+	/*! Adds a parameter name/value pair to the parameters section.
185
+	 * @param name The name of the parameter.
186
+	 * @param value The value of the parameter.
187
+	 * @param reserve The length of the string to reserve.
188
+	 */
189
+	void SetWStringToGenericHdr(const std::wstring& name, const std::wstring value, int32_t reserve=-1);
190
+
191
+	/*! Adds the columns to the data set.
192
+	 * @param hdr The data set header.
193
+	 * @param keyIsID True if the probe set ids are to be stored, false for probe set names.
194
+	 */
195
+	void AddColumns(DataSetHeader& hdr, bool keyIsID);
196
+
197
+};
198
+
199
+}
200
+
201
+#endif
... ...
@@ -1,67 +1,70 @@
1
-/////////////////////////////////////////////////////////////////
2
-//
3
-// Copyright (C) 2005 Affymetrix, Inc.
4
-//
5
-// This library is free software; you can redistribute it and/or modify
6
-// it under the terms of the GNU Lesser General Public License as published
7
-// by the Free Software Foundation; either version 2.1 of the License,
8
-// or (at your option) any later version.
9
-//
10
-// This library is distributed in the hope that it will be useful, but
11
-// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
-// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
-// for more details.
14
-//
15
-// You should have received a copy of the GNU Lesser General Public License
16
-// along with this library; if not, write to the Free Software Foundation, Inc.,
17
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
-//
19
-/////////////////////////////////////////////////////////////////
20
-
21
-#ifndef _DataException_HEADER_
22
-#define _DataException_HEADER_
23
-
24
-/*! \file DataException.h This file provides class definition for the data exceptions.
25
- */
26
-
27
-#include "ExceptionBase.h"
28
-
29
-namespace affymetrix_calvin_exceptions
30
-{
31
-
32
-class DataSetNotOpenException : public CalvinException
33
-{
34
-};
35
-
36
-class ColumnIndexOutOfBoundsException : public CalvinException
37
-{
38
-};
39
-
40
-class RowIndexOutOfBoundsException : public CalvinException
41
-{
42
-};
43
-
44
-class UnexpectedColumnTypeException : public CalvinException
45
-{
46
-};
47
-
48
-class DataGroupNotFoundException : public CalvinException
49
-{
50
-};
51
-
52
-class DataSetNotFoundException : public CalvinException
53
-{
54
-};
55
-
56
-class ProbeSetNotFoundException : public CalvinException
57
-{
58
-};
59
-
60
-class CDFAccessNotSupportedByModeException : public CalvinException
61
-{
62
-};
63
-
64
-
65
-}
66
-
67
-#endif // _DataException_HEADER_
1
+/////////////////////////////////////////////////////////////////
2
+//
3
+// Copyright (C) 2005 Affymetrix, Inc.
4
+//
5
+// This library is free software; you can redistribute it and/or modify
6
+// it under the terms of the GNU Lesser General Public License as published
7
+// by the Free Software Foundation; either version 2.1 of the License,
8
+// or (at your option) any later version.
9
+//
10
+// This library is distributed in the hope that it will be useful, but
11
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
+// for more details.
14
+//
15
+// You should have received a copy of the GNU Lesser General Public License
16
+// along with this library; if not, write to the Free Software Foundation, Inc.,
17
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+//
19
+/////////////////////////////////////////////////////////////////
20
+
21
+#ifndef _DataException_HEADER_
22
+#define _DataException_HEADER_
23
+
24
+/*! \file DataException.h This file provides class definition for the data exceptions.
25
+ */
26
+
27
+#include "ExceptionBase.h"
28
+
29
+namespace affymetrix_calvin_exceptions
30
+{
31
+
32
+class DataSetNotOpenException : public CalvinException
33
+{
34
+};
35
+
36
+class ColumnIndexOutOfBoundsException : public CalvinException
37
+{
38
+};
39
+
40
+class RowIndexOutOfBoundsException : public CalvinException
41
+{
42
+};
43
+
44
+class UnexpectedColumnTypeException : public CalvinException
45
+{
46
+};
47
+
48
+class DataGroupNotFoundException : public CalvinException
49
+{
50
+};
51
+
52
+class DataSetNotFoundException : public CalvinException
53
+{
54
+};
55
+
56
+class ProbeSetNotFoundException : public CalvinException
57
+{
58
+};
59
+
60
+class CDFAccessNotSupportedByModeException : public CalvinException
61
+{
62
+};
63
+
64
+class DataSetRemapException : public CalvinException
65
+{
66
+};
67
+
68
+}
69
+
70
+#endif // _DataException_HEADER_
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 using namespace affymetrix_calvin_io;
25 25
 
26
-#if !defined(_MSC_VER) && !defined(WIN32)
26
+#ifndef _MSC_VER
27 27
 #include <sys/mman.h>
28 28
 #endif
29 29
 
... ...
@@ -28,7 +28,6 @@ using namespace affymetrix_calvin_io;
28 28
 
29 29
 #ifndef _MSC_VER
30 30
 #include <unistd.h>
31
-#ifndef WIN32
32 31
 #include <sys/mman.h>
33 32
 
34 33
 #ifndef PAGE_SIZE
... ...
@@ -44,7 +43,6 @@ using namespace affymetrix_calvin_io;
44 43
 #define PAGE_TRUNC(ptr) (ptr&(PAGE_MASK))
45 44
 #endif
46 45
 #endif
47
-#endif
48 46
 
49 47
 /*
50 48
  * Initialize the object to use memory-mapping to access the file.
... ...
@@ -58,7 +56,7 @@ DataSet::DataSet(const std::string& fileName_, const DataSetHeader& header_, voi
58 56
 	data = 0;
59 57
 	isOpen = false;
60 58
 
61
-#if defined(_MSC_VER) || defined(WIN32)
59
+#ifdef _MSC_VER
62 60
 	fileMapHandle = handle;
63 61
 #else
64 62
 	fp = 0;
... ...
@@ -82,7 +80,7 @@ DataSet::DataSet(const std::string& fileName_, const affymetrix_calvin_io::DataS
82 80
 	data = 0;
83 81
 	isOpen = false;
84 82
 
85
-#if defined(_MSC_VER) || defined(WIN32)
83
+#ifdef _MSC_VER
86 84
 	fileMapHandle = 0;
87 85
 #else
88 86
 	fp = 0;
... ...
@@ -134,7 +132,7 @@ bool DataSet::Open()
134 132
  */
135 133
 bool DataSet::OpenMM()
136 134
 {
137
-#if defined(_MSC_VER) || defined(WIN32)
135
+#ifdef _MSC_VER
138 136
 	if (MapDataWin32(header.GetDataStartFilePos(), header.GetDataSize()) == false)
139 137
 		return false;
140 138
 #else
... ...
@@ -179,7 +177,7 @@ void DataSet::Close()
179 177
 		ClearStreamData();
180 178
 }
181 179
 
182
-#if defined(_MSC_VER) || defined(WIN32)
180
+#ifdef _MSC_VER
183 181
 
184 182
 std::string GetErrorMsg()
185 183
 {
... ...
@@ -291,7 +289,7 @@ bool DataSet::MapDataPosix(u_int32_t start, u_int32_t bytes)
291 289
  */
292 290
 void DataSet::UnmapFile()
293 291
 {
294
-#if defined(_MSC_VER) || defined(WIN32)
292
+#ifdef _MSC_VER
295 293
 
296 294
 	// Unmap the view
297 295
 	if (mappedData != 0 )
... ...
@@ -385,7 +383,7 @@ char* DataSet::FilePosition(int32_t rowStart, int32_t col, int32_t rowCount)
385 383
 	// Byte offset in data set + byte offset of data set in file
386 384
 	u_int32_t startByte = BytesPerRow()*rowStart + columnByteOffsets[col] + header.GetDataStartFilePos();
387 385
 
388
-#if defined(_MSC_VER) || defined(WIN32)
386
+#ifdef _MSC_VER
389 387
 
390 388
 	if (useMemoryMapping)
391 389
 	{
... ...
@@ -405,11 +403,20 @@ char* DataSet::FilePosition(int32_t rowStart, int32_t col, int32_t rowCount)
405 403
 				if (reverseStartByte < header.GetDataStartFilePos())
406 404
 					reverseStartByte = header.GetDataStartFilePos();
407 405
 
408
-				MapDataWin32(reverseStartByte, header.GetDataSize() - reverseStartByte);
409
-
406
+				if (MapDataWin32(reverseStartByte, header.GetDataStartFilePos() + header.GetDataSize() - reverseStartByte) == false)
407
+				{
408
+					affymetrix_calvin_exceptions::DataSetRemapException e;
409
+					throw e;
410
+				}
410 411
 			}
411 412
 			else	// forward
412
-				MapDataWin32(startByte, header.GetDataSize() - startByte);
413
+			{
414
+				if (MapDataWin32(startByte, header.GetDataStartFilePos() + header.GetDataSize() - startByte) == false)
415
+				{
416
+					affymetrix_calvin_exceptions::DataSetRemapException e;
417
+					throw e;
418
+				}
419
+			}
413 420
 		}
414 421
 	}
415 422
 #endif
... ...
@@ -28,7 +28,7 @@
28 28
 #include <string>
29 29
 #include <fstream>
30 30
 
31
-#if defined(_MSC_VER) || defined(WIN32)
31
+#ifdef _MSC_VER
32 32
 #include <windows.h>
33 33
 #endif
34 34
 
... ...
@@ -215,6 +215,7 @@ protected:
215 215
 	 *	@param rowCount The number of rows to ensure are mapped starting at rowStart
216 216
 	 *	@return Pointer to the data element at rowStart
217 217
 	 *	@exception affymetrix_calvin_exceptions::DataSetNotOpenException The file is not open.
218
+	 *	@exception affymetrix_calvin_exceptions::DataSetRemapException There was an error during a remap.
218 219
 	 */
219 220
 	char* FilePosition(int32_t rowStart, int32_t col, int32_t rowCount=1);
220 221
 
... ...
@@ -247,7 +248,7 @@ protected:
247 248
 	template<typename T> void ClearAndSizeVector(std::vector<T>& values, u_int32_t size);
248 249
 
249 250
 	/*! Platform specific memory-mapping method */
250
-#if defined(_MSC_VER) || defined(WIN32)
251
+#ifdef _MSC_VER
251 252
 
252 253
 	bool MapDataWin32(u_int32_t start, u_int32_t bytes);
253 254
 
... ...
@@ -275,7 +276,7 @@ protected:
275 276
 	 */
276 277
 	Int32Vector columnByteOffsets;
277 278
 
278
-#if defined(_MSC_VER) || defined(WIN32)
279
+#ifdef _MSC_VER
279 280
 
280 281
 	/*! Handle returned by CreateFileMapping */
281 282
 	HANDLE fileMapHandle;
... ...
@@ -30,7 +30,6 @@
30 30
 #include "GenericDataHeader.h"
31 31
 #include "AffyStlCollectionTypes.h"
32 32
 #include "ColumnInfo.h"
33
-#include "BitFlag.h"
34 33
 
35 34
 #ifdef _MSC_VER
36 35
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
... ...
@@ -131,7 +130,7 @@ public:
131 130
 	void SetHeaderStartFilePos(u_int32_t pos) { headerStartFilePos = pos; }
132 131
 	/*! Get the file position of the start of the DataSet header. */
133 132
 	u_int32_t GetHeaderStartFilePos() const { return headerStartFilePos; }
134
-	/*! 
133
+
135 134
 	/*! Set the file position of the start of the DataSet data.
136 135
 	*  The value set here is not written to the file.
137 136
 	*/
... ...
@@ -33,7 +33,7 @@ using namespace affymetrix_calvin_io;
33 33
  */
34 34
 GenericData::GenericData()
35 35
 {
36
-#if defined(_MSC_VER) || defined(WIN32)
36
+#ifdef _MSC_VER
37 37
 	fileMapHandle = NULL;
38 38
 	fileHandle = INVALID_HANDLE_VALUE;
39 39
 #endif
... ...
@@ -262,7 +262,7 @@ DataSet* GenericData::DataSet(const std::wstring& dataGroupName, const std::wstr
262 262
 DataSet* GenericData::CreateDataSet(DataSetHeader* dsh)
263 263
 {
264 264
 	void* handle = 0;
265
-#if defined(_MSC_VER) || defined(WIN32)
265
+#ifdef _MSC_VER
266 266
 	handle = fileMapHandle;
267 267
 #endif
268 268
 	ReadFullDataSetHeader(dsh);
... ...
@@ -310,7 +310,7 @@ affymetrix_calvin_io::DataGroup GenericData::DataGroup(u_int32_t dataGroupFilePo
310 310
 		fs.close();
311 311
 
312 312
 	void* handle = 0;
313
-#if defined(_MSC_VER) || defined(WIN32)
313
+#ifdef _MSC_VER
314 314
 	handle = fileMapHandle;
315 315
 #endif
316 316
 
... ...
@@ -423,7 +423,7 @@ bool GenericData::IsDSHPartiallyRead(const DataSetHeader* dph)
423 423
 {
424 424
 	if (dph == 0)
425 425
 		return false;
426
-	if (dph->GetRowCnt() == 0 && dph->GetColumnCnt() == 0)
426
+	if (dph->GetRowCnt() == 0 && dph->GetColumnCnt() == 0 && dph->GetNameValParamCnt() == 0)
427 427
 		return true;
428 428
 	return false;
429 429
 }
... ...
@@ -465,7 +465,7 @@ void GenericData::Close()
465 465
  */
466 466
 bool GenericData::MapFile()
467 467
 {
468
-#if defined(_MSC_VER) || defined(WIN32)	// On Windows the map is open in the GenericData object, otherwise it is opened in the DataSet
468
+#ifdef _MSC_VER	// On Windows the map is open in the GenericData object, otherwise it is opened in the DataSet
469 469
 	if (fileHandle == INVALID_HANDLE_VALUE)
470 470
 	{
471 471
 		// Create the file.
... ...
@@ -494,7 +494,7 @@ bool GenericData::MapFile()
494 494
  */
495 495
 void GenericData::UnmapFile()
496 496
 {
497
-#if defined(_MSC_VER) || defined(WIN32)
497
+#ifdef _MSC_VER
498 498
 
499 499
 	if (fileHandle != INVALID_HANDLE_VALUE)
500 500
 	{
... ...
@@ -231,7 +231,7 @@ protected:
231 231
 	/*! The header and generic header objects */
232 232
 	affymetrix_calvin_io::FileHeader header;
233 233
 
234
-#if defined(_MSC_VER) || defined(WIN32)
234
+#ifdef _MSC_VER
235 235
 	/*! Handle returned by CreateFileMapping */
236 236
 	HANDLE fileMapHandle;
237 237
 
238 238
similarity index 72%
239 239
rename from src/fusion_sdk/calvin_files/data/src/ProbeSetSignalData.h
240 240
rename to src/fusion_sdk/calvin_files/data/src/ProbeSetQuantificationData.h
... ...
@@ -18,10 +18,10 @@
18 18
 //
19 19
 /////////////////////////////////////////////////////////////////
20 20
 
21
-#ifndef _ProbeSetSignalData_HEADER_
22
-#define _ProbeSetSignalData_HEADER_
21
+#ifndef _ProbeSetQuantificationData_HEADER_
22
+#define _ProbeSetQuantificationData_HEADER_
23 23
 
24
-/*! \file ProbeSetSignalData.h This file provides types to hold signal results.
24
+/*! \file ProbeSetQuantificationData.h This file provides types to hold quantification results.
25 25
  */
26 26
 
27 27
 #include <string>
... ...
@@ -30,8 +30,8 @@
30 30
 namespace affymetrix_calvin_data
31 31
 {
32 32
 
33
-/*! Stores data for a signal of a probe set. */
34
-typedef struct _ProbeSetSignalData
33
+/*! Stores data for a quantification of a probe set. */
34
+typedef struct _ProbeSetQuantificationData
35 35
 {
36 36
 	/*! The name of the probe set. */
37 37
 	std::string name;
... ...
@@ -39,10 +39,10 @@ typedef struct _ProbeSetSignalData
39 39
     /*! The probe set id. */
40 40
     int32_t id;
41 41
 
42
-	/*! The signal associated to the name. */
43
-	float signal;
42
+	/*! The quantification associated to the name. */
43
+	float quantification;
44 44
 
45
-} ProbeSetSignalData;
45
+} ProbeSetQuantificationData;
46 46
 
47 47
 }
48 48
 
49 49
new file mode 100644
... ...
@@ -0,0 +1,53 @@
1
+/////////////////////////////////////////////////////////////////
2
+//
3
+// Copyright (C) 2006 Affymetrix, Inc.
4
+//
5
+// This library is free software; you can redistribute it and/or modify
6
+// it under the terms of the GNU Lesser General Public License as published
7
+// by the Free Software Foundation; either version 2.1 of the License,
8
+// or (at your option) any later version.
9
+//
10
+// This library is distributed in the hope that it will be useful, but
11
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13
+// for more details.
14
+//
15
+// You should have received a copy of the GNU Lesser General Public License
16
+// along with this library; if not, write to the Free Software Foundation, Inc.,
17
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
18
+//
19
+/////////////////////////////////////////////////////////////////
20
+
21
+#ifndef _ProbeSetQuantificationDetectionData_HEADER_
22
+#define _ProbeSetQuantificationDetectionData_HEADER_
23
+
24
+/*! \file ProbeSetQuantificationDetectionData.h This file provides types to hold quantification and detection results.
25
+ */