---
tags: GeneLab
title: Baseline steps for running human-read removal
---
# Baseline steps for running human-read removal
## Creating environment
```bash
mamba create -n kraken2 -c conda-forge -c bioconda -c defaults kraken2==2.1.1
```
Or one with nextflow also:
```bash
mamba create -n kraken2-nextflow -c conda-forge -c bioconda -c defaults kraken2==2.1.1 nextflow
```
---
## Setting up reference db
Run these wherever you want to keep the reference db (it's only about 3 GB):
```bash
# here is where I'm putting mine (will need to match what is in the code below)
mkdir -p ~/temp-kraken2-db
cd ~/temp-kraken2-db
# downloading
curl -L -o kraken2-human-db.tar.gz https://ndownloader.figshare.com/files/25627058
# unpacking and decompressing, then removing the tar
tar -xzvf kraken2-human-db.tar.gz && rm kraken2-human-db.tar.gz
```
---
## Getting tiny example data
These are less than a kB.
```bash
curl -L -o Sample-1_R1.fastq.gz https://figshare.com/ndownloader/files/43613283
curl -L -o Sample-1_R2.fastq.gz https://figshare.com/ndownloader/files/43613286
```
---
## Running it
```bash
conda activate kraken2
```
```bash
kraken2 --db ~/temp-kraken2-db/kraken2-human-db --gzip-compressed \
--threads 2 --use-names --paired \
--output Sample-1-kraken2-output.txt \
--report Sample-1-kraken2-report.tsv \
--unclassified-out "Sample-1_R#.fastq" \
Sample-1_R1.fastq.gz Sample-1_R2.fastq.gz
```