data.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* The C clustering library.
  2. * Copyright (C) 2002 Michiel Jan Laurens de Hoon.
  3. *
  4. * This library was written at the Laboratory of DNA Information Analysis,
  5. * Human Genome Center, Institute of Medical Science, University of Tokyo,
  6. * 4-6-1 Shirokanedai, Minato-ku, Tokyo 108-8639, Japan.
  7. * Contact: mdehoon 'AT' gsc.riken.jp
  8. *
  9. * Permission to use, copy, modify, and distribute this software and its
  10. * documentation with or without modifications and for any purpose and
  11. * without fee is hereby granted, provided that any copyright notices
  12. * appear in all copies and that both those copyright notices and this
  13. * permission notice appear in supporting documentation, and that the
  14. * names of the contributors or copyright holders not be used in
  15. * advertising or publicity pertaining to distribution of the software
  16. * without specific prior permission.
  17. *
  18. * THE CONTRIBUTORS AND COPYRIGHT HOLDERS OF THIS SOFTWARE DISCLAIM ALL
  19. * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE
  21. * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT
  22. * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  23. * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  24. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  25. * OR PERFORMANCE OF THIS SOFTWARE.
  26. *
  27. */
  28. #ifndef ClusterDataINCLUDE
  29. #define ClusterDataINCLUDE
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #include <stdio.h> /* contains the FILE declaration */
  33. #endif
  34. /*============================================================================*/
  35. /* Function declaration */
  36. /*============================================================================*/
  37. int GetRows(void);
  38. int GetColumns(void);
  39. char* Load(FILE* file);
  40. /* Load in data from tab-delimited text file */
  41. void Save(FILE* outputfile, int geneID, int arrayID);
  42. void SelectSubset(int useRows, const int use[]);
  43. void LogTransform(void);
  44. void AdjustGenes(int MeanCenter, int MedianCenter, int Normalize);
  45. void AdjustArrays(int MeanCenter, int MedianCenter, int Normalize);
  46. int FilterRow(int Row, int bStd, int bPercent, int bAbsVal, int bMaxMin,
  47. double absVal, double percent, double std, int numberAbs, double maxmin);
  48. const char* CalculateWeights(double GeneCutoff, double GeneExponent,
  49. char GeneDist, double ArrayCutoff, double ArrayExponent, char ArrayDist);
  50. int HierarchicalCluster(FILE* file, char metric, int transpose, char method);
  51. int GeneKCluster(int k, int nTrials, char method, char dist, int* NodeMap);
  52. int ArrayKCluster(int k, int nTrials, char method, char dist, int* NodeMap);
  53. void SaveGeneKCluster(FILE* outputfile, int k, const int* NodeMap);
  54. void SaveArrayKCluster(FILE* outputfile, int k, const int* NodeMap);
  55. void PerformSOM(FILE* GeneFile, int GeneXDim, int GeneYDim, int GeneIters,
  56. double GeneTau, char GeneMetric, FILE* ArrayFile, int ArrayXDim,
  57. int ArrayYDim, int ArrayIters, double ArrayTau, char ArrayMetric);
  58. const char* PerformGenePCA(FILE* coordinatefile, FILE* pcfile);
  59. const char* PerformArrayPCA(FILE* coordinatefile, FILE* pcfile);
  60. void Free(void);
  61. #ifdef __cplusplus
  62. } /* extern C */
  63. #endif
  64. #endif