git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@44422 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,11 +1,10 @@ |
1 | 1 |
Package: affxparser |
2 |
-Version: 1.19.0 |
|
3 |
-Date: 2009-09-22 |
|
2 |
+Version: 1.19.1 |
|
4 | 3 |
Title: Affymetrix File Parsing SDK |
5 | 4 |
Author: Henrik Bengtsson, James Bullard, Robert Gentleman, Kasper Daniel Hansen, Martin Morgan |
6 | 5 |
Maintainer: Kasper Daniel Hansen <khansen@stat.berkeley.edu> |
7 | 6 |
Description: Package for parsing Affymetrix files (CDF, CEL, CHP, BPMAP, BAR). It provides methods for fast and memory efficient parsing of Affymetrix files using the Affymetrix' Fusion SDK. Both ASCII- and binary-based files are supported. Currently, there are methods for reading chip definition file (CDF) and a cell intensity file (CEL). These files can be read either in full or in part. For example, probe signals from a few probesets can be extracted very quickly from a set of CEL files into a convenient list structure. |
8 |
-FusionDetails: Fusion SDK v1.0.12 (November 2008) |
|
7 |
+FusionDetails: Fusion SDK v1.1.0 |
|
9 | 8 |
License: LGPL (>= 2) |
10 | 9 |
Depends: R (>= 2.6.0) |
11 | 10 |
Suggests: R.utils, AffymetrixDataTestFiles |
7 | 10 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
1 |
+Index: CDFFileData.cpp |
|
2 |
+=================================================================== |
|
3 |
+--- CDFFileData.cpp (revision 44417) |
|
4 |
+@@ -747,8 +747,8 @@ |
|
5 |
+ ReadNextLine(instr, str, MAXLINELENGTH); // #qc ProbeSets |
|
6 |
+ subStr=strchr(str,'=')+1; |
|
7 |
+ m_Header.m_NumQCProbeSets = atoi(subStr); |
|
8 |
+- char strref[65000]; |
|
9 |
+- ReadNextLine(instr, strref, 65000); // The reference string. |
|
10 |
++ char strref[400000]; |
|
11 |
++ ReadNextLine(instr, strref, 400000); // The reference string. |
|
12 |
+ subStr=strchr(strref,'=')+1; |
|
13 |
+ m_Header.m_Reference = subStr; |
|
14 |
+ } |
0 | 15 |
similarity index 68% |
1 | 16 |
rename from inst/info/Makefile.fusion |
2 | 17 |
rename to inst/info/Makefile |
... | ... |
@@ -1,8 +1,16 @@ |
1 |
-fusion=affy/sdk |
|
2 |
-affxparser=~/Work/packages/affxparser/src/fusion_sdk |
|
1 |
+## Usual workflow |
|
2 |
+## first make cleanfusion |
|
3 |
+## then make compare |
|
4 |
+## check for files and directories that ought to be deleted |
|
5 |
+## then copy |
|
6 |
+ |
|
7 |
+fusion=~/Work/packages/affy/sdk |
|
8 |
+affxparser_base=~/Work/packages/affxparser |
|
9 |
+affxparser_fusion=${affxparser_base}/src/fusion_sdk |
|
10 |
+affxparser_patchdir=${affxparser_base}/inst/info |
|
3 | 11 |
|
4 | 12 |
compare : |
5 |
- diff -rq ${fusion} ${affxparser} | grep Only | grep -v svn | cat |
|
13 |
+ diff -rq ${fusion} ${affxparser_fusion} | grep Only | grep -v svn | cat |
|
6 | 14 |
|
7 | 15 |
cleanfusion : |
8 | 16 |
rm -Rf \ |
... | ... |
@@ -38,7 +46,13 @@ cleanfusion : |
38 | 46 |
${fusion}/calvin_files/parsers/data \ |
39 | 47 |
${fusion}/calvin_files/utils/data \ |
40 | 48 |
${fusion}/calvin_files/writers/data \ |
49 |
+ ${fusion}/calvin_files/lib-calvin-devnet.vcproj \ |
|
50 |
+ ${fusion}/calvin_files/lib-fusion-apt.vcproj \ |
|
41 | 51 |
${fusion}/file/file.vcproj \ |
42 | 52 |
${fusion}/file/file.sln \ |
43 | 53 |
${fusion}/file/lib-file-apt.vcproj \ |
44 |
- ${fusion}/style.css |
|
54 |
+ ${fusion}/style.css \ |
|
55 |
+ |
|
56 |
+patch: |
|
57 |
+ patch ${affxparser_fusion}/file/CDFFileData.cpp ${affxparser_patchdir}/CDFFileData.cpp.patch |
|
58 |
+ |
... | ... |
@@ -1,27 +1,18 @@ |
1 |
-Issue: long CDF reference string |
|
2 |
-line 723 and 724 of *** has the number 65000 changed to 400000 |
|
1 |
+In general, see the patchfile(s) in this directory |
|
2 |
+ |
|
3 |
+CDFFIleData.cpp.pacth |
|
4 |
+ Issue: long CDF reference string |
|
5 |
+ Fix: change the number 65000 to 400000 in lines 723, 724 |
|
6 |
+ |
|
7 |
+There may be issues in that GCC 4.3.1+ has stricter include |
|
8 |
+statements: our old notes tells us to #include <stdlib.h> but |
|
9 |
+Affy seems to use <cstdlib>, we'll see if it works. |
|
3 | 10 |
|
4 |
-Issue: GCC 4.3.1+ has stricter include statements |
|
5 |
-- use of wstring |
|
6 |
- in fusion_sdk/calvin_files/utils/src/AffyStlCollectionTypes.h |
|
7 |
- requires #include <string> |
|
8 | 11 |
|
9 | 12 |
- use of atoi() |
10 | 13 |
in fusion_sdk/calvin_files/fusion/src/CalvinAdapter/CalvinCELDataAdapter.cpp |
11 | 14 |
requires #include <stdlib.h> |
12 | 15 |
|
13 |
-- use of memset() and memcpy() |
|
14 |
- in fusion_sdk/calvin_files/parameter/src/ParameterNameValueType.cpp |
|
15 |
- requires #include <string.h> |
|
16 |
- |
|
17 |
-- use of memcpy() |
|
18 |
- in fusion_sdk/calvin_files/parsers/src/FileInput.cpp |
|
19 |
- requires #include <string.h> |
|
20 |
- |
|
21 |
-- use of strlen() |
|
22 |
- in fusion_sdk/calvin_files/utils/src/AffymetrixGuid.cpp |
|
23 |
- requires #include <string.h> |
|
24 |
- |
|
25 | 16 |
- use of wcstombs and mbstowcs |
26 | 17 |
in fusion_sdk/calvin_files/utils/src/StringUtils.cpp |
27 | 18 |
requires #include <stdlib.h> |
... | ... |
@@ -29,16 +20,3 @@ Issue: GCC 4.3.1+ has stricter include statements |
29 | 20 |
- use of EXIT_FAILURE and EXIT_SUCCESS |
30 | 21 |
in fusion_sdk/file/BPMAPFileData.cpp |
31 | 22 |
requires #include <stdlib.h> |
32 |
- |
|
33 |
-- use of strncmp(), strchr(), strlen() and atoi() |
|
34 |
- in fusion_sdk/file/CDFFileData.cpp |
|
35 |
- requires #include <string.h> and #include <stdlib.h> |
|
36 |
- |
|
37 |
-- use of strlen() and strcmp() |
|
38 |
- in fusion_sdk/file/CHPFileData.cpp |
|
39 |
- requires #include <string.h> |
|
40 |
- |
|
41 |
-- use of strcmp() |
|
42 |
- in fusion_sdk/util/Convert.cpp |
|
43 |
- requires #include <string.h> |
|
44 |
- |
... | ... |
@@ -21,7 +21,7 @@ readBpmapSeqinfo(filename, seqIndices = NULL, verbose = 0) |
21 | 21 |
\item{filename}{The filename as a character.} |
22 | 22 |
\item{seqIndices}{A vector of integers, detailing the indices of the |
23 | 23 |
sequences being read. If \code{NULL}, the entire file is being read.} |
24 |
- \item{readProbeSeq}{} |
|
24 |
+ \item{readProbeSeq}{Do we read the probe sequences.} |
|
25 | 25 |
\item{readSeqInfo}{Do we read the sequence information (a list |
26 | 26 |
containing information such as sequence name, number of hits etc.)} |
27 | 27 |
\item{readPMXY}{Do we read the (x,y) coordinates of the PM-probes.} |
... | ... |
@@ -95,8 +95,13 @@ PKG_SOURCES = \ |
95 | 95 |
fusion_sdk/file/FileIO.cpp\ |
96 | 96 |
fusion_sdk/file/FileWriter.cpp\ |
97 | 97 |
fusion_sdk/file/TsvFile/TsvFile.cpp\ |
98 |
+ fusion_sdk/util/AffxByteArray.cpp\ |
|
99 |
+ fusion_sdk/util/AffxConv.cpp\ |
|
100 |
+ fusion_sdk/util/AffxFile.cpp\ |
|
98 | 101 |
fusion_sdk/util/MsgStream.cpp\ |
99 | 102 |
fusion_sdk/util/Util.cpp\ |
103 |
+ fusion_sdk/util/Err.cpp\ |
|
104 |
+ fusion_sdk/util/Verbose.cpp\ |
|
100 | 105 |
fusion_sdk/util/RowFile.cpp\ |
101 | 106 |
fusion_sdk/util/TableFile.cpp\ |
102 | 107 |
fusion_sdk/util/Convert.cpp\ |
103 | 108 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
1 |
+//////////////////////////////////////////////////////////////// |
|
2 |
+// |
|
3 |
+// Copyright (C) 2005 Affymetrix, Inc. |
|
4 |
+// |
|
5 |
+// This program is free software; you can redistribute it and/or modify |
|
6 |
+// it under the terms of the GNU General Public License (version 2) as |
|
7 |
+// published by the Free Software Foundation. |
|
8 |
+// |
|
9 |
+// This program is distributed in the hope that it will be useful, |
|
10 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 |
+// General Public License for more details. |
|
13 |
+// |
|
14 |
+// You should have received a copy of the GNU General Public License |
|
15 |
+// along with this program;if not, write to the |
|
16 |
+// |
|
17 |
+// Free Software Foundation, Inc., |
|
18 |
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
19 |
+// |
|
20 |
+//////////////////////////////////////////////////////////////// |
|
21 |
+ |
|
22 |
+#ifndef _APT_H_ |
|
23 |
+#define _APT_H_ |
|
24 |
+ |
|
25 |
+#ifdef WIN32 |
|
26 |
+#ifdef APT_LIB_EXPORTS // when building DLL, target project defines this macro |
|
27 |
+#define APTLIB_API __declspec(dllexport) |
|
28 |
+#elif defined(APT_LIB_IMPORTS) // when using DLL, client project defines this macro |
|
29 |
+#define APTLIB_API __declspec(dllimport) |
|
30 |
+#else // when building or using target static library, or whatever: define it as nothing |
|
31 |
+#define APTLIB_API |
|
32 |
+#endif // APT_EXPORT |
|
33 |
+#else |
|
34 |
+#define APTLIB_API |
|
35 |
+#endif // WIN32 |
|
36 |
+ |
|
37 |
+#endif /* _APT_H_ */ |
|
38 |
+ |
... | ... |
@@ -24,13 +24,16 @@ |
24 | 24 |
/*! \file ArrayAttributes.h This file provides interfaces to store attributes about a physical array. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "AffymetrixGuid.h" |
|
28 |
-#include "Parameter.h" |
|
29 |
-#include "PATAssignment.h" |
|
30 |
-#include "ArrayMedia.h" |
|
31 |
-#include "CreateStep.h" |
|
27 |
+#include "calvin_files/array/src/ArrayMedia.h" |
|
28 |
+#include "calvin_files/array/src/CreateStep.h" |
|
29 |
+#include "calvin_files/array/src/PATAssignment.h" |
|
30 |
+#include "calvin_files/parameter/src/Parameter.h" |
|
31 |
+#include "calvin_files/utils/src/AffymetrixGuid.h" |
|
32 |
+// |
|
33 |
+#include <cstring> |
|
32 | 34 |
#include <string> |
33 | 35 |
#include <vector> |
36 |
+// |
|
34 | 37 |
|
35 | 38 |
namespace affymetrix_calvin_array |
36 | 39 |
{ |
... | ... |
@@ -24,12 +24,15 @@ |
24 | 24 |
/*! \file ArrayAudit.h This file provides interfaces for an audit item in an array file. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "AffymetrixBaseTypes.h" |
|
28 |
-#include "AffymetrixGuid.h" |
|
29 |
-#include "Parameter.h" |
|
30 |
-#include "DateTime.h" |
|
31 |
-#include <string> |
|
27 |
+#include "calvin_files/parameter/src/Parameter.h" |
|
28 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
29 |
+#include "calvin_files/utils/src/AffymetrixGuid.h" |
|
30 |
+#include "calvin_files/utils/src/DateTime.h" |
|
31 |
+// |
|
32 |
+#include <cstring> |
|
32 | 33 |
#include <list> |
34 |
+#include <string> |
|
35 |
+// |
|
33 | 36 |
|
34 | 37 |
namespace affymetrix_calvin_array |
35 | 38 |
{ |
... | ... |
@@ -24,7 +24,8 @@ |
24 | 24 |
/*! \file ArrayAuditActionTypes.h Defines constants for various array file audit actions. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "AffymetrixBaseTypes.h" |
|
27 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
28 |
+// |
|
28 | 29 |
|
29 | 30 |
namespace affymetrix_calvin_array |
30 | 31 |
{ |
... | ... |
@@ -24,13 +24,16 @@ |
24 | 24 |
/*! \file ArrayData.h This file provides interfaces to store information in an array file. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "ArrayId.h" |
|
28 |
-#include "AffymetrixBaseTypes.h" |
|
29 |
-#include "AffymetrixGuid.h" |
|
30 |
-#include "Parameter.h" |
|
31 |
-#include "ParameterNameValueType.h" |
|
32 |
-#include "ArrayAttributes.h" |
|
27 |
+#include "calvin_files/array/src/ArrayAttributes.h" |
|
28 |
+#include "calvin_files/array/src/ArrayId.h" |
|
29 |
+#include "calvin_files/parameter/src/Parameter.h" |
|
30 |
+#include "calvin_files/parameter/src/ParameterNameValueType.h" |
|
31 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
32 |
+#include "calvin_files/utils/src/AffymetrixGuid.h" |
|
33 |
+// |
|
34 |
+#include <cstring> |
|
33 | 35 |
#include <string> |
36 |
+// |
|
34 | 37 |
|
35 | 38 |
namespace affymetrix_calvin_array |
36 | 39 |
{ |
31 | 33 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,56 @@ |
1 |
+//////////////////////////////////////////////////////////////// |
|
2 |
+// |
|
3 |
+// Copyright (C) 2008 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 |
|
7 |
+// (version 2.1) as published by the Free Software Foundation. |
|
8 |
+// |
|
9 |
+// This library is distributed in the hope that it will be useful, but |
|
10 |
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|
11 |
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
|
12 |
+// for more details. |
|
13 |
+// |
|
14 |
+// You should have received a copy of the GNU Lesser General Public License |
|
15 |
+// along with this library; if not, write to the Free Software Foundation, Inc., |
|
16 |
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
+// |
|
18 |
+//////////////////////////////////////////////////////////////// |
|
19 |
+ |
|
20 |
+ |
|
21 |
+#ifndef _AllelePeaks_HEADER_ |
|
22 |
+#define _AllelePeaks_HEADER_ |
|
23 |
+ |
|
24 |
+/*! \file AllelePeaks.h This file provides types to hold allele peak results. |
|
25 |
+ */ |
|
26 |
+ |
|
27 |
+#include "calvin_files/parameter/src/ParameterNameValueType.h" |
|
28 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
29 |
+// |
|
30 |
+#include <cstring> |
|
31 |
+#include <string> |
|
32 |
+#include <vector> |
|
33 |
+// |
|
34 |
+namespace affymetrix_calvin_data |
|
35 |
+{ |
|
36 |
+ |
|
37 |
+/*! Holds the allele peak results */ |
|
38 |
+typedef struct _AllelePeaks |
|
39 |
+{ |
|
40 |
+ /*! The name of the marker. */ |
|
41 |
+ std::string name; |
|
42 |
+ |
|
43 |
+ /*! The chromosome value. */ |
|
44 |
+ u_int8_t chr; |
|
45 |
+ |
|
46 |
+ /*! The physical position. */ |
|
47 |
+ u_int32_t position; |
|
48 |
+ |
|
49 |
+ /*! The allele peaks. */ |
|
50 |
+ std::vector<affymetrix_calvin_parameter::ParameterNameValueType> peaks; |
|
51 |
+ |
|
52 |
+} AllelePeaks; |
|
53 |
+ |
|
54 |
+} |
|
55 |
+ |
|
56 |
+#endif |
... | ... |
@@ -18,9 +18,11 @@ |
18 | 18 |
//////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
|
21 |
-#include "CDFData.h" |
|
22 |
-#include "DataSetHeader.h" |
|
23 |
-#include "DataException.h" |
|
21 |
+#include "calvin_files/data/src/CDFData.h" |
|
22 |
+// |
|
23 |
+#include "calvin_files/data/src/DataException.h" |
|
24 |
+#include "calvin_files/data/src/DataSetHeader.h" |
|
25 |
+// |
|
24 | 26 |
|
25 | 27 |
using namespace affymetrix_calvin_io; |
26 | 28 |
using namespace affymetrix_calvin_exceptions; |
... | ... |
@@ -23,14 +23,17 @@ |
23 | 23 |
#ifndef _CDFData_HEADER_ |
24 | 24 |
#define _CDFData_HEADER_ |
25 | 25 |
|
26 |
-#include <string> |
|
27 |
-#include "FileHeader.h" |
|
28 |
-#include "GenericData.h" |
|
29 |
-#include "CDFProbeSetInformation.h" |
|
30 |
-#include "CDFQCProbeSetInformation.h" |
|
31 |
-#include "AffymetrixBaseTypes.h" |
|
32 |
-#include "AffymetrixParameterConsts.h" |
|
26 |
+#include "calvin_files/data/src/CDFProbeSetInformation.h" |
|
27 |
+#include "calvin_files/data/src/CDFQCProbeSetInformation.h" |
|
28 |
+#include "calvin_files/data/src/FileHeader.h" |
|
29 |
+#include "calvin_files/data/src/GenericData.h" |
|
30 |
+#include "calvin_files/parameter/src/AffymetrixParameterConsts.h" |
|
31 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
32 |
+// |
|
33 |
+#include <cstring> |
|
33 | 34 |
#include <map> |
35 |
+#include <string> |
|
36 |
+// |
|
34 | 37 |
|
35 | 38 |
#ifdef _MSC_VER |
36 | 39 |
#pragma warning(disable: 4290) // don't show warnings about throw keyword on function declarations. |
... | ... |
@@ -37,6 +37,8 @@ enum CDFDataTypeIds { |
37 | 37 |
CopyNumber, /*! A copy number probe set. */ |
38 | 38 |
GenotypeControl, /*! A genotype control probe set. */ |
39 | 39 |
ExpressionControl, /*! An expression control probe set. */ |
40 |
+ Marker, /*! A polymorphic marker probe set. */ |
|
41 |
+ MultichannelMarker /*! A multichannel marker probe set. */ |
|
40 | 42 |
|
41 | 43 |
}; |
42 | 44 |
|
... | ... |
@@ -56,6 +58,28 @@ enum DirectionType |
56 | 58 |
ProbeEitherDirection |
57 | 59 |
}; |
58 | 60 |
|
61 |
+/*! Defines the type of probe replication of a group */ |
|
62 |
+enum ReplicationType |
|
63 |
+{ |
|
64 |
+ /*! Unspecified replication type */ |
|
65 |
+ UnknownProbeRepType, |
|
66 |
+ |
|
67 |
+ /*! Different |
|
68 |
+ * All probes in the probe group have different sequences |
|
69 |
+ */ |
|
70 |
+ DifferentProbeRepType, |
|
71 |
+ |
|
72 |
+ /*! Mixed |
|
73 |
+ * Some probes in the probe group have identical sequences |
|
74 |
+ */ |
|
75 |
+ MixedProbeRepType, |
|
76 |
+ |
|
77 |
+ /* Identical |
|
78 |
+ * All probes in the probe group have identical sequences |
|
79 |
+ */ |
|
80 |
+ IdenticalProbeRepType |
|
81 |
+}; |
|
82 |
+ |
|
59 | 83 |
} |
60 | 84 |
|
61 | 85 |
#endif |
... | ... |
@@ -18,10 +18,12 @@ |
18 | 18 |
//////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
|
21 |
-#include "CDFData.h" |
|
22 |
-#include "DataSet.h" |
|
23 |
-#include "CDFProbeGroupInformation.h" |
|
24 |
-#include "CDFProbeInformation.h" |
|
21 |
+#include "calvin_files/data/src/CDFProbeGroupInformation.h" |
|
22 |
+// |
|
23 |
+#include "calvin_files/data/src/CDFData.h" |
|
24 |
+#include "calvin_files/data/src/CDFProbeInformation.h" |
|
25 |
+#include "calvin_files/data/src/DataSet.h" |
|
26 |
+// |
|
25 | 27 |
|
26 | 28 |
using namespace affymetrix_calvin_io; |
27 | 29 |
|
... | ... |
@@ -58,6 +60,8 @@ void CDFProbeGroupInformation::SetDataSet(DataSet* ds) |
58 | 60 |
cellCnt = 0; |
59 | 61 |
wobbleSituation = 0; |
60 | 62 |
alleleCode = 0; |
63 |
+ channel = 0; |
|
64 |
+ repType = 0; |
|
61 | 65 |
probeSetNumber = 0; |
62 | 66 |
cellsPerList = 0; |
63 | 67 |
|
... | ... |
@@ -81,11 +85,19 @@ void CDFProbeGroupInformation::SetDataSet(DataSet* ds) |
81 | 85 |
|
82 | 86 |
// Wobble situation |
83 | 87 |
// if (dsh.FindNameValParam(CDF_WOBBLE_SITUATION, nvt)) |
84 |
-// wobbleSituation = nvt.GetValueUInt8(); |
|
88 |
+// wobbleSituation = nvt.GetValueUInt16(); |
|
85 | 89 |
|
86 | 90 |
// Allele code |
87 | 91 |
// if (dsh.FindNameValParam(CDF_ALLELE, nvt)) |
88 |
-// allele = nvt.GetValueUInt8(); |
|
92 |
+// alleleCode = nvt.GetValueUInt16(); |
|
93 |
+ |
|
94 |
+ // Channel |
|
95 |
+// if (dsh.FindNameValParam(CDF_CHANNEL, nvt)) |
|
96 |
+// channel = nvt.GetValueUInt8(); |
|
97 |
+ |
|
98 |
+ // Probe replication type |
|
99 |
+// if (dsh.FindNameValParam(CDF_REP_TYPE, nvt)) |
|
100 |
+// repType = nvt.GetValueUInt8(); |
|
89 | 101 |
|
90 | 102 |
// List (atom) |
91 | 103 |
if (dsh.FindNameValParam(CDF_ATOMS, nvt)) |
... | ... |
@@ -28,6 +28,10 @@ |
28 | 28 |
#include <windows.h> |
29 | 29 |
#endif |
30 | 30 |
|
31 |
+#include "calvin_files/data/src/CDFProbeSetInformation.h" |
|
32 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
33 |
+// |
|
34 |
+ |
|
31 | 35 |
namespace affymetrix_calvin_io |
32 | 36 |
{ |
33 | 37 |
|
... | ... |
@@ -56,6 +60,10 @@ public: |
56 | 60 |
u_int16_t GetWobbleSituation() const { return wobbleSituation; } |
57 | 61 |
/*! Get the allele */ |
58 | 62 |
u_int16_t GetAlleleCode() const { return alleleCode; } |
63 |
+ /*! Get the channel */ |
|
64 |
+ u_int8_t GetChannel() const { return channel; } |
|
65 |
+ /*! Get the probe replication type */ |
|
66 |
+ ReplicationType GetRepType() const { return (ReplicationType)repType; } |
|
59 | 67 |
/*! Get information for the probe by index */ |
60 | 68 |
void GetCell(int32_t cell_index, CDFProbeInformation& info); |
61 | 69 |
|
... | ... |
@@ -78,6 +86,10 @@ protected: |
78 | 86 |
u_int16_t wobbleSituation; |
79 | 87 |
/*! Allele */ |
80 | 88 |
u_int16_t alleleCode; |
89 |
+ /*! Channel */ |
|
90 |
+ u_int8_t channel; |
|
91 |
+ /*! Probe replication type */ |
|
92 |
+ u_int8_t repType; |
|
81 | 93 |
/*! Probe set number - same as ProbeSetNumber in C++ */ |
82 | 94 |
u_int32_t probeSetNumber; |
83 | 95 |
/*! Cells per list (atom) - same as NumCellsPerList in C++ */ |
... | ... |
@@ -23,14 +23,15 @@ |
23 | 23 |
|
24 | 24 |
/*! \file CDFProbeInformation.h This file defines the CDFProbeInformation class. |
25 | 25 |
*/ |
26 |
- |
|
27 |
-#include "DataSet.h" |
|
28 |
-#include "AffymetrixBaseTypes.h" |
|
29 |
- |
|
30 | 26 |
#ifdef _MSC_VER |
31 | 27 |
#include <windows.h> |
32 | 28 |
#endif |
33 | 29 |
|
30 |
+#include "calvin_files/data/src/DataSet.h" |
|
31 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
32 |
+// |
|
33 |
+ |
|
34 |
+ |
|
34 | 35 |
namespace affymetrix_calvin_io |
35 | 36 |
{ |
36 | 37 |
/*! Class that exposes the CDF probe information */ |
... | ... |
@@ -18,10 +18,12 @@ |
18 | 18 |
//////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
|
21 |
-#include "CDFData.h" |
|
22 |
-#include "DataSet.h" |
|
23 |
-#include "CDFProbeSetInformation.h" |
|
24 |
-#include "CDFProbeGroupInformation.h" |
|
21 |
+#include "calvin_files/data/src/CDFProbeSetInformation.h" |
|
22 |
+// |
|
23 |
+#include "calvin_files/data/src/CDFData.h" |
|
24 |
+#include "calvin_files/data/src/CDFProbeGroupInformation.h" |
|
25 |
+#include "calvin_files/data/src/DataSet.h" |
|
26 |
+// |
|
25 | 27 |
|
26 | 28 |
using namespace affymetrix_calvin_io; |
27 | 29 |
|
... | ... |
@@ -24,14 +24,16 @@ |
24 | 24 |
/*! \file CDFProbeSetInformation.h This file defines the CDFProbeSetInformation class. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "DataGroup.h" |
|
28 |
-#include "CDFDataTypes.h" |
|
29 |
-#include "AffymetrixBaseTypes.h" |
|
30 |
- |
|
31 | 27 |
#ifdef _MSC_VER |
32 | 28 |
#include <windows.h> |
33 | 29 |
#endif |
34 | 30 |
|
31 |
+#include "calvin_files/data/src/CDFDataTypes.h" |
|
32 |
+#include "calvin_files/data/src/DataGroup.h" |
|
33 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
34 |
+// |
|
35 |
+ |
|
36 |
+ |
|
35 | 37 |
namespace affymetrix_calvin_io |
36 | 38 |
{ |
37 | 39 |
|
... | ... |
@@ -24,8 +24,9 @@ |
24 | 24 |
/*! \file CDFQCProbeInformation.h This file defines the CDFQCProbeInformation class. |
25 | 25 |
*/ |
26 | 26 |
|
27 |
-#include "DataSet.h" |
|
28 |
-#include "AffymetrixBaseTypes.h" |
|
27 |
+#include "calvin_files/data/src/DataSet.h" |
|
28 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
29 |
+// |
|
29 | 30 |
|
30 | 31 |
namespace affymetrix_calvin_io |
31 | 32 |
{ |
... | ... |
@@ -18,10 +18,12 @@ |
18 | 18 |
//////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
|
21 |
-#include "CDFData.h" |
|
22 |
-#include "DataSet.h" |
|
23 |
-#include "CDFQCProbeSetInformation.h" |
|
24 |
-#include "CDFQCProbeInformation.h" |
|
21 |
+#include "calvin_files/data/src/CDFQCProbeSetInformation.h" |
|
22 |
+// |
|
23 |
+#include "calvin_files/data/src/CDFData.h" |
|
24 |
+#include "calvin_files/data/src/CDFQCProbeInformation.h" |
|
25 |
+#include "calvin_files/data/src/DataSet.h" |
|
26 |
+// |
|
25 | 27 |
|
26 | 28 |
using namespace affymetrix_calvin_io; |
27 | 29 |
|
... | ... |
@@ -21,13 +21,20 @@ |
21 | 21 |
#ifndef _CDFQCProbeSetInformation_HEADER_ |
22 | 22 |
#define _CDFQCProbeSetInformation_HEADER_ |
23 | 23 |
|
24 |
-/*! \file CDFQCProbeSetInformation.h This file defines the CDFQCProbeSetInformation class. |
|
25 |
- */ |
|
26 |
- |
|
27 | 24 |
#ifdef _MSC_VER |
28 | 25 |
#include <windows.h> |
29 | 26 |
#endif |
30 | 27 |
|
28 |
+/*! \file CDFQCProbeSetInformation.h This file defines the CDFQCProbeSetInformation class. |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+#include "calvin_files/data/src/DataSet.h" |
|
32 |
+#include "calvin_files/portability/src/AffymetrixBaseTypes.h" |
|
33 |
+// |
|
34 |
+#include <cstring> |
|
35 |
+#include <string> |
|
36 |
+// |
|
37 |
+ |
|
31 | 38 |
namespace affymetrix_calvin_io |
32 | 39 |
{ |
33 | 40 |
|
... | ... |
@@ -18,13 +18,19 @@ |
18 | 18 |
//////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
|
21 |
-#include "CELData.h" |
|
22 |
-#include "DataSetHeader.h" |
|
23 |
-#include "ExceptionBase.h" |
|
24 |
-#include "GenericDataTypes.h" |
|
21 |
+#include "calvin_files/data/src/CELData.h" |
|
22 |
+// |
|
23 |
+#include "calvin_files/data/src/DataSetHeader.h" |
|
24 |
+#include "calvin_files/data/src/GenericDataTypes.h" |
|
25 |
+#include "calvin_files/exception/src/ExceptionBase.h" |
|
26 |
+#include "calvin_files/utils/src/StringUtils.h" |
|
27 |
+// |
|
28 |
+#include <sys/stat.h> |
|
29 |
+// |
|
25 | 30 |
|
26 | 31 |
using namespace affymetrix_calvin_io; |
27 | 32 |
using namespace affymetrix_calvin_exceptions; |
33 |
+using namespace affymetrix_calvin_parameter; |
|
28 | 34 |
|
29 | 35 |
/* |
30 | 36 |
* Default constructor |
... | ... |
@@ -72,17 +78,66 @@ void CelFileData::Clear() |
72 | 78 |
setPixelMetaData = false; |
73 | 79 |
setOutlierMetaData = false; |
74 | 80 |
setMaskMetaData = false; |
81 |
+ CloseDataSets(); |
|
82 |
+ ResetMaskAndOutliers(); |
|
83 |
+ cachedRows = -1; |
|
84 |
+ cachedCols = -1; |
|
85 |
+ intensityColumnType = -1; |
|
86 |
+ activeChannel = CelDataGroupName; |
|
87 |
+} |
|
88 |
+ |
|
89 |
+void CelFileData::CloseDataSets() |
|
90 |
+{ |
|
91 |
+ if (dpInten) |
|
92 |
+ { |
|
93 |
+ dpInten->Delete(); |
|
94 |
+ dpInten = 0; |
|
95 |
+ } |
|
96 |
+ if (dpStdev) |
|
97 |
+ { |
|
98 |
+ dpStdev->Delete(); |
|
99 |
+ dpStdev = 0; |
|
100 |
+ } |
|
101 |
+ if (dpPixels) |
|
102 |
+ { |
|
103 |
+ dpPixels->Delete(); |
|
104 |
+ dpPixels = 0; |
|
105 |
+ } |
|
106 |
+} |
|
75 | 107 |
|
76 |
- if (dpInten){ dpInten->Delete(); dpInten = 0; } |
|
77 |
- if (dpStdev) { dpStdev->Delete(); dpStdev = 0; } |
|
78 |
- if (dpPixels) { dpPixels->Delete(); dpPixels = 0; } |
|
108 |
+void CelFileData::ResetMaskAndOutliers() |
|
109 |
+{ |
|
79 | 110 |
outlierPlaneRead = false; |
80 | 111 |
outliers.clear(); |
81 | 112 |
maskPlaneRead = false; |
82 | 113 |
masked.clear(); |
83 |
- cachedRows = -1; |
|
84 |
- cachedCols = -1; |
|
85 |
- intensityColumnType = -1; |
|
114 |
+} |
|
115 |
+ |
|
116 |
+void CelFileData::SetActiveChannel(const std::wstring &channel) |
|
117 |
+{ |
|
118 |
+ if(activeChannel != channel) |
|
119 |
+ { |
|
120 |
+ activeChannel = channel; |
|
121 |
+ CloseDataSets(); |
|
122 |
+ ResetMaskAndOutliers(); |
|
123 |
+ } |
|
124 |
+} |
|
125 |
+ |
|
126 |
+/* |
|
127 |
+ * Check if the file exists. |
|
128 |
+ */ |
|
129 |
+bool CelFileData::Exists() |
|
130 |
+{ |
|
131 |
+ std::string filename = genericData.Header().GetFilename(); |
|
132 |
+ |
|
133 |
+ if (filename != "") |
|
134 |
+ { |
|
135 |
+ // Find the file stats. |
|
136 |
+ struct stat st; |
|
137 |
+ return ((stat(filename.c_str(), &st) == 0)? true: false); |
|
138 |
+ } |
|
139 |
+ |
|
140 |
+ return false; |
|
86 | 141 |
} |
87 | 142 |
|
88 | 143 |
/* |
... | ... |
@@ -103,99 +158,99 @@ std::string CelFileData::GetFilename() const |
103 | 158 |
|
104 | 159 |
void CelFileData::SetIntensityCount(int32_t ln) |
105 | 160 |
{ |
106 |
- DataSetHeader dpHdr; |
|
107 |
- dpHdr.SetRowCnt(ln); |
|
108 |
- dpHdr.SetName(CelIntensityLabel); |
|
109 |
- dpHdr.AddFloatColumn(CelIntensityLabel); |
|
161 |
+ DataSetHeader setHdr; |
|
162 |
+ setHdr.SetRowCnt(ln); |
|
163 |
+ setHdr.SetName(CelIntensityLabel); |
|
164 |
+ setHdr.AddFloatColumn(CelIntensityLabel); |
|
110 | 165 |
if(setIntensityMetaData) |
111 | 166 |
{ |
112 |
- UpdateDataSetRowCount(dpHdr); |
|
167 |
+ UpdateDataSetRowCount(setHdr); |
|
113 | 168 |
} |
114 | 169 |
else |
115 | 170 |
{ |
116 |
- InsertDataSetHeader(dpHdr); |
|
171 |
+ InsertDataSetHeader(setHdr); |
|
117 | 172 |
setIntensityMetaData = true; |
118 | 173 |
} |
119 | 174 |
} |
120 | 175 |
|
121 | 176 |
void CelFileData::SetStdDevCount(int32_t ln) |
122 | 177 |
{ |
123 |
- DataSetHeader dpHdr; |
|
124 |
- dpHdr.SetRowCnt(ln); |
|
125 |
- dpHdr.SetName(CelStdDevLabel); |
|
126 |
- dpHdr.AddFloatColumn(CelStdDevLabel); |
|
178 |
+ DataSetHeader setHdr; |
|
179 |
+ setHdr.SetRowCnt(ln); |
|
180 |
+ setHdr.SetName(CelStdDevLabel); |
|
181 |
+ setHdr.AddFloatColumn(CelStdDevLabel); |
|
127 | 182 |
if(setStdDevMetaData) |
128 | 183 |
{ |
129 |
- UpdateDataSetRowCount(dpHdr); |
|
184 |
+ UpdateDataSetRowCount(setHdr); |
|
130 | 185 |
} |
131 | 186 |
else |
132 | 187 |
{ |
133 |
- InsertDataSetHeader(dpHdr); |
|
188 |
+ InsertDataSetHeader(setHdr); |
|
134 | 189 |
setStdDevMetaData = true; |
135 | 190 |
} |
136 | 191 |
} |
137 | 192 |
|
138 | 193 |
void CelFileData::SetPixelCount(int32_t ln) |
139 | 194 |
{ |
140 |
- DataSetHeader dpHdr; |
|
141 |
- dpHdr.SetRowCnt(ln); |
|
142 |
- dpHdr.SetName(CelPixelLabel); |
|
143 |
- dpHdr.AddShortColumn(CelPixelLabel); |
|
195 |
+ DataSetHeader setHdr; |
|
196 |
+ setHdr.SetRowCnt(ln); |
|
197 |
+ setHdr.SetName(CelPixelLabel); |
|
198 |
+ setHdr.AddShortColumn(CelPixelLabel); |
|
144 | 199 |
if(setPixelMetaData) |
145 | 200 |
{ |
146 |
- UpdateDataSetRowCount(dpHdr); |
|
201 |
+ UpdateDataSetRowCount(setHdr); |
|
147 | 202 |
} |
148 | 203 |
else |
149 | 204 |
{ |
150 |
- InsertDataSetHeader(dpHdr); |
|
205 |
+ InsertDataSetHeader(setHdr); |
|
151 | 206 |
setPixelMetaData = true; |
152 | 207 |
} |
153 | 208 |
} |
154 | 209 |
|
155 | 210 |
void CelFileData::SetOutlierCount(int32_t ln) |
156 | 211 |
{ |
157 |
- DataSetHeader dpHdr; |
|
158 |
- dpHdr.SetRowCnt(ln); |
|
159 |
- dpHdr.SetName(CelOutlierLabel); |
|
160 |
- dpHdr.AddShortColumn(L"X"); |
|
161 |
- dpHdr.AddShortColumn(L"Y"); |
|
212 |
+ DataSetHeader setHdr; |
|
213 |
+ setHdr.SetRowCnt(ln); |
|
214 |
+ setHdr.SetName(CelOutlierLabel); |
|
215 |
+ setHdr.AddShortColumn(L"X"); |
|
216 |
+ setHdr.AddShortColumn(L"Y"); |
|
162 | 217 |
if(setOutlierMetaData) |
163 | 218 |
{ |
164 |
- UpdateDataSetRowCount(dpHdr); |
|
219 |
+ UpdateDataSetRowCount(setHdr); |
|
165 | 220 |
} |
166 | 221 |
else |
167 | 222 |
{ |
168 |
- InsertDataSetHeader(dpHdr); |
|
223 |
+ InsertDataSetHeader(setHdr); |
|
169 | 224 |
setOutlierMetaData = true; |
170 | 225 |
} |
171 | 226 |
} |
172 | 227 |
|
173 | 228 |
void CelFileData::SetMaskCount(int32_t ln) |
174 | 229 |
{ |
175 |
- DataSetHeader dpHdr; |
|
176 |
- dpHdr.SetRowCnt(ln); |
|
177 |
- dpHdr.SetName(CelMaskLabel); |
|
178 |
- dpHdr.AddShortColumn(L"X"); |
|
179 |
- dpHdr.AddShortColumn(L"Y"); |
|
230 |
+ DataSetHeader setHdr; |
|
231 |
+ setHdr.SetRowCnt(ln); |
|
232 |
+ setHdr.SetName(CelMaskLabel); |
|
233 |
+ setHdr.AddShortColumn(L"X"); |
|
234 |
+ setHdr.AddShortColumn(L"Y"); |
|
180 | 235 |
if(setMaskMetaData) |
181 | 236 |
{ |
182 |
- UpdateDataSetRowCount(dpHdr); |
|
237 |
+ UpdateDataSetRowCount(setHdr); |
|
183 | 238 |
} |
184 | 239 |
else |
185 | 240 |
{ |
186 |
- InsertDataSetHeader(dpHdr); |
|
241 |
+ InsertDataSetHeader(setHdr); |
|
187 | 242 |
setMaskMetaData = true; |
188 | 243 |
} |
189 | 244 |
} |
190 | 245 |
|
191 | 246 |
void CelFileData::UpdateDataSetRowCount(const DataSetHeader &hdr) |
192 | 247 |
{ |
193 |
- DataGroupHeader* dcHdr = &genericData.Header().GetDataGroup(0); |
|
248 |
+ DataGroupHeader* grpHdr = &genericData.Header().GetDataGroup(0); |
|
194 | 249 |
bool found = false; |
195 |
- int sz = dcHdr->GetDataSetCnt(); |
|
250 |
+ int sz = grpHdr->GetDataSetCnt(); |
|
196 | 251 |
for(int i = 0; i < sz; i++) |
197 | 252 |
{ |
198 |
- DataSetHeader* dpHdr = &dcHdr->GetDataSet(i); |
|
253 |
+ DataSetHeader* dpHdr = &grpHdr->GetDataSet(i); |
|
199 | 254 |
if(dpHdr->GetName() == hdr.GetName()) |
200 | 255 |
{ |
201 | 256 |
dpHdr->SetRowCnt(hdr.GetRowCnt()); |
... | ... |
@@ -242,7 +297,7 @@ void CelFileData::PrepareIntensityPlane() |
242 | 297 |
{ |
243 | 298 |
if (dpInten == 0) |
244 | 299 |
{ |
245 |
- dpInten = genericData.DataSet(CelDataGroupName, CelIntensityLabel); |
|
300 |
+ dpInten = genericData.DataSet(activeChannel, CelIntensityLabel); |
|
246 | 301 |
if (dpInten) |
247 | 302 |
{ |
248 | 303 |
dpInten->Open(); |
... | ... |
@@ -258,9 +313,11 @@ void CelFileData::PrepareStdevPlane() |
258 | 313 |
{ |
259 | 314 |
if (dpStdev == 0) |
260 | 315 |
{ |
261 |
- dpStdev = genericData.DataSet(CelDataGroupName, CelStdDevLabel); |
|
316 |
+ dpStdev = genericData.DataSet(activeChannel, CelStdDevLabel); |
|
262 | 317 |
if (dpStdev) |
318 |
+ { |
|
263 | 319 |
dpStdev->Open(); |
320 |
+ } |
|
264 | 321 |
} |
265 | 322 |
} |
266 | 323 |
|
... | ... |
@@ -271,9 +328,11 @@ void CelFileData::PrepareNumPixelPlane() |
271 | 328 |
{ |
272 | 329 |
if (dpPixels == 0) |
273 | 330 |
{ |
274 |
- dpPixels = genericData.DataSet(CelDataGroupName, CelPixelLabel); |
|
331 |
+ dpPixels = genericData.DataSet(activeChannel, CelPixelLabel); |
|
275 | 332 |
if (dpPixels) |
333 |
+ { |
|
276 | 334 |
dpPixels->Open(); |
335 |
+ } |
|
277 | 336 |
} |
278 | 337 |
} |
279 | 338 |
|
... | ... |
@@ -283,28 +342,34 @@ void CelFileData::PrepareNumPixelPlane() |
283 | 342 |
void CelFileData::PrepareOutlierPlane() |
284 | 343 |
{ |
285 | 344 |
if (outlierPlaneRead) |
345 |
+ { |
|
286 | 346 |
return; |
287 |
- |
|
347 |
+ } |
|
288 | 348 |
outlierPlaneRead = true; // Read attempted |
289 | 349 |
|
290 |
- DataSet* dpOutlier = genericData.DataSet(CelDataGroupName, CelOutlierLabel); |
|
291 |
- if (dpOutlier) |
|
292 |
- { |
|
293 |
- if (dpOutlier->Open()) |
|
294 |
- { |
|
295 |
- int32_t rows = dpOutlier->Rows(); |
|
296 |
- |
|
297 |
- for (int32_t row = 0; row < rows; ++row) |
|
298 |
- { |
|
299 |
- int16_t x = 0, y = 0; |
|
300 |
- dpOutlier->GetData(row, 0, x); |
|
301 |
- dpOutlier->GetData(row, 1, y); |
|
302 |
- XYCoord xy(x,y); |
|
303 |
- outliers.insert(xy); |
|
304 |
- } |
|
305 |
- } |
|
306 |
- dpOutlier->Delete(); |
|
307 |
- } |
|
350 |
+ try { |
|
351 |
+ DataSet* dpOutlier = genericData.DataSet(activeChannel, CelOutlierLabel); |
|
352 |
+ if (dpOutlier) |
|
353 |
+ { |
|
354 |
+ if (dpOutlier->Open()) |
|
355 |
+ { |
|
356 |
+ int32_t rows = dpOutlier->Rows(); |
|
357 |
+ |
|
358 |
+ for (int32_t row = 0; row < rows; ++row) |
|
359 |
+ { |
|
360 |
+ int16_t x = 0, y = 0; |
|
361 |
+ dpOutlier->GetData(row, 0, x); |
|
362 |
+ dpOutlier->GetData(row, 1, y); |
|
363 |
+ XYCoord xy(x,y); |
|
364 |
+ outliers.insert(xy); |
|
365 |
+ } |
|
366 |
+ } |
|
367 |
+ dpOutlier->Delete(); |
|
368 |
+ dpOutlier = 0; |
|
369 |
+ } |
|
370 |
+ } |
|
371 |
+ catch(affymetrix_calvin_exceptions::DataSetNotFoundException) { |
|
372 |
+ } |
|
308 | 373 |
} |
309 | 374 |
|
310 | 375 |
/* |
... | ... |
@@ -313,28 +378,34 @@ void CelFileData::PrepareOutlierPlane() |
313 | 378 |
void CelFileData::PrepareMaskedPlane() |
314 | 379 |
{ |
315 | 380 |
if (maskPlaneRead) |
381 |
+ { |
|
316 | 382 |
return; |
317 |
- |
|
383 |
+ } |
|
318 | 384 |
maskPlaneRead = true; // Read attempted |
319 | 385 |
|
320 |
- DataSet* dpMasked = genericData.DataSet(CelDataGroupName, CelMaskLabel); |
|
321 |
- if (dpMasked) |
|
322 |
- { |
|
323 |
- if (dpMasked->Open()) |
|
324 |
- { |
|
325 |
- int32_t rows = dpMasked->Rows(); |
|
326 |
- |
|
327 |
- for (int32_t row = 0; row < rows; ++row) |
|
328 |
- { |
|
329 |
- int16_t x = 0, y = 0; |
|
330 |
- dpMasked->GetData(row, 0, x); |
|
331 |
- dpMasked->GetData(row, 1, y); |
|
332 |
- XYCoord xy(x,y); |
|
333 |
- masked.insert(xy); |
|
334 |
- } |
|
335 |
- } |
|
336 |
- dpMasked->Delete(); |
|
337 |
- } |
|
386 |
+ try { |
|
387 |
+ DataSet* dpMasked = genericData.DataSet(activeChannel, CelMaskLabel); |
|
388 |
+ if (dpMasked) |
|
389 |
+ { |
|
390 |
+ if (dpMasked->Open()) |
|
391 |
+ { |
|
392 |
+ int32_t rows = dpMasked->Rows(); |
|
393 |
+ |
|
394 |
+ for (int32_t row = 0; row < rows; ++row) |
|
395 |
+ { |
|
396 |
+ int16_t x = 0, y = 0; |
|
397 |
+ dpMasked->GetData(row, 0, x); |
|
398 |
+ dpMasked->GetData(row, 1, y); |
|
399 |
+ XYCoord xy(x,y); |
|
400 |
+ masked.insert(xy); |
|
401 |
+ } |
|
402 |
+ } |
|
403 |
+ dpMasked->Delete(); |
|
404 |
+ dpMasked = 0; |
|
405 |
+ } |
|
406 |
+ } |
|
407 |
+ catch(affymetrix_calvin_exceptions::DataSetNotFoundException) { |
|
408 |
+ } |
|
338 | 409 |
} |
339 | 410 |
|
340 | 411 |
/* |
... | ... |
@@ -409,6 +480,18 @@ void CelFileData::GetData(int32_t cellIdx, float& intensity, float& stdev, int16 |
409 | 480 |
masked = IsMasked(cellIdx); |
410 | 481 |
} |
411 | 482 |
|
483 |
+/* |
|
484 |
+ * Get the intensity as used in FusionCELData |
|
485 |
+ */ |
|
486 |
+float CelFileData::GetIntensity(int index) |
|
487 |
+{ |
|
488 |
+ // allocate a vector, fill it with one item |
|
489 |
+ FloatVector v; |
|
490 |
+ this->GetIntensities(index, 1, v); |
|
491 |
+ // and return that one item. |
|
492 |
+ return v.at(0); |
|
493 |
+} |
|
494 |
+ |
|
412 | 495 |
/* |
413 | 496 |
* Get the intensities for a range of cell indexes. |
414 | 497 |
*/ |
... | ... |
@@ -424,7 +507,7 @@ bool CelFileData::GetIntensities(int32_t cellIdxStart, int32_t count, FloatVecto |
424 | 507 |
Uint16Vector uint16Vector; |
425 | 508 |
dpInten->GetData(0, cellIdxStart, count, uint16Vector); |
426 | 509 |
values.resize(uint16Vector.size()); |
427 |
- for (int32_t i = 0; i < uint16Vector.size(); ++i) |
|
510 |
+ for (u_int32_t i = 0; i < uint16Vector.size(); ++i) |
|
428 | 511 |
values[i] = (float)uint16Vector[i]; |
429 | 512 |
} |
430 | 513 |
|
... | ... |
@@ -503,8 +586,6 @@ bool CelFileData::GetMasked(int32_t cellIdxStart, int32_t count, BoolVector& val |
503 | 586 |
void CelFileData::GetOutlierCoords(XYCoordVector& coords) |
504 | 587 |
{ |
505 | 588 |
PrepareOutlierPlane(); |
506 |
- //std::set<XYCoord>::iterator begin = outliers.begin(); |
|
507 |
- //std::set<XYCoord>::iterator end = outliers.end(); |
|
508 | 589 |
for (std::set<XYCoord>::iterator ii = outliers.begin(); ii != outliers.end(); ++ii) |
509 | 590 |
{ |
510 | 591 |
XYCoord xy(ii->xCoord, ii->yCoord); |
... | ... |
@@ -518,8 +599,6 @@ void CelFileData::GetOutlierCoords(XYCoordVector& coords) |
518 | 599 |
void CelFileData::GetMaskedCoords(XYCoordVector& coords) |
519 | 600 |
{ |
520 | 601 |
PrepareMaskedPlane(); |
521 |
- //std::set<XYCoord>::iterator begin = masked.begin(); |
|
522 |
- //std::set<XYCoord>::iterator end = masked.end(); |
|
523 | 602 |
for (std::set<XYCoord>::iterator ii = masked.begin(); ii != masked.end(); ++ii) |
524 | 603 |
{ |
525 | 604 |
XYCoord xy(ii->xCoord, ii->yCoord); |
... | ... |
@@ -684,6 +763,48 @@ void CelFileData::SetCols(int32_t value) |
684 | 763 |
cachedCols = value; |
685 | 764 |
} |
686 | 765 |
|
766 |
+bool CelFileData::IsMultiColor() |
|
767 |
+{ |
|
768 |
+ return (GetChannels().size() > 1); |
|
769 |
+} |
|
770 |
+ |
|
771 |
+WStringVector CelFileData::GetChannels() |
|
772 |
+{ |
|
773 |
+ // look for tag - "affymetrix-channel-wavelength" |
|
774 |
+ // if not found then set the channel to "Default Group" |
|
775 |
+ // else parse and return. |
|
776 |
+ WStringVector result; |
|
777 |
+ GenericDataHeader* gdh = this->GetFileHeader()->GetGenericDataHdr()->FindParent(MULTI_SCAN_ACQUISITION_DATA_TYPE); |
|
778 |
+ if (gdh == NULL) |
|
779 |
+ { |
|
780 |
+ result.push_back(CelDataGroupName); |
|
781 |
+ } |
|
782 |
+ else |
|
783 |
+ { |
|
784 |
+ // found the right header, now look for the parameter |
|
785 |
+ ParameterNameValueType nvt; |
|
786 |
+ if (gdh->FindNameValParam(L"affymetrix-channel-wavelength", nvt)) |
|
787 |
+ { |
|
788 |
+ std::wstring channels = nvt.ToString(); |
|
789 |
+ std::wstring::size_type idx = channels.find_first_of(L";", 0); |
|
790 |
+ while (idx != std::wstring::npos) |
|
791 |
+ { |
|
792 |
+ result.push_back(channels.substr(0, idx)); |
|
793 |
+ channels = channels.substr(idx+1); |
|
794 |
+ idx = channels.find_first_of(L";", 0); |
|
795 |
+ } |
|
796 |
+ result.push_back(channels); |
|
797 |
+ } |
|
798 |
+ // Only one channel is found, this is the case when MC scanner operates in single channel mode. |
|
799 |
+ if (result.size() == 1) |
|
800 |
+ { |
|
801 |
+ result.clear(); |
|
802 |
+ result.push_back(CelDataGroupName); |
|
803 |
+ } |
|
804 |
+ } |
|
805 |
+ return result; |
|
806 |
+} |
|
807 |
+ |
|
687 | 808 |
/* |
688 | 809 |
* Get the number of cols of cells |
689 | 810 |
*/ |
... | ... |
@@ -781,17 +902,68 @@ void CelFileData::ComputeXY(int32_t cellIdx, int16_t& x, int16_t& y) |
781 | 902 |
x = (int16_t)(cellIdx - GetCols()*y); |
782 | 903 |
} |
783 | 904 |
|
905 |
+/* |
|
906 |
+ */ |
|
907 |
+std::wstring CelFileData::GetDatHeader() |
|
908 |
+{ |
|
909 |
+ std::wstring datHeader; |
|
910 |
+ |
|
911 |
+ //GenDataHdrVectorIt begin, end; |
|
912 |
+ GenericDataHeader* gdh = this->GetFileHeader()->GetGenericDataHdr()->FindParent(MULTI_SCAN_ACQUISITION_DATA_TYPE); |
|
913 |
+ if (gdh) |
|
914 |
+ { |
|
915 |
+ // found the right header, now look for the parameter |
|
916 |
+ ParameterNameValueType nvt; |
|
917 |
+ if (gdh->FindNameValParam(DAT_HEADER_PARAM_NAME, nvt)) |
|
918 |
+ { |
|
919 |
+ if (nvt.GetParameterType() == ParameterNameValueType::TextType) |
|
920 |
+ datHeader = nvt.GetValueText(); |
|
921 |
+ } |
|
922 |
+ else if (gdh->FindNameValParam(PARTIAL_DAT_HEADER_PARAM_NAME, nvt)) |
|
923 |
+ { |
|
924 |
+ if (nvt.GetParameterType() == ParameterNameValueType::TextType) |
|
925 |
+ { |
|
926 |
+ std::wstring partialDatHeader = nvt.GetValueText(); |
|
927 |
+ |
|
928 |
+ u_int16_t min = 0; |
|
929 |
+ u_int16_t max = 0; |
|
930 |
+ |
|
931 |
+ // Find the max and min parameters and append to the string. |
|
932 |
+ if (gdh->FindNameValParam(MAX_PIXEL_INTENSITY_PARAM_NAME, nvt)) |
|
933 |
+ { |
|
934 |
+ if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type) |
|
935 |
+ max = nvt.GetValueUInt16(); |
|
936 |
+ } |
|
937 |
+ |
|
938 |
+ if (gdh->FindNameValParam(MIN_PIXEL_INTENSITY_PARAM_NAME, nvt)) |
|
939 |
+ { |
|
940 |
+ if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type) |
|
941 |
+ min = nvt.GetValueUInt16(); |
|
942 |
+ } |
|
943 |
+ |
|
944 |
+ wchar_t buf[30]=L""; |
|
945 |
+ FormatString2(buf, 30, L"[%d..%d]", min, max); |
|
946 |
+ datHeader = buf; |
|
947 |
+ datHeader += partialDatHeader; |
|
948 |
+ } |
|
949 |
+ } |
|
950 |
+ } |
|
951 |
+ return datHeader; |
|
952 |
+} |
|
953 |
+ |
|
784 | 954 |
/* |
785 | 955 |
* Find a DataSetHeader by name. |
786 | 956 |
*/ |
787 | 957 |
DataSetHeader* CelFileData::FindDataSetHeader(const std::wstring& name) |
788 | 958 |
{ |
789 |
- DataGroupHeader* dch = genericData.FindDataGroupHeader(CelDataGroupName); |
|
790 |
- if (dch) |
|
959 |
+ DataGroupHeader* grpHdr = genericData.FindDataGroupHeader(activeChannel); |
|
960 |
+ if (grpHdr) |
|
791 | 961 |
{ |
792 |
- DataSetHeader* dph = genericData.FindDataSetHeader(dch, name); |
|
793 |
- if (dph) |
|
794 |
- return dph; |
|
962 |
+ DataSetHeader* setHdr = genericData.FindDataSetHeader(grpHdr, name); |
|
963 |
+ if (setHdr) |
|
964 |
+ { |
|
965 |
+ return setHdr; |
|
966 |
+ } |
|
795 | 967 |
} |
796 | 968 |
return 0; |
797 | 969 |
} |
... | ... |
@@ -845,3 +1017,28 @@ bool CelFileData::FindAlgorithmParameter(const std::wstring& name, ParameterName |
845 | 1017 |
} |
846 | 1018 |
return false; |
847 | 1019 |
} |
1020 |
+ |
|
1021 |
+ |
|
1022 |
+/* |
|
1023 |
+ * Returns the list of parameters associated with a data set. |
|
1024 |
+ */ |
|
1025 |
+ParameterNameValueTypeList CelFileData::GetDataSetParameters(const std::wstring &setName) |
|
1026 |
+{ |
|
1027 |
+ ParameterNameValueTypeList params; |
|
1028 |
+ DataSet *set = genericData.DataSet(activeChannel, setName); |
|