060ada2535fca719656219c1214a3e1c16490693 tdreszer Wed Nov 9 16:06:41 2011 -0800 Moved as code in hgTables down to lib and access it from hgc and hgTrackUi. This is to remove 'extraFields' support as per Jim's request in redmine 5883 and 5582 diff --git src/lib/vcf.c src/lib/vcf.c index 0fe7ef2..bc29dad 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -858,15 +858,37 @@ const struct vcfGenotype *vcfRecordFindGenotype(struct vcfRecord *record, char *sampleId) /* Find the genotype and associated info for the individual, or return NULL. * This calls vcfParseGenotypes if it has not already been called. */ { struct vcfFile *vcff = record->file; if (sampleId == NULL || vcff->genotypeCount == 0) return NULL; vcfParseGenotypes(record); int ix = stringArrayIx(sampleId, vcff->genotypeIds, vcff->genotypeCount); if (ix >= 0) return &(record->genotypes[ix]); return NULL; } +static char *vcfDataLineAutoSqlString = +"table vcfDataLine" +"\"The fields of a Variant Call Format data line\"" +" (" +" string chrom; \"An identifier from the reference genome\"" +" uint pos; \"The reference position, with the 1st base having position 1\"" +" string id; \"Semi-colon separated list of unique identifiers where available\"" +" string ref; \"Reference base(s)\"" +" string alt; \"Comma separated list of alternate non-reference alleles called on at least one of the samples\"" +" string qual; \"Phred-scaled quality score for the assertion made in ALT. i.e. give -10log_10 prob(call in ALT is wrong)\"" +" string filter; \"PASS if this position has passed all filters. Otherwise, a semicolon-separated list of codes for filters that fail\"" +" string info; \"Additional information encoded as a semicolon-separated series of short keys with optional comma-separated values\"" +" string format; \"If genotype columns are specified in header, a semicolon-separated list of of short keys starting with GT\"" +" string genotypes; \"If genotype columns are specified in header, a tab-separated set of genotype column values; each value is a colon-separated list of values corresponding to keys in the format column\"" +" )"; + +struct asObject *vcfAsObj() +// Return asObject describing fields of VCF +{ +return asParseText(vcfDataLineAutoSqlString); +} +