# barChartBed.sql was originally generated by the autoSql program, which also 
# generated barChartBed.c and barChartBed.h.  This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly 
# automatic way.

#BED6+5 with additional fields for category count and median values, and sample matrix fields
CREATE TABLE barChartBed (
    chrom varchar(255) not null,	# Reference sequence chromosome or scaffold
    chromStart int unsigned not null,	# Start position in chromosome
    chromEnd int unsigned not null,	# End position in chromosome
    name varchar(255) not null,	# Name or ID of item, ideally both human readable and unique
    score int unsigned not null,	# Score from 0-1000, typically derived from total of median value from all categories
    strand char(1) not null,	# + or - for strand. Use . if not applicable
    name2 varchar(255) not null,	# Alternative name for item
    expCount int unsigned not null,	# Number of categories
    expScores longblob not null,	# Comma separated list of category values
    _dataOffset bigint not null,	# Offset of sample data in data matrix file, for boxplot on details page
    _dataLen int not null,	        # Length of sample data row in data matrix file
              #Indices
    INDEX(name),
    INDEX(chrom(20), chromStart)
);
