'Returns a naturally sorted list of chroms/contigs for a given dbkey.
Use either chrom or low to specify the starting chrom in the return list.'

def chroms(self, trans, dbkey=None, num=None, chrom=None, low=None):

    self.check_and_reload()
    (dbkey_owner, dbkey) = decode_dbkey(dbkey)
    if dbkey_owner:
        dbkey_user = trans.sa_session.query(trans.app.model.User).filter_by(username=dbkey_owner).first()
    else:
        dbkey_user = trans.user
    genome = None
    twobit_file = None
    if (dbkey_user and ('dbkeys' in dbkey_user.preferences)):
        user_keys = loads(dbkey_user.preferences['dbkeys'])
        if (dbkey in user_keys):
            dbkey_attributes = user_keys[dbkey]
            dbkey_name = dbkey_attributes['name']
            if ('fasta' in dbkey_attributes):
                build_fasta = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(dbkey_attributes['fasta'])
                len_file = build_fasta.get_converted_dataset(trans, 'len').file_name
                build_fasta.get_converted_dataset(trans, 'twobit')
                twobit_file = True
            elif ('len' in dbkey_attributes):
                len_file = trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get(user_keys[dbkey]['len']).file_name
            if len_file:
                genome = Genome(dbkey, dbkey_name, len_file=len_file, twobit_file=twobit_file)
    if (not genome):
        len_ds = trans.db_dataset_for(dbkey)
        if len_ds:
            genome = Genome(dbkey, dbkey_name, len_file=len_ds.file_name)
        elif (dbkey in self.genomes):
            genome = self.genomes[dbkey]
    rval = None
    if genome:
        rval = genome.to_dict(num=num, chrom=chrom, low=low)
    else:
        log.exception('genome    not    found    for    key    %s', dbkey)
    return rval
