'Returns all known dbkeys. If chrom_info is True, only dbkeys with
chromosome lengths are returned.'

def get_dbkeys(self, trans, chrom_info=False, **kwd):

    self.check_and_reload()
    dbkeys = []
    user_keys_dict = {}
    user = trans.get_user()
    if user:
        if ('dbkeys' in user.preferences):
            user_keys_dict = loads(user.preferences['dbkeys'])
        dbkeys.extend([(attributes['name'], key) for (key, attributes) in user_keys_dict.items()])
    if chrom_info:
        def filter_fn(b):
            return (b.len_file is not None)
    else:
        def filter_fn(b):
            return True
    dbkeys.extend([(genome.description, genome.key) for (key, genome) in self.genomes.items() if filter_fn(genome)])
    return dbkeys
