41723d134f8b0c52c78705c2e5da97f8875e3cf6 angie Wed Feb 15 11:44:39 2017 -0800 Added HGVS terms as variant input option in hgVai. refs #11460 diff --git src/inc/vcf.h src/inc/vcf.h index 41da5e6..872c5a9 100644 --- src/inc/vcf.h +++ src/inc/vcf.h @@ -177,30 +177,37 @@ break; case vcfInfoString: fprintf(f, "%s", datum.datString); break; default: errAbort("vcfPrintDatum: Unrecognized type %d", type); break; } } #define VCF_IGNORE_ERRS (INT_MAX - 1) struct vcfFile *vcfFileNew(); /* Return a new, empty vcfFile object. */ +struct vcfFile *vcfFileFromHeader(char *name, char *headerString, int maxErr); +/* Parse the VCF header string into a vcfFile object with no rows. + * name is for error reporting. + * If maxErr is non-negative then continue to parse until maxErr+1 errors have been found. + * A maxErr less than zero does not stop and reports all errors. + * Set maxErr to VCF_IGNORE_ERRS for silence. */ + 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 @@ -294,16 +301,19 @@ /* Find the genotype infoElement for key, or return NULL. */ char *vcfFilePooledStr(struct vcfFile *vcff, char *str); /* Allocate memory for a string from vcff's shared string pool. */ #define VCF_NUM_COLS 10 struct asObject *vcfAsObj(); // Return asObject describing fields of VCF char *vcfGetSlashSepAllelesFromWords(char **words, struct dyString *dy); /* Overwrite dy with a /-separated allele string from VCF words, * skipping the extra initial base that VCF requires for indel alleles if necessary. * Return dy->string for convenience. */ +void vcfRecordWriteNoGt(FILE *f, struct vcfRecord *rec); +/* Write the first 8 columns of VCF rec to f. Genotype data will be ignored if present. */ + #endif // vcf_h