Skip to content
Snippets Groups Projects
Commit a7dd8838 authored by Dr. Mohamed Mohamed Hefny Salim's avatar Dr. Mohamed Mohamed Hefny Salim
Browse files

add analysis_kraken script

parent 469bf4d1
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
################################################################################
# analysis_kraken #
# #
# Script for taxonomic sequence classification of the using kraken #
# #
# #
# description: to be added #
# #
# Copyright (C) 2020 Rahma Amen (Potsdam University) #
# amen@uni-potsdam.de #
# #
# Change History #
# 29/10/2020 Rahma Amen created the script #
# #
# ToDo: #
# - Use kraken2 #
# #
################################################################################
## Define in/out folders and variables
DBNAME=/mnt/scratch/mathnat/ibb/amen/STOMACH_ANALYSIS/TEST_ANALYSIS/DATABASE_KRAKEN/
DATA_TRIMMED=/mnt/scratch/mathnat/ibb/amen/STOMACH_ANALYSIS/TEST_ANALYSIS/DATA_TRIMMED
OUT_DIR=/mnt/scratch/mathnat/ibb/amen/STOMACH_ANALYSIS/TEST_ANALYSIS/KRAKEN_ANALYSIS/
## Creat custom database
# to be written
# http://ccb.jhu.edu/software/kraken/MANUAL.html#custom-databases
#
# Temporary fix for people using conda's version of kraken or kraken2: Run these commands prior to kraken-build --db . --download-taxonomy:
# wget ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/nucl_gb.accession2taxid.gz
# wget ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/nucl_wgs.accession2taxid.gz
# touch accmap.dlflag
# and put those files into the "taxonomy" folder
#
for fR in $DATA_TRIMMED/*R1_001_trimmed.fastq.gz
do
# file stem (without extension or path)
fstem=$(echo $fR | sed 's/.*\///' | sed 's/1_001_trimmed.fastq.gz//')
fR1=$DATA_TRIMMED/$fstem"1_001_trimmed.fastq.gz"
fR2=$DATA_TRIMMED/$fstem"2_001_trimmed.fastq.gz"
fout=$OUT_DIR$fstem"_kraken"
frep=$OUT_DIR$fstem"_report"
ftrn=$OUT_DIR$fstem"_translate"
kraken --paired $fR1 $fR2 --db $DBNAME > $fout
kraken-report $fout --db $DBNAME > $frep
kraken-translate $fout --db $DBNAME > $ftrn
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment