<jupyter_start><jupyter_text>Get Ensembl Gene ListThis notebooks demonstrate how to get a list with all human genes in the Ensembl database. It uses `pyensembl` package.<jupyter_code>import pandas as pd
from pyensembl import EnsemblRelease

ENSEMBL_RELEASE = 97

# release 97 uses human reference genome GRCh38
data = EnsemblRelease(ENSEMBL_RELEASE)<jupyter_output><empty_output><jupyter_text>Get all data about genes. Count them.<jupyter_code>human_genes = data.genes()
len(human_genes)<jupyter_output><empty_output><jupyter_text>See what information about the gene is recorded.<jupyter_code>human_genes[0]<jupyter_output><empty_output><jupyter_text>Let us reformat `human_genes` list into DataFrame object.<jupyter_code>human_genes_tuples = [(x.gene_id, x.gene_name, x.biotype, x.contig, x.start, x.end, x.strand) for x in human_genes]
human_genes_table = pd.DataFrame.from_records(human_genes_tuples, columns=["id", "symbol", "biotype", "chr", "start", "end", "strand"])
assert all(human_genes_table.start <= human_genes_table.end)

human_genes_table.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10366972477064221, 'fraction_numerical': 0.006422018348623854, 'mean_word_length': 8.405172413793103, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '137980', 'license': 'MIT', 'n_tokens_mistral': 400, 'n_tokens_neox': 371, 'n_words': 87, 'path': 'notebooks/Get_Ensembl_Gene_List.ipynb', 'repo_name': 'simecek/rbp', 'size': '1090'}