Skip to content

Commit

Permalink
doc: add notebooks for tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Oct 21, 2024
1 parent 360b840 commit b9b697d
Show file tree
Hide file tree
Showing 6 changed files with 1,066 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ perfs_benchmark.log
.env
bench/
.chromnn
*.keras
91 changes: 91 additions & 0 deletions docs/source/tutorials/integrating-multiomics.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Integrating multi-omics data with `momics`\n",
"\n",
"`momics` excels at managing multi-omics data. It allows you to store and retrieve data from a variety of sources. Here, we will see how to create, manage and query local repositories using `momics`.\n",
"\n",
"## Creating a local `momics` repository"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"momics :: INFO :: 2024-10-21 09:31:58,466 :: Purged yeast_CNN_data.momics\n",
"momics :: INFO :: 2024-10-21 09:31:58,471 :: Created yeast_CNN_data.momics\n",
"momics :: INFO :: 2024-10-21 09:32:01,936 :: Genome sequence ingested in 3.4528s.\n",
"momics :: INFO :: 2024-10-21 09:32:03,193 :: 2 tracks ingested in 1.2557s.\n"
]
},
{
"data": {
"text/plain": [
"<momics.momics.Momics at 0x7f1d7c0dc1f0>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from momics.momics import Momics\n",
"\n",
"## Creating repository\n",
"Momics(\"yeast_CNN_data.momics\").remove() # Purging existing files\n",
"repo = Momics(\"yeast_CNN_data.momics\") # Creating a brand new repository\n",
"\n",
"## Registering chromosome sizes\n",
"## We will get chromosome sizes from a local fasta file.\n",
"from pyfaidx import Fasta\n",
"\n",
"f = Fasta(\"/data/momics/S288c.fa\")\n",
"chrom_lengths = {chrom: len(seq) for chrom, seq in zip(f.keys(), f.values())}\n",
"\n",
"repo.ingest_chroms(chrom_lengths, genome_version=\"S288c\")\n",
"repo.chroms()\n",
"\n",
"## Registering sequence\n",
"repo.ingest_sequence(\"/data/momics/S288c.fa\")\n",
"\n",
"## Registering genomic tracks\n",
"repo.ingest_tracks(\n",
" {\n",
" \"ATAC\": \"/data/momics/S288c_atac.bw\",\n",
" \"MNase\": \"/data/momics/S288c_mnase.bw\",\n",
" }\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
1 change: 0 additions & 1 deletion docs/source/tutorials/integrating-multiomics.md

This file was deleted.

Loading

0 comments on commit b9b697d

Please sign in to comment.