-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guppy Basecall and Demux process using Google Colab
- Loading branch information
Showing
1 changed file
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"gpuType": "T4" | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
}, | ||
"accelerator": "GPU" | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "gxcweSl4fmRz" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Initiate GPU runtime\n", | ||
"\n", | ||
"import tensorflow as tf\n", | ||
"tf.test.gpu_device_name()\n", | ||
"\n", | ||
"import torch\n", | ||
"torch.cuda.get_device_name(0)\n", | ||
"\n", | ||
"!rm -rf sample_data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"# Install Guppy (Oxford Nanopore Technologies)\n", | ||
"\n", | ||
"%%shell\n", | ||
"\n", | ||
"GUPPY_VERSION=6.5.7 # Archived Software\n", | ||
"\n", | ||
"wget https://cdn.oxfordnanoportal.com/software/analysis/ont-guppy_\"$GUPPY_VERSION\"_linux64.tar.gz -O ont-guppy.tar.gz\n", | ||
"tar -vzxf ont-guppy.tar.gz; rm -rf ont-guppy.tar.gz\n", | ||
"./ont-guppy/bin/guppy_basecaller --version" | ||
], | ||
"metadata": { | ||
"id": "dSavIZSzhTlP" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"# Import Google Drive\n", | ||
"\n", | ||
"from google.colab import drive\n", | ||
"drive.mount('/content/gdrive', force_remount=True)\n", | ||
"\n", | ||
"!ls gdrive/MyDrive" | ||
], | ||
"metadata": { | ||
"id": "i6QNwjcWlX7L" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"# Basecall and Demultiplex process\n", | ||
"\n", | ||
"%%shell\n", | ||
"\n", | ||
"# Specify the name of the folder (i.e., 20240411_1608_MN22990_FAT84733_f175dd69/fast5)\n", | ||
"DIR=\"20240411_1608_MN22990_FAT84733_f175dd69/fast5\"\n", | ||
"\n", | ||
"# Specify the barcode kit used for library preparation\n", | ||
"BARKIT=\"EXP-NBD114\"\n", | ||
"\n", | ||
"PREFIX=\"$(echo \"$IDIR\" | awk -F/ '{print $1}')\"\n", | ||
"\n", | ||
"# Specify the accurate basecalling model - fast (fast), high (hac) or super (sup) accuracy\n", | ||
"# dna_r9.4.1_450bps_fast.cfg\n", | ||
"# dna_r9.4.1_450bps_hac.cfg\n", | ||
"# dna_r9.4.1_450bps_sup.cfg\n", | ||
"./ont-guppy/bin/guppy_basecaller -r --device cuda:0 --verbose_logs \\\n", | ||
"-i \"$IDIR\" -s \"$PREFIX\"_GUPPY-BASECALL --min_qscore 8 \\\n", | ||
"-c \"ont-guppy/data/dna_r9.4.1_450bps_fast.cfg\" \\\n", | ||
"--gpu_runners_per_device 16 --cpu_threads_per_caller $(nproc)\n", | ||
"\n", | ||
"./ont-guppy/bin/guppy_barcoder -r --trim_adapters --barcode_kits \"$BARKIT\" \\\n", | ||
"-i \"$PREFIX\"_GUPPY-FAST -s \"$PREFIX\"_GUPPY-DEMUX -t $(nproc)" | ||
], | ||
"metadata": { | ||
"id": "3h3DJ72AH1I9" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
] | ||
} |