Skip to content

update installation method for search with kraken2 #116

update installation method for search with kraken2

update installation method for search with kraken2 #116

# This is a subsampling unit test to get early results
on:
push:
branches: [master, dev, esearch-input]
name: Listeria-with-Kraken1
env:
TSV: "Kalamari/src/Listeria.tsv"
OUTDIR: "Listeria.out"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04' ]
perl: [ '5.32' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
multi-thread: "true"
- name: checkout my repo
uses: actions/checkout@v4
with:
path: Kalamari
- name: env check
run: |
echo $PATH | tr ':' '\n' | sort
- name: apt-get install
run: sudo apt-get install ca-certificates tree
- name: install jellyfish
run: |
wget https://github.com/gmarcais/Jellyfish/releases/download/v1.1.12/jellyfish-linux -O jellyfish1
chmod -v +x jellyfish1
ln -sv jellyfish1 jellyfish
echo $(realpath .) >> $GITHUB_PATH
tree $(realpath .)
- name: install-edirect
run: |
sh -c "$(curl -fsSL https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)"
echo $HOME/edirect >> $GITHUB_PATH
echo $GITHUB_WORKSPACE/Kalamari/bin >> $GITHUB_PATH
tree $HOME/edirect
- name: check-env
run: echo "$PATH"
- name: select for only Listeria
run: |
head -n 1 Kalamari/src/chromosomes.tsv > ${{ env.TSV }}
grep -m 2 Listeria Kalamari/src/chromosomes.tsv >> ${{ env.TSV }}
echo "These are the Listeria genomes for downstream tests"
column -ts $'\t' ${{ env.TSV }}
hexdump -c ${{ env.TSV }}
- name: download
run: |
perl Kalamari/bin/downloadKalamari.pl --outdir ${{ env.OUTDIR }} ${{ env.TSV }}
find ${{ env.OUTDIR }} -name '*.fasta.gz' | xargs gunzip -v
- name: check-results
run: tree ${{ env.OUTDIR }}
- name: install kraken
run: |
wget https://github.com/DerrickWood/kraken/archive/refs/tags/v1.1.1.tar.gz -O kraken-v1.1.1.tar.gz
tar zxvf kraken-v1.1.1.tar.gz
cd kraken-1.1.1 && bash install_kraken.sh kraken-src && cd -
chmod -v +x kraken-1.1.1/kraken-src/*
echo $(realpath kraken-1.1.1/kraken-src) >> $GITHUB_PATH
tree $(realpath) kraken-1.1.1
- name: build taxonomy
run: |
export PATH=$PATH:Kalamari/bin
buildTaxonomy.sh
ls -lh Kalamari/share
- name: Kraken1 database
run: |
echo $PATH
which kraken-build
mkdir -pv kraken
cp -rv Kalamari/share/kalamari-*/taxonomy kraken/taxonomy
find ${{ env.OUTDIR }} -name '*.fasta' -exec kraken-build --db kraken --add-to-library {} \;
tree kraken
# Some super debugging here with -x
#sed -i.bak 's/set -e/set -e; set -x/' $(which build_kraken_db.sh)
#grep -v '^#' -m 20 -C 2 $a_bin/build_kraken_db.sh
echo ".....Building the database....."
kraken-build --minimizer-len 9 --rebuild --db kraken --threads 2 --work-on-disk
- name: Kraken1 query
run: |
QUERY=$(find ${{ env.OUTDIR }} -name '*.fasta' | head -n 1)
echo "Query is $QUERY"
kraken --db kraken -output kraken.raw --fasta-input $QUERY
- name: Kraken1 view results
run: |
tree kraken
ls -lhSR kraken
echo
head kraken.raw