de8ca293b4eda9ba40ff55ffb3bf94827a65b561 kate Mon Nov 27 15:42:22 2017 -0800 Cleanup to ease some fixes to longTabix. diff --git src/lib/longTabix.c src/lib/longTabix.c new file mode 100644 index 0000000..06a9f67 --- /dev/null +++ src/lib/longTabix.c @@ -0,0 +1,44 @@ +/* longTabix -- long range pairwise interaction format, from Wash U + * Documented here: http://wiki.wubrowse.org/Long-range + */ + +/* Copyright (C) 2017 The Regents of the University of California + * See README in this or parent directory for licensing information. */ + +#include "common.h" +#include "asParse.h" +#include "annoStreamer.h" +#include "bedTabix.h" + + +static char *longTabixAutoSqlString = +"table longTabix\n" +"\"Long Range Tabix file\"\n" +" (\n" +" string chrom; \"Reference sequence chromosome or scaffold\"\n" +" uint chromStart; \"Start position in chromosome\"\n" +" uint chromEnd; \"End position in chromosome\"\n" +" string interactingRegion; \"(e.g. chrX:123-456,3.14, where chrX:123-456 is the coordinate of the mate, and 3.14 is the score of the interaction)\"\n" +" uint id; \"Unique Id\"\n" +" char[1] strand; \"+ or -\"\n" +" )\n" +; + +struct asObject *longTabixAsObj() +// Return asObject describing fields of longTabix file +{ +return asParseText(longTabixAutoSqlString); +} + +struct annoStreamLongTabix + { + struct annoStreamer streamer; // Parent class members & methods + // Private members + char *asWords[6]; // Current row of longTabix with genotypes squashed for autoSql + struct bedTabixFile *btf; // longTabix parsed header and file object + int numFileCols; // Number of columns in longTabix file. + int maxRecords; // Maximum number of annoRows to return. + int recordCount; // Number of annoRows we have returned so far. + boolean eof; // True when we have hit end of file or maxRecords + }; +