src/hg/regulate/regClusterMakeTableOfTables/regClusterMakeTableOfTables.c 1.3
1.3 2010/05/05 00:50:37 kent
Doing another pass at the regulatory clustering - this time whole genome rather than just chromosome 22.
Index: src/hg/regulate/regClusterMakeTableOfTables/regClusterMakeTableOfTables.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/regulate/regClusterMakeTableOfTables/regClusterMakeTableOfTables.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/hg/regulate/regClusterMakeTableOfTables/regClusterMakeTableOfTables.c 10 Mar 2010 19:46:34 -0000 1.2
+++ src/hg/regulate/regClusterMakeTableOfTables/regClusterMakeTableOfTables.c 5 May 2010 00:50:37 -0000 1.3
@@ -4,9 +4,9 @@
#include "hash.h"
#include "options.h"
#include "obscure.h"
#include "sqlNum.h"
-#include "hmmStats.h"
+#include "hmmstats.h"
static char const rcsid[] = "$Id$";
void usage()
@@ -15,8 +15,9 @@
errAbort(
"regClusterMakeTableOfTables - Make up a table of tables for regCluster program\n"
"usage:\n"
" regClusterMakeTableOfTables fileListFile output\n"
+ "Where the fileListFile is a list of narrowPeak format files.\n"
);
}
static struct optionSpec options[] = {
@@ -96,19 +97,20 @@
if (highEnd > maxVal) highEnd = maxVal;
return 1000.0/highEnd;
}
-void regClusterMakeTableOfTables(char *input, char *output)
-/* regClusterMakeTableOfTables - Make up a table of tables for regCluster program. */
+void makeTableFromFileNames(char *input, char *output)
+/* makeTableFromFileNames - Make up a table of tables for regCluster from
+ * input that is a list of file names that include metadata. */
{
FILE *f = mustOpen(output, "w");
struct slName *in, *inList = readAllLines(input);
int commonPrefix = commonPrefixSize(inList);
int commonSuffix = commonSuffixSize(inList);
for (in = inList; in != NULL; in = in->next)
{
- fprintf(f, "%s\t1\t2\t3\t7\t", in->name);
- fprintf(f, "%g\t", calcNormScoreFactor(in->name, 7));
+ fprintf(f, "%s\t0\t1\t2\t6\t", in->name);
+ fprintf(f, "%g\t", calcNormScoreFactor(in->name, 6));
char *s = in->name;
int len = strlen(s);
char *midString = cloneStringZ(s+commonPrefix, len - commonPrefix - commonSuffix);
fprintf(f, "%s\n", midString);
@@ -116,8 +118,14 @@
}
carefulClose(&f);
}
+void regClusterMakeTableOfTables(char *input, char *output)
+/* regClusterMakeTableOfTables - Make up a table of tables for regCluster program. */
+{
+makeTableFromFileNames(input, output);
+}
+
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, options);