Jan 22, 2024

Public workspaceONT Sequencing IT/Compute Pop!_OS 22.04 Setup V.3

  • 1Mycota Lab;
  • 2The Hoosier Mushroom Society
Open access
Protocol CitationStephen Douglas Russell 2024. ONT Sequencing IT/Compute Pop!_OS 22.04 Setup. protocols.io https://dx.doi.org/10.17504/protocols.io.14egn7kzmv5d/v3Version created by Stephen Douglas Russell
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: January 06, 2024
Last Modified: January 22, 2024
Protocol Integer ID: 93024
Keywords: Oxford Nanopore Technologies, DNA sequencing, DNA barcoding, MinION, Flongle, system76, linux, POP! OS
Abstract
The IT requirements for processing MinION data should be carefully reviewed before purchasing a MinION device. You will want to go with a Linux system. System76 is really the primary/best vendor for laptops. Pay careful attention to the GPU. It is probably the most important component for fast processing of the data. Here is is a link to a Facebook thread of some discussion when first considering the specs required.

Setting up all of the programs/dependencies, particularly for utilizing the GPU during the analytical workflows is the next important step. You will want to get all of this in place before you start with the lab workflows, as there are many things that could go wrong or that you will need to work through in order for you to be able to actually begin a run.
Preparing a new CPU for MinION Sequencing
Preparing a new CPU for MinION Sequencing
The final setup I went with can be found below. It was expensive (around Cost4000 for the laptop in early 2022), but should be able to achieve live basecalling for two MinION devices at the same time. Overall specs of my laptop:

Specs of the System 76 Oryx Pro laptop this protocol uses for ONT sequencing.

Minimum IT requirements for MinION from ONT: Download minion-it-reqs.pdfminion-it-reqs.pdf
The remainder of this protocol assumes you have completed all of the preliminary setup steps that are common with any new CPU.

Command
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda-repo-ubuntu2204-11-7-local_11.7.0-515.43.04-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-11-7-local_11.7.0-515.43.04-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Install Boost

Command
sudo apt install libboost-all-dev

The process at this link was instrumental to this protocol. It is recreated and simplified here. ORIGINAL PROTOCOL. It was written for Pop!_OS 21.04. The following protocols also work with Pop!_OS 22.04. I would follow the steps at the link rather than here so you get a broader context of the actions you are performing on your system.


Command
Add ONT Focal Repository (Pop!_OS 22.04)
# update packages list
sudo apt-get update
# check for and install wget if needed
if [ $(dpkg-query -W -f='${Status}' wget 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
  sudo apt --yes install wget;
fi
# add the key
wget -O- https://mirror.oxfordnanoportal.com/apt/ont-repo.pub | sudo apt-key add -
# add the focal repo
echo "deb http://mirror.oxfordnanoportal.com/apt focal-stable non-free" | sudo tee /etc/apt/sources.list.d/nanoporetech.sources.list

Command
sudo apt update (Pop!_OS 22.04)
sudo apt update

Command
Check for access to ONT files (Pop!_OS 22.04)
apt policy minknow-core-minion-nc


Expected result
minknow-core-minion-nc:
Installed: 4.3.4-focal
Candidate: 4.3.4-focal
Version table:
4.3.4-focal 100
10 http://mirror.oxfordnanoportal.com/apt focal-stable/non-free amd64 Packages
100 /var/lib/dpkg/status





Add the Focal repos:
Command
Create a new file and edit in nano
sudo nano /etc/apt/sources.list.d/system-focal.sources
Copy and paste the following into your file:


X-Repolib-Name: Pop_OS System Sources
Enabled: yes
Types: deb deb-src
URIs: http://us.archive.ubuntu.com/ubuntu/
Suites: focal focal-security focal-updates focal-backports
Components: main restricted universe multiverse
X-Repolib-Default-Mirror: http://us.archive.ubuntu.com/ubuntu/


Command
Check that the file exists and contains the right information. (Pop!_OS 22.04)
cat system-focal.sources

Expected result

X-Repolib-Name: Pop_OS System Sources
Enabled: yes
Types: deb deb-src
URIs: http://us.archive.ubuntu.com/ubuntu/
Suites: focal focal-security focal-updates focal-backports
Components: main restricted universe multiverse
X-Repolib-Default-Mirror: http://us.archive.ubuntu.com/ubuntu/


Pin the Focal repos. Start by creating another new file with nano:


Command
sudo nano /etc/apt/preferences.d/focal-default-settings

Copy and paste the following into your file:


Package: *
Pin: release n=focal*
Pin-Priority: 10

Check that is was created correctly


Command
cat focal-default-settings

Expected result

Package: *
Pin: release n=focal*
Pin-Priority: 10



Command
sudo apt update

Install MinKNOW and required packages


Command
sudo apt install \
  minknow-core-minion-nc \
  ont-kingfisher-ui-minion \
  ont-bream4-minion \
  ont-configuration-customer-minion \
  ont-jwt-auth \
  ont-vbz-hdf-plugin

Install ONT Guppy
Command
sudo apt install ont-guppy

Command
Check the paths once installed
which guppy_basecaller

Expected result

/usr/bin/guppy_basecaller


Command
guppy_basecaller --version

Expected result

: Guppy Basecalling Software, (C) Oxford Nanopore Technologies, Limited. Version 5.0.11+2b6dbff


Setup the MinKnow service

Command
sudo /opt/ont/minknow/bin/config_editor --conf application \
  --filename /opt/ont/minknow/conf/app_conf \
  --set guppy.server_executable="/opt/ont/guppy/bin/guppy_basecall_server" \
  --set guppy.client_executable="/opt/ont/guppy/bin/guppy_basecall_client" \
  --set guppy.gpu_calling=1 \
  --set guppy.num_threads=16 \
  --set guppy.ipc_threads=2

Command
systemctl restart minknow.service

Command
systemctl status minknow.service

Command
sudo nano /lib/systemd/system/guppyd.service
Copy the following to your new file:


[Unit]
Description=Service to manage the guppy basecall server.
Documentation=https://community.nanoporetech.com/protocols/Guppy-protocol/v/GPB_2003_v1_revQ_14Dec2018

[Service]
Type=simple
ExecStart=/opt/ont/guppy/bin/guppy_basecall_server --log_path /var/log/guppy --config dna_r9.4.1_450bps_fast.cfg --port 5555 -x cuda:all
Restart=always
User=root
MemoryLimit=8G
MemoryHigh=8G
CPUQuota=200%

[Install]
Alias=guppyd.service
WantedBy=multi-user.target

Check the file:


Command
cat /lib/systemd/system/guppyd.service

Command
systemctl enable guppyd.service

Command
systemctl restart guppyd.service

MinKNOW GUI should now be available in your programs. Validate that it opens correctly.
Changes to MinKnow file permissions at the bottom here:

"For my computer, there’s an issue with MinKNOW not being able to access or create files. As a “nuclear” option, Miles Benton suggested changing the user and group for the minknow service to root"

Command
sudo service minknow stop
sudo perl -i -pe 's/(User|Group)=minknow/$1=root/' /lib/systemd/system/minknow.service
sudo systemctl daemon-reload
sudo service minknow start


Install R:

Command
# update indices
sudo apt update -qq
# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc 
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"


Command
sudo apt install --no-install-recommends r-base

Command
install.packages(c("data.table", 
                   "futile.logger",
                   "ggplot2",
                   "optparse",
                   "plyr",
                   "readr",
                   "reshape2",
                   "scales",
                   "viridis",
                   "yaml"))

Install Bioconductor:

In an R command window:

Command
if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(version = "3.15")

Install Anaconda:


Command
cd /tmp

Command
curl https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh --output anaconda.sh

Command
You can now verify the data integrity of the installer with cryptographic hash verification through the SHA-256 checksum. You’ll use the sha256sum command along with the filename of the script:
sha256sum anaconda.sh

Expected result
You’ll receive output that looks similar to this:
fedf9e340039557f7b5e8a8a86affa9d299f5e9820144bd7b92ae9f7ee08ac60 anaconda.sh


Command
bash anaconda.sh

Expected result
Press ENTER/yes as needed
Welcome to Anaconda3 2021.11

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>


Command
source ~/.bashrc

Command
conda list

Expected result


# packages in environment at /home/user/anaconda3:
#
# Name Version Build Channel
_ipyw_jlab_nb_ext_conf 0.1.0 py39h06a4308_0
_libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
alabaster 0.7.12 pyhd3eb1b0_0
anaconda 2022.05 py39_0



Command
conda search "^python$"

Command
conda create --name my_env python=3

Command
conda activate my_env

Command
Verify Python is installed
python --version

Command
conda install --name my_env35 numpy



Command
conda create -n NGSpeciesID python=3.6 pip 
conda activate NGSpeciesID

Command
conda install --yes -c conda-forge -c bioconda medaka==0.11.5 openblas==0.3.3 spoa racon minimap2
pip install NGSpeciesID

Command
conda activate NGSpeciesID

Command
Test the install
mkdir test_ngspeciesID
cd test_ngspeciesID

Command
Download the test fastq file called "sample_h1.fastq" (filesize 390kb)
curl -LO https://raw.githubusercontent.com/ksahlin/NGSpeciesID/master/test/sample_h1.fastq

Command
Run the NGSpecies command on test file. Outputs will be saved in "/test_ngspeciesID/sample_h1/", where the final polished consensus file ("consensus.fasta") is located in the "/test_ngspeciesID/sample_h1/medaka_cl_id_" directory.
NGSpeciesID --ont --fastq sample_h1.fastq --outfolder ./sample_h1 --consensus --medaka

You should now be ready to begin sequencing runs.

Updating MinKnow & Installing Dorado
Updating MinKnow & Installing Dorado
Since this protocol was first written, MinKnow needed an update for the 10.4.1 Flongle cells and then again to bring in Dorado basecaclling. The steps to perform the update can be found below:

sudo apt install ont-python=3.10.7-9
sudo apt install ont-bream4-minion=7.8.2-1~focal
sudo apt install ont-configuration-customer-minion=5.8.6-1~focal
sudo apt install ont-kingfisher-ui-minion=5.8.13-1~focal
sudo apt install minknow-core-minion-nc=5.8.3

sudo apt update
sudo apt install wget
echo "deb http://cdn.oxfordnanoportal.com/apt focal-stable non-free" | sudo tee /etc/apt/sources.list.d/nanoporetech.sources.list

sudo apt update
sudo apt install ont-standalone-minknow-gpu-release

Carryover code from last update:

sudo service minknow stop
sudo perl -i -pe 's/(User|Group)=minknow/$1=root/' /lib/systemd/system/minknow.service
sudo systemctl daemon-reload
sudo service minknow start

sudo apt install cuda
conda install -c bioconda seqkit

python -m venv venv --prompt duplex
. venv/bin/activate
pip install duplex_tools

These dependency versions will likely keep changing with time.
Installing Dorado:

sudo -i

sudo apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
ca-certificates \
build-essential \
nvidia-cuda-toolkit \
libhdf5-dev \
libssl-dev \
libzstd-dev \
cmake \
autoconf \
automake
git clone https://github.com/nanoporetech/dorado.git dorado
cd dorado
cmake -S . -B cmake-build
cmake --build cmake-build --config Release -j
ctest --test-dir cmake-build



pip install pre-commit
pre-commit install