// Copyright 2004 by Harry Zuzan. All rights reserved. // This code is part of the Biopython distribution and governed by its // license. Please see the LICENSE file that should have been included // as part of this package. // This source code parses an Affymetrix cel file. // // Documentation to come. // #include "Python.h" #include "Numeric/arrayobject.h" using namespace std; #include #include static PyObject * cel_parse(PyObject * self, PyObject * args) { char * cel_file; int len_cel_file; if (!PyArg_ParseTuple(args, "s#", &cel_file, &len_cel_file)) return 0; dequelines; string tmp_str = ""; for (int i=0; idata)[ncols*row + col] = mean; ((double *)stdev_py->data)[ncols*row + col] = stdev; ((long *)npix_py->data)[ncols*row + col] = npix; } PyObject * returnList = PyList_New(0); PyList_Append( returnList, (PyObject *)mean_py); PyList_Append( returnList, (PyObject *)stdev_py); PyList_Append( returnList, (PyObject *)npix_py); return returnList; } extern "C" { static PyMethodDef celMethods[] = { {"parse", cel_parse, METH_VARARGS }, {NULL, NULL} }; void init_cel() { Py_InitModule("_cel", celMethods); import_array(); // need to when using Numeric Python } };