Legofit
infers population history from nucleotide site patterns.
|
Class DAFReader: read a daf file. More...
#include "dafreader.h"
#include "tokenizer.h"
#include "misc.h"
#include "error.h"
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <unistd.h>
Macros | |
#define | MAXFIELDS 5 |
#define | MAX(X, Y) ((X) > (Y) ? (X) : (Y)) |
#define | MIN(X, Y) ((X) > (Y) ? (Y) : (X)) |
Functions | |
int | iscomment (const char *s) |
Return 1 if first non-white character in string is '#'; 0 otherwise. | |
int | DAFReader_cmp (const DAFReader *lhs, const DAFReader *rhs) |
Compare two DAFReader objects. More... | |
DAFReader * | DAFReader_new (const char *fname) |
DAFReader constructor. | |
void | DAFReader_clearChromosomes (int n, DAFReader *r[n]) |
Clear all chromosome names. | |
void | DAFReader_free (DAFReader *self) |
DAFReader destructor. | |
int | DAFReader_next (DAFReader *self) |
Read the next site. More... | |
int | DAFReader_rewind (DAFReader *self) |
Rewind daf file. More... | |
int | DAFReader_multiNext (int n, DAFReader *r[n]) |
int | DAFReader_allelesMatch (int n, DAFReader *r[n]) |
Return 1 if ancestral and derived alleles of all readers match; 0 otherwise. | |
void | DAFReader_printHdr (FILE *fp) |
Print header for daf file. | |
void | DAFReader_print (DAFReader *r, FILE *fp) |
Print current line of daf file. | |
double | DAFReader_daf (DAFReader *r) |
Return derived allele frequency of current line of daf file. | |
Class DAFReader: read a daf file.
Compare two DAFReader objects.
If the "chr" fields differ, return positive if lhs->chr > rhs->chr; return negative if the reverse inequality holds. Otherwise return positive, 0, or negative to match the sign of lhs->nucpos - rhs->nucpos.
int DAFReader_next | ( | DAFReader * | self | ) |
Read the next site.
References iscomment(), strlowercase(), Tokenizer_print(), Tokenizer_printSummary(), Tokenizer_split(), Tokenizer_strip(), and Tokenizer_token().
int DAFReader_rewind | ( | DAFReader * | self | ) |
Rewind daf file.