static void showTableFieldsCt(char *db, char *table, boolean withGetButton) /* Put up html table with a check box for each field of custom * track. */ { struct customTrack *ct = ctLookupName(table); char *type = ct->dbTrackType; if (type == NULL) type = ct->tdb->type; struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); struct asObject *asObj = asForTdb(conn, ct->tdb); if (asObj) { struct slName *fieldList = NULL; if (ct->dbTableName != NULL) { if (isVcfTable(table, NULL)) fieldList = vcfGetFields(); else fieldList = sqlListFields(conn, ct->dbTableName); } if (fieldList == NULL) fieldList = asColNames(asObj); showTableFieldsOnList(db, table, asObj, fieldList, FALSE, withGetButton); asObjectFree(&asObj); slNameFreeList(&fieldList); } else showBedTableFields(db, table, ct->fieldCount, withGetButton); hFreeConn(&conn); }
struct slName *vcfGetFields() /* Get fields of vcf as simple name list. */ { struct asObject *as = vcfAsObj(); struct slName *names = asColNames(as); return names; }
struct slName *bigBedGetFields(char *table, struct sqlConnection *conn) /* Get fields of bigBed as simple name list. */ { char *fileName = bigBedFileName(table, conn); struct bbiFile *bbi = bigBedFileOpen(fileName); struct asObject *as = bigBedAsOrDefault(bbi); struct slName *names = asColNames(as); freeMem(fileName); bbiFileClose(&bbi); return names; }
struct slName *bamGetFields() /* Get fields of bam as simple name list. */ { struct asObject *as = bamAsObj(); return asColNames(as); }