Browse code

Updated to Fusion v106. Alsa a small change to the bpmap parser.

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

Kasper D. Hansen authored on 01/06/2006 00:33:01
Showing 143 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 #!/bin/bash
2
-cd cvs_head/affy/sdk
2
+cd sdk
3 3
 rm -R TestDataFiles file_formats interface_docs java \
4 4
  libraries_and_tools parser_examples sample_data *.html *.gif \
5 5
  portability/CPPTest file/CPPTest calvin_files/makefile.g5 \
... ...
@@ -8,11 +8,11 @@ rm -R TestDataFiles file_formats interface_docs java \
8 8
  calvin_files/data/test calvin_files/data/data\
9 9
  calvin_files/exception/test\
10 10
  calvin_files/fusion/test calvin_files/fusion/data\
11
- calvin_files/fusion/com calvin_files/fusion/swig-java\
11
+ calvin_files/fusion/com\
12 12
  calvin_files/fusion/swig-cs calvin_files/fusion/swig-perl\
13 13
  calvin_files/parameter/test\
14 14
  calvin_files/parsers/test calvin_files/parsers/data\
15 15
  calvin_files/portability/test\
16 16
  calvin_files/utils/test calvin_files/utils/data\
17
- calvin_files/writers/test
17
+ calvin_files/writers/test calvin_files/writers/data
18 18
 cd -
... ...
@@ -40,13 +40,22 @@ extern "C" {
40 40
          *
41 41
          * We also read the object.
42 42
          * - - - - - - - - - - - - - - - - - - - - - - - - - - - */
43
-        SEXP returnList, returnListNames;
43
+        SEXP returnList, returnListNames, tmp;
44
+        int kk =0;
45
+
44 46
         PROTECT(returnList = NEW_LIST(2));
45
-        SET_VECTOR_ELT(returnList, 0, ScalarReal(bpmap.GetVersion()));
46
-        SET_VECTOR_ELT(returnList, 1, ScalarInteger(bpmap.GetNumberSequences()));
47 47
         PROTECT(returnListNames = NEW_CHARACTER(2));
48
-        SET_STRING_ELT(returnListNames, 0, mkChar("version"));
49
-        SET_STRING_ELT(returnListNames, 1, mkChar("numSequences"));
48
+
49
+        SET_STRING_ELT(returnListNames, kk, mkChar("version"));
50
+        tmp = NEW_NUMERIC(1);
51
+        SET_VECTOR_ELT(returnList, kk++, tmp);
52
+        REAL(tmp)[0] = bpmap.GetVersion();
53
+
54
+        SET_STRING_ELT(returnListNames, kk, mkChar("numSequences"));
55
+        tmp = NEW_INTEGER(1);
56
+        SET_VECTOR_ELT(returnList, kk++, tmp);
57
+        INTEGER(tmp)[0] = bpmap.GetNumberSequences();
58
+
50 59
         setAttrib(returnList, R_NamesSymbol, returnListNames);
51 60
         bpmap.Close();
52 61
         UNPROTECT(2);
... ...
@@ -66,35 +75,55 @@ extern "C" {
66 75
                 if (i_verboseFlag >= R_AFFX_REALLY_VERBOSE) {
67 76
                     Rprintf("  Reading seqInfo\n");
68 77
                 }
69
-                SEXP seqInfo, seqInfoNames, 
78
+                SEXP seqInfo, seqInfoNames, tmp, 
70 79
                     seqInfoParameters, seqInfoParameterNames;
80
+                int kk = 0;
81
+
71 82
                 PROTECT(seqInfo = NEW_LIST(8));
72 83
                 PROTECT(seqInfoNames = NEW_CHARACTER(8));
73
-                SET_VECTOR_ELT(seqInfo, 0, 
74
-                               ScalarString(mkChar(seq.GetName().c_str())));
75
-                SET_STRING_ELT(seqInfoNames, 0, mkChar("name"));
76
-                SET_VECTOR_ELT(seqInfo, 1, 
77
-                               ScalarString(mkChar(seq.GroupName().c_str())));
78
-                SET_STRING_ELT(seqInfoNames, 1, mkChar("groupname"));
79
-                SET_VECTOR_ELT(seqInfo, 2, 
80
-                               ScalarString(mkChar(seq.FullName().c_str())));
81
-                SET_STRING_ELT(seqInfoNames, 2, mkChar("fullname"));
82
-                SET_VECTOR_ELT(seqInfo, 3, 
83
-                               ScalarString(mkChar(seq.GetSeqVersion().c_str())));
84
-                SET_STRING_ELT(seqInfoNames, 3, mkChar("version"));
84
+
85
+                SEXP tmp1;
86
+                PROTECT(tmp1 = 1);
87
+                UNPROTECT(1);
88
+
89
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("name"));
90
+                tmp = NEW_CHARACTER(1);
91
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
92
+                SET_STRING_ELT(tmp, 0, mkChar(seq.GetName().c_str()));
93
+
94
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("groupname"));
95
+                tmp = NEW_CHARACTER(1);
96
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
97
+                SET_STRING_ELT(tmp, 0, mkChar(seq.GroupName().c_str()));
98
+
99
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("fullname"));
100
+                tmp = NEW_CHARACTER(1);
101
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
102
+                SET_STRING_ELT(tmp, 0, mkChar(seq.FullName().c_str()));
103
+
104
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("version"));
105
+                tmp = NEW_CHARACTER(1);
106
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
107
+                SET_STRING_ELT(tmp, 0, mkChar(seq.GetSeqVersion().c_str()));
108
+                
109
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("mapping"));
110
+                tmp = NEW_CHARACTER(1);
111
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
85 112
                 if(seq.GetProbeMapping() == 0)
86
-                    SET_VECTOR_ELT(seqInfo, 4, 
87
-                                   ScalarString(mkChar("pmmm")));
113
+                    SET_STRING_ELT(tmp, 0, mkChar("pmmm"));
88 114
                 else
89
-                    SET_VECTOR_ELT(seqInfo, 4, 
90
-                                   ScalarString(mkChar("onlypm")));
91
-                SET_STRING_ELT(seqInfoNames, 4, mkChar("mapping"));
92
-                SET_VECTOR_ELT(seqInfo, 5,
93
-                               ScalarInteger(seq.GetNumber() + 1));
94
-                SET_STRING_ELT(seqInfoNames, 5, mkChar("number"));
95
-                SET_VECTOR_ELT(seqInfo, 6,
96
-                               ScalarInteger(seq.GetNumberHits()));
97
-                SET_STRING_ELT(seqInfoNames, 6, mkChar("numberOfHits"));
115
+                    SET_VECTOR_ELT(tmp, 0, mkChar("onlypm"));
116
+
117
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("number"));
118
+                tmp = NEW_INTEGER(1);
119
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
120
+                INTEGER(tmp)[0] = seq.GetNumber() + 1;
121
+
122
+                SET_STRING_ELT(seqInfoNames, kk, mkChar("numberOfHits"));
123
+                tmp = NEW_INTEGER(1);
124
+                SET_VECTOR_ELT(seqInfo, kk++, tmp);
125
+                INTEGER(tmp)[0] = seq.GetNumberHits();
126
+
98 127
                 /* Now we read the parameters, which is basically
99 128
                  * a long character vector of different parameter
100 129
                  * values */
... ...
@@ -25,7 +25,7 @@
25 25
 #include <bitset>
26 26
 
27 27
 
28
-#ifdef WIN32
28
+#ifdef _MSC_VER
29 29
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
30 30
 #endif
31 31
 
... ...
@@ -32,7 +32,7 @@
32 32
 #include "AffymetrixParameterConsts.h"
33 33
 #include <map>
34 34
 
35
-#ifdef WIN32
35
+#ifdef _MSC_VER
36 36
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
37 37
 #endif
38 38
 
... ...
@@ -24,7 +24,7 @@
24 24
 /*! \file CDFProbeGroupInformation.h This file defines the CDFProbeGroupInformation class.
25 25
  */
26 26
 
27
-#ifdef WIN32
27
+#ifdef _MSC_VER
28 28
 #include <windows.h>
29 29
 #endif
30 30
 
... ...
@@ -27,7 +27,7 @@
27 27
 #include "DataSet.h"
28 28
 #include "AffymetrixBaseTypes.h"
29 29
 
30
-#ifdef WIN32
30
+#ifdef _MSC_VER
31 31
 #include <windows.h>
32 32
 #endif
33 33
 
... ...
@@ -28,7 +28,7 @@
28 28
 #include "CDFDataTypes.h"
29 29
 #include "AffymetrixBaseTypes.h"
30 30
 
31
-#ifdef WIN32
31
+#ifdef _MSC_VER
32 32
 #include <windows.h>
33 33
 #endif
34 34
 
... ...
@@ -24,7 +24,7 @@
24 24
 /*! \file CDFQCProbeSetInformation.h This file defines the CDFQCProbeSetInformation class.
25 25
  */
26 26
 
27
-#ifdef WIN32
27
+#ifdef _MSC_VER
28 28
 #include <windows.h>
29 29
 #endif
30 30
 
... ...
@@ -592,6 +592,38 @@ std::wstring CelFileData::GetArrayType()
592 592
 	return GetWStringFromGenericHdr(ARRAY_TYPE_PARAM_NAME);
593 593
 }
594 594
 
595
+/*
596
+ * Set the master file
597
+ */
598
+void CelFileData::SetMasterFileName(const std::wstring& value)
599
+{
600
+	SetWStringToGenericHdr(MASTER_FILE_PARAM_NAME, value);
601
+}
602
+
603
+/*
604
+ * Get the master file
605
+ */
606
+std::wstring CelFileData::GetMasterFileName()
607
+{
608
+    return GetWStringFromGenericHdr(MASTER_FILE_PARAM_NAME);
609
+}
610
+
611
+/* 
612
+ * Set the library package
613
+ */
614
+void CelFileData::SetLibraryPackageName(const std::wstring& value)
615
+{
616
+	SetWStringToGenericHdr(LIBRARY_PACKAGE_PARAM_NAME, value);
617
+}
618
+
619
+/*
620
+ * Get the library package
621
+ */
622
+std::wstring CelFileData::GetLibraryPackageName()
623
+{
624
+    return GetWStringFromGenericHdr(LIBRARY_PACKAGE_PARAM_NAME);
625
+}
626
+
595 627
 /*
596 628
  * Set name of the algorithm used to generate the results.
597 629
  */
... ...
@@ -608,6 +640,22 @@ std::wstring CelFileData::GetAlgorithmName()
608 640
 	return GetWStringFromGenericHdr(ALGORITHM_NAME_PARAM_NAME);
609 641
 }
610 642
 
643
+/*
644
+ * Set name of the algorithm used to generate the results.
645
+ */
646
+void CelFileData::SetAlgorithmVersion(const std::wstring& value)
647
+{
648
+	SetWStringToGenericHdr(ALG_VERSION_PARAM_NAME, value);
649
+}
650
+
651
+/*
652
+ * Get the name of the algorithm used to generate the results.
653
+ */
654
+std::wstring CelFileData::GetAlgorithmVersion()
655
+{
656
+	return GetWStringFromGenericHdr(ALG_VERSION_PARAM_NAME);
657
+}
658
+
611 659
 /*
612 660
  * Set the number of rows of cells
613 661
  */
... ...
@@ -30,7 +30,7 @@
30 30
 #include "Coords.h"
31 31
 #include <set>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
... ...
@@ -149,6 +149,26 @@ public:
149 149
 	 */
150 150
 	std::wstring GetArrayType();
151 151
 
152
+	/*! Set the master file
153
+	 *	@param value master file name
154
+	 */
155
+	void SetMasterFileName(const std::wstring& value);
156
+
157
+	/*! Get the master file
158
+	 *	@return master file name
159
+	 */
160
+	std::wstring GetMasterFileName();
161
+    
162
+	/*! Set the library package
163
+	 *	@param value library package name
164
+	 */
165
+	void SetLibraryPackageName(const std::wstring& value);
166
+
167
+	/*! Get the library package
168
+	 *	@return library package name
169
+	 */
170
+	std::wstring GetLibraryPackageName();
171
+
152 172
 	/*! Set name of the algorithm used to generate the results.
153 173
 	 *	@param value algorithm name
154 174
 	 */
... ...
@@ -158,6 +178,14 @@ public:
158 178
 	 *	@return Algorithm name
159 179
 	 */
160 180
 	std::wstring GetAlgorithmName();
181
+	/*! Set version of the algorithm used to generate the results.
182
+	 *	@param value algorithm name
183
+	 */
184
+	void SetAlgorithmVersion(const std::wstring& value);
185
+	/*
186
+	 * Get the version of the algorithm used to generate the results.
187
+	 */
188
+	std::wstring CelFileData::GetAlgorithmVersion();
161 189
 
162 190
 	/*! Set the number of rows of cells on the array.
163 191
 	 *	@param value Number of rows of cells.
... ...
@@ -26,7 +26,7 @@
26 26
 #include "Coords.h"
27 27
 #include "AffymetrixBaseTypes.h"
28 28
 
29
-#ifdef WIN32
29
+#ifdef _MSC_VER
30 30
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
31 31
 #endif
32 32
 
... ...
@@ -24,7 +24,7 @@
24 24
 #include <vector>
25 25
 #include "AffymetrixBaseTypes.h"
26 26
 
27
-#ifdef WIN32
27
+#ifdef _MSC_VER
28 28
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
29 29
 #endif
30 30
 
... ...
@@ -31,14 +31,16 @@ static const std::wstring CHIP_SUMMARY_PARAMETER_NAME_PREFIX = L"affymetrix-chip
31 31
 
32 32
 CHPSignalData::CHPSignalData()
33 33
 {
34
-	wideProbeSetNames = false;
34
+    maxProbeSetName = -1;
35
+	firstColumnType = UnicodeCharColType;
35 36
 	entries = NULL;
36 37
 	Clear();
37 38
 }
38 39
 
39 40
 CHPSignalData::CHPSignalData(const std::string& filename) 
40 41
 { 
41
-	wideProbeSetNames = false;
42
+    maxProbeSetName = -1;
43
+	firstColumnType = UnicodeCharColType;
42 44
 	entries = NULL;
43 45
 	Clear();
44 46
 	SetFilename(filename);
... ...
@@ -77,13 +79,27 @@ int32_t CHPSignalData::GetEntryCount()
77 79
 
78 80
 void CHPSignalData::SetEntryCount(int32_t ln, int32_t maxln)
79 81
 {
82
+    firstColumnType = ASCIICharColType;
80 83
 	maxProbeSetName = maxln;
81 84
 	ParameterNameValueType param;
82 85
 	DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0);
83 86
 	DataSetHeader dpHdr;
84 87
 	dpHdr.SetRowCnt(ln);
85 88
 	dpHdr.SetName(SIGNAL_SIGNAL_NAME);
86
-	AddColumns(dpHdr);
89
+	AddColumns(dpHdr, false);
90
+	dcHdr->AddDataSetHdr(dpHdr);
91
+}
92
+
93
+void CHPSignalData::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(SIGNAL_SIGNAL_NAME);
102
+	AddColumns(dpHdr, true);
87 103
 	dcHdr->AddDataSetHdr(dpHdr);
88 104
 }
89 105
 
... ...
@@ -92,21 +108,28 @@ void CHPSignalData::GetSignalEntry(int index, affymetrix_calvin_data::ProbeSetSi
92 108
 	OpenSignalDataSet();
93 109
 	if (entries && entries->IsOpen())
94 110
 	{
95
-		if (wideProbeSetNames == false)
111
+        entry.id = -1;
112
+        entry.name.clear();
113
+		if (firstColumnType == ASCIICharColType)
96 114
 			entries->GetData(index, 0, entry.name);
97
-		else
115
+		else if (firstColumnType == UnicodeCharColType)
98 116
 		{
99
-			std::wstring wprobeSetName;
100
-			entries->GetData(index, 0, wprobeSetName);
101
-			 entry.name = StringUtils::ConvertWCSToMBS(wprobeSetName);
117
+            std::wstring wprobeSetName;
118
+            entries->GetData(index, 0, wprobeSetName);
119
+            entry.name = StringUtils::ConvertWCSToMBS(wprobeSetName);
102 120
 		}
121
+        else if (firstColumnType == IntColType)
122
+            entries->GetData(index, 0, entry.id);
103 123
 		entries->GetData(index, 1, entry.signal);
104 124
 	}
105 125
 }
106 126
 
107
-void CHPSignalData::AddColumns(DataSetHeader& hdr)
127
+void CHPSignalData::AddColumns(DataSetHeader& hdr, bool keyIsID)
108 128
 {
109
-	hdr.AddAsciiColumn(SIGNAL_PROBE_SET_NAME, maxProbeSetName);
129
+    if (keyIsID == false)
130
+        hdr.AddAsciiColumn(SIGNAL_PROBE_SET_NAME, maxProbeSetName);
131
+    else
132
+        hdr.AddIntColumn(SIGNAL_PROBE_SET_ID);
110 133
 	hdr.AddFloatColumn(SIGNAL_SIGNAL_NAME);
111 134
 }
112 135
 
... ...
@@ -118,7 +141,7 @@ void CHPSignalData::OpenSignalDataSet()
118 141
 		if (entries)
119 142
 		{
120 143
 			entries->Open();
121
-			wideProbeSetNames = (entries->Header().GetColumnInfo(0).GetColumnType() == UnicodeCharColType);
144
+			firstColumnType = entries->Header().GetColumnInfo(0).GetColumnType();
122 145
 		}
123 146
 	}
124 147
 }
... ...
@@ -39,6 +39,9 @@ namespace affymetrix_calvin_io
39 39
 /*! The column name for the probe set name. */
40 40
 #define SIGNAL_PROBE_SET_NAME std::wstring(L"ProbeSetName")
41 41
 
42
+/*! The column name for the probe set id. */
43
+#define SIGNAL_PROBE_SET_ID std::wstring(L"ProbeSetId")
44
+
42 45
 /*! Holds data associated with signal array CHP files. */
43 46
 class CHPSignalData
44 47
 {
... ...
@@ -56,7 +59,7 @@ public:
56 59
 
57 60
 private:
58 61
 	/*! Flag indicating if the probe set names were stored in wide character format. */
59
-	bool wideProbeSetNames;
62
+    DataSetColumnTypes firstColumnType;
60 63
 
61 64
 	/*! The generic data item. */
62 65
 	GenericData genericData;
... ...
@@ -91,11 +94,16 @@ public:
91 94
 	/*! Sets the array type.  */
92 95
 	void SetArrayType(const std::wstring& value);
93 96
 	
94
-	/*! Sets the number of entries (probe sets)
97
+	/*! Sets the number of entries (probe sets). Use this function if names are to be stored.
95 98
 	 * @param ln The number of probe sets.
96 99
 	 * @param maxln The maximum length of a probe set name.
97 100
 	 */
98 101
 	void SetEntryCount(int32_t ln, int32_t maxln);
102
+	
103
+	/*! Sets the number of entries (probe sets). Use this function if ids are to be stored.
104
+	 * @param ln The number of probe sets.
105
+	 */
106
+	void SetEntryCount(int32_t ln);
99 107
 
100 108
 	/*! Gets the number of entries (probe sets) */
101 109
 	int32_t GetEntryCount();
... ...
@@ -176,9 +184,9 @@ private:
176 184
 
177 185
 	/*! Adds the columns to the data set.
178 186
 	 * @param hdr The data set header.
179
-	 * @param maxProbeSetName The max probe set name length.
187
+	 * @param keyIsID True if the probe set ids are to be stored, false for probe set names.
180 188
 	 */
181
-	void AddColumns(DataSetHeader& hdr);
189
+	void AddColumns(DataSetHeader& hdr, bool keyIsID);
182 190
 
183 191
 };
184 192
 
... ...
@@ -24,7 +24,7 @@
24 24
 #include <vector>
25 25
 #include "AffymetrixBaseTypes.h"
26 26
 
27
-#ifdef WIN32
27
+#ifdef _MSC_VER
28 28
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
29 29
 #endif
30 30
 
... ...
@@ -25,7 +25,7 @@
25 25
  */
26 26
 
27 27
 
28
-#ifdef WIN32
28
+#ifdef _MSC_VER
29 29
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
30 30
 #endif
31 31
 
... ...
@@ -29,7 +29,7 @@
29 29
 #include "Coords.h"
30 30
 #include "AffymetrixBaseTypes.h"
31 31
 
32
-#ifdef WIN32
32
+#ifdef _MSC_VER
33 33
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
34 34
 #endif
35 35
 
... ...
@@ -23,7 +23,7 @@
23 23
 
24 24
 using namespace affymetrix_calvin_io;
25 25
 
26
-#ifndef WIN32
26
+#ifndef _MSC_VER
27 27
 #include <sys/mman.h>
28 28
 #endif
29 29
 
... ...
@@ -31,7 +31,7 @@
31 31
 #include <string>
32 32
 #include <fstream>
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #include <windows.h>
36 36
 #endif
37 37
 
... ...
@@ -25,7 +25,7 @@
25 25
 #include <list>
26 26
 #include "DataSetHeader.h"
27 27
 
28
-#ifdef WIN32
28
+#ifdef _MSC_VER
29 29
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
30 30
 #endif
31 31
 
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 using namespace affymetrix_calvin_io;
28 28
 
29
-#ifndef WIN32
29
+#ifndef _MSC_VER
30 30
 #include <unistd.h>
31 31
 #include <sys/mman.h>
32 32
 
... ...
@@ -56,7 +56,7 @@ DataSet::DataSet(const std::string& fileName_, const DataSetHeader& header_, voi
56 56
 	data = 0;
57 57
 	isOpen = false;
58 58
 
59
-#ifdef WIN32
59
+#ifdef _MSC_VER
60 60
 	fileMapHandle = handle;
61 61
 #else
62 62
 	fp = 0;
... ...
@@ -80,7 +80,7 @@ DataSet::DataSet(const std::string& fileName_, const affymetrix_calvin_io::DataS
80 80
 	data = 0;
81 81
 	isOpen = false;
82 82
 
83
-#ifdef WIN32
83
+#ifdef _MSC_VER
84 84
 	fileMapHandle = 0;
85 85
 #else
86 86
 	fp = 0;
... ...
@@ -132,7 +132,7 @@ bool DataSet::Open()
132 132
  */
133 133
 bool DataSet::OpenMM()
134 134
 {
135
-#ifdef WIN32
135
+#ifdef _MSC_VER
136 136
 	if (MapDataWin32(header.GetDataStartFilePos(), header.GetDataSize()) == false)
137 137
 		return false;
138 138
 #else
... ...
@@ -177,7 +177,7 @@ void DataSet::Close()
177 177
 		ClearStreamData();
178 178
 }
179 179
 
180
-#ifdef WIN32
180
+#ifdef _MSC_VER
181 181
 
182 182
 std::string GetErrorMsg()
183 183
 {
... ...
@@ -289,7 +289,7 @@ bool DataSet::MapDataPosix(u_int32_t start, u_int32_t bytes)
289 289
  */
290 290
 void DataSet::UnmapFile()
291 291
 {
292
-#ifdef WIN32
292
+#ifdef _MSC_VER
293 293
 
294 294
 	// Unmap the view
295 295
 	if (mappedData != 0 )
... ...
@@ -383,7 +383,7 @@ char* DataSet::FilePosition(int32_t rowStart, int32_t col, int32_t rowCount)
383 383
 	// Byte offset in data set + byte offset of data set in file
384 384
 	u_int32_t startByte = BytesPerRow()*rowStart + columnByteOffsets[col] + header.GetDataStartFilePos();
385 385
 
386
-#ifdef WIN32
386
+#ifdef _MSC_VER
387 387
 
388 388
 	if (useMemoryMapping)
389 389
 	{
... ...
@@ -21,9 +21,6 @@
21 21
 #ifndef _DataSet_HEADER_
22 22
 #define _DataSet_HEADER_
23 23
 
24
-/*! \file DataSet.h This file provides access to the DataSet data.
25
- */
26
-
27 24
 #include "AffymetrixBaseTypes.h"
28 25
 #include "AffyStlCollectionTypes.h"
29 26
 #include "DataSetHeader.h"
... ...
@@ -31,7 +28,7 @@
31 28
 #include <string>
32 29
 #include <fstream>
33 30
 
34
-#ifdef WIN32
31
+#ifdef _MSC_VER
35 32
 #include <windows.h>
36 33
 #endif
37 34
 
... ...
@@ -250,7 +247,7 @@ protected:
250 247
 	template<typename T> void ClearAndSizeVector(std::vector<T>& values, u_int32_t size);
251 248
 
252 249
 	/*! Platform specific memory-mapping method */
253
-#ifdef WIN32
250
+#ifdef _MSC_VER
254 251
 
255 252
 	bool MapDataWin32(u_int32_t start, u_int32_t bytes);
256 253
 
... ...
@@ -261,7 +258,7 @@ protected:
261 258
 #endif
262 259
 
263 260
 protected:
264
-	/*! name of the file containing the data dataGroup.  */
261
+	/*! name of the file containing the data data set*.  */
265 262
 	std::string fileName;
266 263
 
267 264
 	/*! copy of the DataSetHeader */
... ...
@@ -278,7 +275,7 @@ protected:
278 275
 	 */
279 276
 	Int32Vector columnByteOffsets;
280 277
 
281
-#ifdef WIN32
278
+#ifdef _MSC_VER
282 279
 
283 280
 	/*! Handle returned by CreateFileMapping */
284 281
 	HANDLE fileMapHandle;
... ...
@@ -32,7 +32,7 @@
32 32
 #include "ColumnInfo.h"
33 33
 #include "BitFlag.h"
34 34
 
35
-#ifdef WIN32
35
+#ifdef _MSC_VER
36 36
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
37 37
 #endif
38 38
 
... ...
@@ -51,9 +51,9 @@ public:
51 51
 
52 52
 private:
53 53
 
54
-	/*! total rows in the dataGroup */
54
+	/*! total rows in the data set */
55 55
 	int32_t rowCount;
56
-	/*! data dataGroup name */
56
+	/*! data data set name */
57 57
 	std::wstring name;
58 58
 	/*! name/value pairs */
59 59
 	ParameterNameValueTypeVector nameValParams;
... ...
@@ -31,7 +31,7 @@
31 31
 #include "GenericDataHeader.h"
32 32
 #include "DataGroupHeader.h"
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
36 36
 #endif
37 37
 
... ...
@@ -33,7 +33,7 @@ using namespace affymetrix_calvin_io;
33 33
  */
34 34
 GenericData::GenericData()
35 35
 {
36
-#ifdef 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
-#ifdef 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
-#ifdef WIN32
313
+#ifdef _MSC_VER
314 314
 	handle = fileMapHandle;
315 315
 #endif
316 316
 
... ...
@@ -465,7 +465,7 @@ void GenericData::Close()
465 465
  */
466 466
 bool GenericData::MapFile()
467 467
 {
468
-#ifdef 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
-#ifdef WIN32
497
+#ifdef _MSC_VER
498 498
 
499 499
 	if (fileHandle != INVALID_HANDLE_VALUE)
500 500
 	{
... ...
@@ -35,7 +35,7 @@
35 35
 #include <string>
36 36
 #include <vector>
37 37
 
38
-#ifdef WIN32
38
+#ifdef _MSC_VER
39 39
 #include <windows.h>
40 40
 #endif
41 41
 
... ...
@@ -231,7 +231,7 @@ protected:
231 231
 	/*! The header and generic header objects */
232 232
 	affymetrix_calvin_io::FileHeader header;
233 233
 
234
-#ifdef WIN32
234
+#ifdef _MSC_VER
235 235
 	/*! Handle returned by CreateFileMapping */
236 236
 	HANDLE fileMapHandle;
237 237
 
... ...
@@ -28,7 +28,7 @@
28 28
 #include <string>
29 29
 #include <vector>
30 30
 
31
-#ifdef WIN32
31
+#ifdef _MSC_VER
32 32
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
33 33
 #endif
34 34
 
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 
27 27
 #include <string>
28
+#include "AffymetrixBaseTypes.h"
28 29
 
29 30
 namespace affymetrix_calvin_data
30 31
 {
... ...
@@ -35,6 +36,9 @@ typedef struct _ProbeSetSignalData
35 36
 	/*! The name of the probe set. */
36 37
 	std::string name;
37 38
 
39
+    /*! The probe set id. */
40
+    int32_t id;
41
+
38 42
 	/*! The signal associated to the name. */
39 43
 	float signal;
40 44
 
... ...
@@ -35,7 +35,7 @@ namespace affymetrix_calvin_exceptions
35 35
 	class CalvinException
36 36
 	{
37 37
 		protected:
38
-			/*! Source in the WIN32 use case is used for registry lookup to determine the resource file. 
38
+			/*! Source in the _MSC_VER use case is used for registry lookup to determine the resource file. 
39 39
 				The message code is used incojuction with source to lookup the specific message string based on code.
40 40
 			*/
41 41
 			std::wstring sourceName;
... ...
@@ -130,6 +130,14 @@ public:
130 130
 	 *	\return The chip type of the cell.
131 131
 	 */
132 132
 	virtual std::wstring GetChipType() { return calvinCel.GetArrayType(); }
133
+	/*! \brief Get the library package
134
+	 *	\return library package name
135
+	 */
136
+    std::wstring GetLibraryPackageName() { return calvinCel.GetLibraryPackageName(); }
137
+	/*! \brief Get the master file
138
+	 *	\return master file name
139
+	 */
140
+    std::wstring GetMasterFileName() { return calvinCel.GetMasterFileName(); }
133 141
 	/*! \brief Get cell margin.
134 142
 		\return The cell margin.
135 143
 	 */
... ...
@@ -236,6 +236,24 @@ std::wstring FusionCELData::GetChipType()
236 236
 	return adapter->GetChipType();
237 237
 }
238 238
 
239
+/*
240
+ * Get the library package
241
+ */
242
+std::wstring FusionCELData::GetLibraryPackageName()
243
+{
244
+   	CheckAdapter();
245
+    return adapter->GetLibraryPackageName();
246
+}
247
+
248
+/*
249
+ * Get the master file
250
+ */
251
+std::wstring FusionCELData::GetMasterFileName()
252
+{
253
+   	CheckAdapter();
254
+    return adapter->GetMasterFileName();
255
+}
256
+
239 257
 /*
240 258
  * Retrieve cell margin.
241 259
  */
... ...
@@ -151,6 +151,16 @@ public:
151 151
 	 */
152 152
 	std::wstring GetChipType();
153 153
 
154
+	/*! Get the library package
155
+	 *	@return library package name (blank for GCOS format CEL files)
156
+	 */
157
+	std::wstring GetLibraryPackageName();
158
+
159
+	/*! Get the master file
160
+	 *	@return master file name (blank for GCOS format CEL files)
161
+	 */
162
+	std::wstring GetMasterFileName();
163
+    
154 164
 	/*!	Retrieve cell margin
155 165
 	 *	@return Cell margin
156 166
 	 */
... ...
@@ -142,6 +142,14 @@ public:
142 142
 	 *	\return The chip type of the cell.
143 143
 	 */
144 144
 	virtual std::wstring GetChipType() = 0;
145
+	/*! \brief Get the master file
146
+	 *	\return master file name
147
+	 */
148
+	virtual std::wstring GetMasterFileName() = 0;
149
+    /*! \brief Get the library package
150
+	 *	\return library package name
151
+	 */
152
+	virtual std::wstring GetLibraryPackageName() = 0;
145 153
 	/*! \brief Get cell margin.
146 154
 		\return The cell margin.
147 155
 	 */
... ...
@@ -24,7 +24,7 @@
24 24
 
25 25
 //////////////////////////////////////////////////////////////////////
26 26
 
27
-#ifdef WIN32
27
+#ifdef _MSC_VER
28 28
 #pragma warning(disable: 4786) // identifier was truncated in the debug information
29 29
 #endif
30 30
 
... ...
@@ -132,6 +132,14 @@ public:
132 132
 	 *	\return The chip type of the cell.
133 133
 	 */
134 134
 	virtual std::wstring GetChipType();
135
+	/*! \brief Get the library package
136
+	 *	\return blank value
137
+	 */
138
+    virtual std::wstring GetLibraryPackageName() { return L""; }
139
+	/*! \brief Get the master file
140
+	 *	\return blank value
141
+	 */
142
+	virtual std::wstring GetMasterFileName() { return L""; }
135 143
 	/*! \brief Get cell margin.
136 144
 		\return The cell margin.
137 145
 	 */
... ...
@@ -29,6 +29,12 @@ namespace affymetrix_calvin_parameter
29 29
 /*! Defines the static attribute name for the probe array type of the physical array. */
30 30
 #define ARRAY_TYPE_PARAM_NAME L"affymetrix-array-type"
31 31
 
32
+/*! Defines the static attribute name for the master file. */
33
+#define MASTER_FILE_PARAM_NAME L"affymetrix-master-file"
34
+
35
+/*! Defines the static attribute name for the library package. */
36
+#define LIBRARY_PACKAGE_PARAM_NAME L"affymetrix-library-package"
37
+
32 38
 /*! Defines the number of characters to reserve in the parameter list for the array type name */
33 39
 #define ARRAY_TYPE_MAX_LEN 100
34 40
 
... ...
@@ -30,7 +30,7 @@
30 30
 #include <vector>
31 31
 #include <list>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
37 37
new file mode 100644
... ...
@@ -0,0 +1,48 @@
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 "ParameterFileData.h"
22
+
23
+using namespace affymetrix_calvin_parameter;
24
+
25
+/*
26
+ * Clear the members.
27
+ */
28
+ParameterFileData::ParameterFileData()
29
+{
30
+    Clear();
31
+}
32
+
33
+/*
34
+ * Clear the members.
35
+ */
36
+void ParameterFileData::Clear()
37
+{
38
+    parameters.clear();
39
+
40
+    parameterFileAttributes.company.clear();
41
+    parameterFileAttributes.userName.clear();
42
+    parameterFileAttributes.contentVersion.clear();
43
+
44
+    implementationAttributes.name.clear();
45
+    implementationAttributes.version.clear();
46
+    implementationAttributes.executableFileName.clear();
47
+    implementationAttributes.description.clear();
48
+}
0 49
new file mode 100644
... ...
@@ -0,0 +1,107 @@
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 _ParameterFileData_HEADER_
22
+#define _ParameterFileData_HEADER_
23
+
24
+/*! \file ParameterFileData.h This file provides definitions for data in a parameter file.
25
+ */
26
+
27
+#include <string>
28
+#include <list>
29
+
30
+namespace affymetrix_calvin_parameter
31
+{
32
+
33
+/*! The attributes in the ParameterFile element. */
34
+typedef struct _ParameterFileAttributesType
35
+{
36
+    std::wstring company; /*! The company name. */
37
+    std::wstring userName; /*! The user name. */
38
+    std::wstring contentVersion; /*! The content version. */
39
+} ParameterFileAttributesType;
40
+
41
+/*! The attributes in the Implementation element. */
42
+typedef struct _ImplementationAttributesType
43
+{
44
+    std::wstring name; /*! The name. */
45
+	std::wstring version; /*! The version number. */
46
+	std::wstring executableFileName; /*! The exe file name. */
47
+	std::wstring description; /*! The description */
48
+} ImplementationAttributesType;
49
+
50
+/*! The attributes in the Parameter element. */
51
+typedef struct _ParameterType
52
+{
53
+    std::wstring name; /*! The name. */
54
+    std::wstring index; /*! The index. */
55
+    std::wstring displayName; /*! The display name. */
56
+    std::wstring category; /*! The category. */
57
+    std::wstring isEditable; /*! The idEditable flag */
58
+    std::wstring type; /*! The type */
59
+    std::wstring currentValue; /*! The current value */
60
+    std::wstring minValue; /*! The minimum value */
61
+    std::wstring maxValue; /*! The maximum value */
62
+    std::wstring defaultValue; /*! The default value */
63
+    std::wstring precision; /*! The precision for floating point numbers */
64
+    std::wstring maxLength; /*! The maximum length of a string value */
65
+    std::wstring description; /*! The description */
66
+} ParameterType;
67
+
68
+/*! A list of parameters. */
69
+typedef std::list<ParameterType> ParameterTypeList;
70
+
71
+/*! Provides data storage for ParameterFile files. This version
72
+    does not store all of the contents of a parameter file.
73
+    Missing items includes the ParameterSet, MetaData and Control
74
+    elements.
75
+*/
76
+class ParameterFileData
77
+{
78
+public:
79
+    /*! Clears the members in the class. */
80
+    void Clear();
81
+
82
+    /*! Constructor. */
83
+    ParameterFileData();
84
+
85
+    /*! The parameter file attributes. */
86
+    ParameterFileAttributesType &ParameterFileAttributes() { return parameterFileAttributes; }
87
+
88
+    /*! The implementation attributes. */
89
+    ImplementationAttributesType &ImplementationAttributes() { return implementationAttributes; }
90
+
91
+    /*! The list of parameters. */
92
+    ParameterTypeList &Parameters() { return parameters; }
93
+
94
+private:
95
+    /*! The parameter file attributes. */
96
+    ParameterFileAttributesType parameterFileAttributes;
97
+
98
+    /*! The implementation attributes. */
99
+    ImplementationAttributesType implementationAttributes;
100
+
101
+    /*! The list of parameters. */
102
+    ParameterTypeList parameters;
103
+};
104
+
105
+}
106
+
107
+#endif // _ParameterFileData_HEADER_
... ...
@@ -21,7 +21,7 @@
21 21
 #include "ParameterNameValueType.h"
22 22
 #include "StringUtils.h"
23 23
 
24
-#ifdef WIN32
24
+#ifdef _MSC_VER
25 25
 #pragma warning(disable: 4996) // don't show deprecated warnings.
26 26
 #include <winsock2.h>
27 27
 #else
... ...
@@ -30,7 +30,7 @@
30 30
 #include <vector>
31 31
 #include <list>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
... ...
@@ -30,7 +30,7 @@
30 30
 #include <string>
31 31
 #include <fstream>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
... ...
@@ -30,7 +30,7 @@
30 30
 #include <string>
31 31
 #include <fstream>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
... ...
@@ -31,7 +31,7 @@
31 31
 #include <string>
32 32
 #include <fstream>
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
36 36
 #endif
37 37
 
... ...
@@ -30,7 +30,7 @@
30 30
 #include <string>
31 31
 #include <fstream>
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
35 35
 #endif
36 36
 
... ...
@@ -31,7 +31,7 @@
31 31
 #include <string>
32 32
 #include <fstream>
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
36 36
 #endif
37 37
 
... ...
@@ -28,7 +28,7 @@
28 28
 #include "DataSetReader.h"
29 29
 #include <fstream>
30 30
 
31
-#ifdef WIN32
31
+#ifdef _MSC_VER
32 32
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
33 33
 #endif
34 34
 
... ...
@@ -31,7 +31,7 @@
31 31
 #include <string>
32 32
 #include <fstream>
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
36 36
 #endif
37 37
 
... ...
@@ -27,7 +27,7 @@
27 27
 #include <fstream>
28 28
 #include "DataSetHeader.h"
29 29
 
30
-#ifdef WIN32
30
+#ifdef _MSC_VER
31 31
 #pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations.
32 32
 #endif
33 33
 
... ...
@@ -31,7 +31,7 @@
31 31
 #include <string>
32 32
 #include <fstream>
33 33
 
34
-#ifdef WIN32
34
+#ifdef _MSC_VER
35 35
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
36 36
 #endif
37 37
 
... ...
@@ -22,7 +22,7 @@
22 22
 #include <stdio.h>
23 23
 #include <stdlib.h>
24 24
 
25
-#ifdef WIN32
25
+#ifdef _MSC_VER
26 26
 #include <winsock2.h>
27 27
 #pragma warning(disable: 4996)
28 28
 #else
... ...
@@ -27,7 +27,7 @@
27 27
 #include "GenericDataHeader.h"
28 28
 #include <fstream>
29 29
 
30
-#ifdef WIN32
30
+#ifdef _MSC_VER
31 31
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
32 32
 #endif
33 33
 
... ...
@@ -32,7 +32,7 @@
32 32
 #include <string>
33 33
 #include <fstream>
34 34
 
35
-#ifdef WIN32
35
+#ifdef _MSC_VER
36 36
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
37 37
 #endif
38 38
 
... ...
@@ -32,7 +32,7 @@
32 32
 #include <string>
33 33
 #include <fstream>
34 34
 
35
-#ifdef WIN32
35
+#ifdef _MSC_VER
36 36
 #pragma warning(disable: 4290) // dont show warnings about throw keyword on function declarations.
37 37
 #endif
38 38
 
39 39
new file mode 100644
... ...
@@ -0,0 +1,89 @@
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 "ParameterFileReader.h"
22
+#include "SAXParameterFileHandlers.h"
23
+#include <xercesc/util/PlatformUtils.hpp>
24
+#include <xercesc/parsers/SAXParser.hpp>
25
+#include <sys/stat.h>
26
+#include <sys/types.h>
27
+
28
+using namespace affymetrix_calvin_io;
29
+using namespace affymetrix_calvin_parameter;
30
+XERCES_CPP_NAMESPACE_USE;
31
+
32
+/*
33
+ * Initialize the class.
34
+ */
35
+ParameterFileReader::ParameterFileReader()
36
+{
37
+}
38
+
39
+/*
40
+ * Clear the data.
41
+ */
42
+ParameterFileReader::~ParameterFileReader()
43
+{
44
+}
45
+
46
+/*
47
+ * Read the entire file using the XML SAX parser.
48
+ */
49
+bool ParameterFileReader::Read(const std::string &fileName, ParameterFileData &parameterFileData)
50
+{
51
+	parameterFileData.Clear();
52
+
53
+	// Initialize the XML4C2 system
54
+	try
55
+	{
56
+		XMLPlatformUtils::Initialize();
57
+	}
58
+	catch (const XMLException&)
59
+	{
60
+		return false;
61
+	}
62
+
63
+	bool status = false;
64
+	SAXParser* parser = new SAXParser;
65
+	parser->setValidationScheme(SAXParser::Val_Never);
66
+	parser->setLoadExternalDTD(false);
67
+	parser->setDoNamespaces(false);
68
+	parser->setDoSchema(false);
69
+	parser->setValidationSchemaFullChecking(false);
70
+	SAXParameterFileHandlers handler(&parameterFileData);
71
+	parser->setDocumentHandler(&handler);
72
+	parser->setErrorHandler(&handler);
73
+	try
74
+	{
75
+		parser->parse(fileName.c_str());
76
+		int errorCount = parser->getErrorCount();
77
+		if (errorCount == 0)
78
+		{
79
+			status = true;
80
+		}
81
+	}
82
+	catch (...)
83
+	{
84
+		status = false;
85
+	}
86
+	delete parser;
87
+	XMLPlatformUtils::Terminate();
88
+	return status;
89
+}
0 90
new file mode 100644
... ...
@@ -0,0 +1,59 @@
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 _ParameterFileReader_HEADER_
22
+#define _ParameterFileReader_HEADER_
23
+
24
+/*! \file ParameterFileReader.h This file provides interfaces to read a parameter file.
25
+ */
26
+
27
+#include "ParameterFileData.h"
28
+#include <string>
29
+#include <fstream>
30
+
31
+namespace affymetrix_calvin_io
32
+{
33
+
34
+/*! This class provides interfaces to read a parameter file. This version
35
+    does not store all of the contents of a parameter file.
36
+    Missing items includes the ParameterSet, MetaData and Control
37
+    elements.
38
+*/
39
+class ParameterFileReader
40
+{
41
+public:
42
+	/*! Constructor */
43
+	ParameterFileReader();
44
+
45
+	/*! Destructor */
46
+	~ParameterFileReader();
47
+
48
+public:
49
+	/*! Reads the entire contents of the file.
50
+	 *
51
+	 * @param fileName The name of the parameter file to read.
52
+	 * @param parameterData The parameter data from the input file.
53
+	 */
54
+	bool Read(const std::string &fileName, affymetrix_calvin_parameter::ParameterFileData &parameterFileData);
55
+};
56
+
57
+};
58
+
59
+#endif // _ParameterFileReader_HEADER_
... ...
@@ -30,7 +30,7 @@ using namespace affymetrix_calvin_utilities;
30 30
 using namespace std;
31 31
 XERCES_CPP_NAMESPACE_USE;
32 32
 
33
-#ifdef WIN32
33
+#ifdef _MSC_VER
34 34
 #pragma warning(disable: 4996) // don't show deprecated warnings.
35 35
 #endif
36 36
 
37 37
new file mode 100644
... ...
@@ -0,0 +1,231 @@
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 "SAXParameterFileHandlers.h"
22
+#include "StringUtils.h"
23
+#include <string>
24
+#include <map>
25
+
26
+using namespace affymetrix_calvin_io;
27
+using namespace affymetrix_calvin_parameter;
28
+using namespace affymetrix_calvin_utilities;
29
+using namespace std;
30
+XERCES_CPP_NAMESPACE_USE;
31
+
32
+#ifdef _MSC_VER
33
+#pragma warning(disable: 4996) // don't show deprecated warnings.
34