8a0946dd6870f10cde056ba243f1fb4ec1fd16b4 angie Thu Feb 27 11:58:33 2014 -0800 Adding support for plain VCF custom tracks (as opposed to VCF+tabix),since users seem to want to upload VCF, and as long as the file is not too big it will work OK. This means adding a new track type vcf (as opposed to vcfTabix) and supporting it in hgTracks, hgTrackUi, hgc, hgTables and hgVai. (and others I've forgotten?) refs #12416 diff --git src/hg/hgTables/hgTables.h src/hg/hgTables/hgTables.h index 36dde5f..aa0e7be 100644 --- src/hg/hgTables/hgTables.h +++ src/hg/hgTables/hgTables.h @@ -799,81 +799,83 @@ /* HAL stuff from hal.c */ boolean isHalTable(char *table); /* Return TRUE if table corresponds to a HAL file. */ struct slName *halGetFields(char *table); /* Get fields of hal as simple name list. */ void halTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f); /* BAM stuff from bam.c */ boolean isBamTable(char *table); /* Return TRUE if table corresponds to a BAM file. */ -struct slName *bamGetFields(char *table); +struct slName *bamGetFields(); /* Get fields of bam as simple name list. */ struct sqlFieldType *bamListFieldsAndTypes(); /* Get fields of BAM as list of sqlFieldType. */ struct hTableInfo *bamToHti(char *table); /* Get standard fields of BAM into hti structure. */ void showSchemaBam(char *table, struct trackDb *tdb); /* Show schema on bam. */ void bamTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f); /* Print out selected fields from BAM. If fields is NULL, then print out all fields. */ struct bed *bamGetFilteredBedsOnRegions(struct sqlConnection *conn, char *db, char *table, struct region *regionList, struct lm *lm, int *retFieldCount); /* Get list of beds from BAM, in all regions, that pass filtering. */ struct slName *randomBamIds(char *table, struct sqlConnection *conn, int count); /* Return some semi-random qName based IDs from a BAM file. */ /* VCF (Variant Call Format) stuff from vcf.c */ extern char *vcfDataLineAutoSqlString; -boolean isVcfTable(char *table); -/* Return TRUE if table corresponds to a VCF file. */ +boolean isVcfTable(char *table, boolean *retIsTabix); +/* Return TRUE if table corresponds to a VCF file. + * If retIsTabix is non-NULL, set *retIsTabix to TRUE if this is vcfTabix (not just vcf). */ -struct slName *vcfGetFields(char *table); +struct slName *vcfGetFields(); /* Get fields of VCF as simple name list. */ struct sqlFieldType *vcfListFieldsAndTypes(); /* Get fields of VCF as list of sqlFieldType. */ -struct hTableInfo *vcfToHti(char *table); +struct hTableInfo *vcfToHti(char *table, boolean isTabix); /* Get standard fields of VCF into hti structure. */ -void showSchemaVcf(char *table, struct trackDb *tdb); +void showSchemaVcf(char *table, struct trackDb *tdb, boolean isTabix); /* Show schema on VCF. */ -void vcfTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f); +void vcfTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f, + boolean isTabix); /* Print out selected fields from VCF. If fields is NULL, then print out all fields. */ struct bed *vcfGetFilteredBedsOnRegions(struct sqlConnection *conn, - char *db, char *table, struct region *regionList, - struct lm *lm, int *retFieldCount); + char *db, char *table, struct region *regionList, struct lm *lm, + int *retFieldCount, boolean isTabix); /* Get list of beds from VCF, in all regions, that pass filtering. */ -struct slName *randomVcfIds(char *table, struct sqlConnection *conn, int count); +struct slName *randomVcfIds(char *table, struct sqlConnection *conn, int count, boolean isTabix); /* Return some semi-random IDs from a VCF file. */ /* ----------- Custom track stuff. -------------- */ struct customTrack *getCustomTracks(); /* Get custom track list. */ struct customTrack *ctLookupName(char *name); /* Lookup name in custom track list */ void removeNamedCustom(struct customTrack **pList, char *name); /* Remove named custom track from list if it's on there. */ void flushCustomTracks(); /* Flush custom track list. */