0c1d13ef4e3214c4029e098ed5ef708d15e6096f max Mon Nov 21 16:34:53 2016 -0800 CIRM: As per Jim: adding the trackDb tag 'bigDataIndex'. It allows to specify the URL of the .tbi or .bai file, in case you cannot put it alongside the .bam or .vcf.gz file. diff --git src/inc/vcf.h src/inc/vcf.h index 45b146c..41da5e6 100644 --- src/inc/vcf.h +++ src/inc/vcf.h @@ -187,30 +187,39 @@ #define VCF_IGNORE_ERRS (INT_MAX - 1) struct vcfFile *vcfFileNew(); /* Return a new, empty vcfFile object. */ struct vcfFile *vcfFileMayOpen(char *fileOrUrl, char *chrom, int start, int end, int maxErr, int maxRecords, boolean parseAll); /* Open fileOrUrl and parse VCF header; return NULL if unable. * If chrom is non-NULL, scan past any variants that precede {chrom, chromStart}. * Note: this is very inefficient -- it's better to use vcfTabix if possible! * If parseAll, then read in all lines in region, parse and store in * vcff->records; if maxErr >= zero, then continue to parse until * there are maxErr+1 errors. A maxErr less than zero does not stop * and reports all errors. Set maxErr to VCF_IGNORE_ERRS for silence. */ +struct vcfFile *vcfTabixFileAndIndexMayOpen(char *fileOrUrl, char *tbiFileOrUrl, char *chrom, int start, int end, + int maxErr, int maxRecords); +/* Open a VCF file that has been compressed and indexed by tabix and + * parse VCF header, or return NULL if unable. tbiFileOrUrl can be NULL. + * If chrom is non-NULL, seek to the position range and parse all lines in + * range into vcff->records. If maxErr >= zero, then continue to parse until + * there are maxErr+1 errors. A maxErr less than zero does not stop + * and reports all errors. Set maxErr to VCF_IGNORE_ERRS for silence */ + struct vcfFile *vcfTabixFileMayOpen(char *fileOrUrl, char *chrom, int start, int end, int maxErr, int maxRecords); /* Open a VCF file that has been compressed and indexed by tabix and * parse VCF header, or return NULL if unable. If chrom is non-NULL, * seek to the position range and parse all lines in range into * vcff->records. If maxErr >= zero, then continue to parse until * there are maxErr+1 errors. A maxErr less than zero does not stop * and reports all errors. Set maxErr to VCF_IGNORE_ERRS for silence. */ int vcfTabixBatchRead(struct vcfFile *vcff, char *chrom, int start, int end, int maxErr, int maxRecords); // Reads a batch of records from an opened and indexed VCF file, adding them to // vcff->records and returning the count of new records added in this batch. // Note: vcff->records will continue to be sorted, even if batches are loaded // out of order. Additionally, resulting vcff->records will contain no duplicates