Legofit
infers population history from nucleotide site patterns.
|
Class RAFReader: read a raf file. More...
#include "rafreader.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 | RAFReader_cmp (const RAFReader *lhs, const RAFReader *rhs) |
Compare two RAFReader objects. More... | |
void | RAFReader_popen (RAFReader *self) |
RAFReader * | RAFReader_new (const char *fname) |
RAFReader constructor. | |
void | RAFReader_clearChromosomes (int n, RAFReader *r[n]) |
Clear all chromosome names. | |
void | RAFReader_free (RAFReader *self) |
RAFReader destructor. | |
int | RAFReader_next (RAFReader *self) |
Read the next site and set derived allele frequency (daf) within each reader. More... | |
int | RAFReader_rewind (RAFReader *self) |
Rewind raf file. More... | |
int | RAFReader_multiNext (int n, RAFReader *r[n]) |
Advance an array of RAFReaders to the next shared position, and set derived allele frequency within each RAFReader. More... | |
int | RAFReader_findDaf (int n, RAFReader *r[n]) |
Set derived allele frequency within each RAFReader. More... | |
int | RAFReader_alleleCheck (int n, RAFReader *r[n]) |
Return 0 if ref and alt alleles of all readers match; return REF_MISMATCH if there is a mismatch in REF alleles; return MULTIPLE_ALT if there is a mismatch in ALT alleles. | |
void | RAFReader_printHdr (FILE *fp) |
Print header for raf file. | |
void | RAFReader_print (RAFReader *r, FILE *fp) |
Print current line of raf file. | |
void | RAFReader_printArray (int n, RAFReader *r[n], FILE *fp) |
double | RAFReader_raf (RAFReader *r) |
Return reference allele frequency of current line of raf file. | |
double | RAFReader_daf (RAFReader *r) |
Return derived allele frequency of current line of raf file. | |
Class RAFReader: read a raf file.
Compare two RAFReader 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 RAFReader_findDaf | ( | int | n, |
RAFReader * | r[n] | ||
) |
int RAFReader_multiNext | ( | int | n, |
RAFReader * | r[n] | ||
) |
int RAFReader_next | ( | RAFReader * | self | ) |
Read the next site and set derived allele frequency (daf) within each reader.
References iscomment(), strlowercase(), Tokenizer_print(), Tokenizer_split(), Tokenizer_strip(), and Tokenizer_token().
int RAFReader_rewind | ( | RAFReader * | self | ) |
Rewind raf file.