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/hg/hgTables/vcf.c src/hg/hgTables/vcf.c index 1493464..ef7fd6b 100644 --- src/hg/hgTables/vcf.c +++ src/hg/hgTables/vcf.c @@ -7,74 +7,50 @@ #include "asParse.h" #include "hgBam.h" #include "linefile.h" #include "localmem.h" #include "obscure.h" #include "vcf.h" #include "web.h" #if (defined USE_TABIX && defined KNETFILE_HOOKS) #include "knetUdc.h" #include "udc.h" #endif//def USE_TABIX && KNETFILE_HOOKS #define VCFDATALINE_NUM_COLS 10 -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\"" -" )"; - boolean isVcfTable(char *table) /* Return TRUE if table corresponds to a VCF file. */ { -if (isHubTrack(table)) - { struct trackDb *tdb = hashFindVal(fullTrackAndSubtrackHash, table); - return startsWithWord("vcfTabix", tdb->type); - } +if (tdb) + return tdbIsVcf(tdb); else return trackIsType(database, table, curTrack, "vcfTabix", ctLookupName); } char *vcfFileName(char *table, struct sqlConnection *conn, char *seqName) /* Return file name associated with VCF. This handles differences whether it's * a custom or built-in track. Do a freeMem on returned string when done. */ { char *fileName = bigFileNameFromCtOrHub(table, conn); if (fileName == NULL) fileName = bamFileNameFromTable(conn, table, seqName); return fileName; } -struct asObject *vcfAsObj() -/* Return asObject describing fields of VCF */ -{ -return asParseText(vcfDataLineAutoSqlString); -} - struct hTableInfo *vcfToHti(char *table) /* Get standard fields of VCF into hti structure. */ { struct hTableInfo *hti; AllocVar(hti); hti->rootName = cloneString(table); hti->isPos= TRUE; strcpy(hti->chromField, "chrom"); strcpy(hti->startField, "pos"); strcpy(hti->nameField, "id"); hti->type = cloneString("vcfTabix"); return hti; } struct slName *vcfGetFields(char *table)