def get_novel_gene_ids(cursor):
    """ Fetch IDs of all novel genes in the database """
    query = """SELECT DISTINCT(gene_ID) FROM observed
                   LEFT JOIN gene_annotations AS ga ON ga.ID = observed.gene_ID
                   WHERE (ga.attribute = 'gene_status' AND ga.value = 'NOVEL')
            """
    cursor.execute(query)
    novel_genes = [x[0] for x in cursor.fetchall()]
    return novel_genes