/* File: bin2hapmap.c * Author: Luke Jostins (lj4@sanger.ac.uk) * Copyright (C) Genome Research Limited, 2008 *------------------------------------------------------------------- * Description: * Exported functions: * HISTORY: * Created: Mon June 22 16:52:22 2009 (lj4) *------------------------------------------------------------------- */ #include #include #include #include #include #include "array.h" #include "dict.h" #include "tools.h" // static int freadString (FILE *fil, char *s, int lenMax) // { int len ; // fread (&len, sizeof(int), 1, fil) ; // if (len > lenMax) // { fprintf (stderr, "string too long (%d/%d)- abort\n",len,lenMax) ; return(0); /*exit (-1) ;*/ } // return fread (s, 1, len, fil) ; // } // static DICT *freadDict (FILE *fil) // { char string[256] ; // DICT *dict ; // int n ; // if (!freadString (fil, string, 256) || strcmp (string, "DICT") // || !fread (&n, 1, sizeof(int), fil)) // printf("failed!\n");//return 0 ; // dict = dictCreate (n) ; // while (n--) // if (!freadString (fil, string, 256) || // !dictAdd (dict, string, 0)) // return 0 ; // return dict ; // } int main (int argc, char *argv[]) { char name2[256] ; FILE *genotypeFile = NULL; DICT *chromDict; /* chromosome names */ int i,n; int *gList; int list_sites = 0; int list_samples = 0; Array chrArray, posArray ; for (i=1; i