/* calcGap - calculate gap scores. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" double scale = 200; int maxGap = 100; int near = 0; char *sampleList = "1,2,3,4,5,6,7,8,9,10,15,20,30,40,60,80,100,150,200,300,400,500,1000,2000,5000,10000,20000,50000,100000"; void usage() /* Explain usage and exit. */ { errAbort( "calcGap - calculate gap scores\n" "usage:\n" " calcGap chainFile\n" "options:\n" " -scale=N Amount to scale scores by - default 94.\n" " -maxGap=N Largest gap to look at. Default 100\n" " -near=N How close to consider something 'almost' a indel\n" " -samples=N,M - List of points to sample\n" ); } int score(double count, double total) /* Return probability as a score. */ { if (count == 0) return 0; return round(scale * log(count/total)); } void getSamples(char *sampleList, int **retSamples, int *retCount) /* Parse out comma separated list. */ { char *words[256]; int i, wordCount = chopCommas(sampleList, words); int *samples; AllocArray(samples, wordCount); for (i=0; i near && yGap > near)) { if (bothGap < maxSample) bothGaps[bothGap] += 1; } else if (xGap <= near) { if (yGap < maxSample) yNear[yGap] += 1; } else if (yGap <= near) { if (xGap < maxSample) xNear[xGap] += 1; } else { assert(FALSE); } } } } if (near) printf("#size: indel\tmGap\thGap\tmNear\thNear\tdouble\n"); else printf("#size: indel\tmGap\thGap\tdouble\n"); for (i=1; i