Skip to content

Commit

Permalink
update container setup
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarousseau committed Jul 23, 2024
1 parent dc275da commit 9745e4a
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 4,367 deletions.
69 changes: 50 additions & 19 deletions src/rsem/rsem_calculate_expression/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ argument_groups:
multiple: true
- name: "--index"
type: file
must_exist: false
description: RSEM index.
- name: "--extra_args"
type: string
Expand Down Expand Up @@ -81,29 +82,59 @@ resources:
test_resources:
- type: bash_script
path: test.sh
- path: /testData/minimal_test/input_fastq/SRR6357070_1.fastq.gz
- path: /testData/minimal_test/input_fastq/SRR6357070_2.fastq.gz
- path: /testData/minimal_test/reference/rsem.tar.gz

# TODO: Install bowtie/bowtie2
- path: test_data

engines:
- type: docker
image: ubuntu:22.04
setup:
- type: docker
run: |
apt-get update && \
apt-get install -y --no-install-recommends build-essential gcc g++ make wget zlib1g-dev unzip && \
apt-get clean && \
wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/2.7.11a.zip && \
unzip 2.7.11a.zip && \
cp STAR-2.7.11a/bin/Linux_x86_64_static/STAR /usr/local/bin && \
cd && \
wget --no-check-certificate https://github.com/deweylab/RSEM/archive/refs/tags/v1.3.3.zip && \
unzip v1.3.3.zip && \
cd RSEM-1.3.3 && \
make && \
make install
- type: apt
packages:
- build-essential
- gcc
- g++
- make
- wget
- zlib1g-dev
- unzip
- xxd
- perl
- r-base
- bowtie2
- python3-pip
- git
- type: docker
env:
- STAR_VERSION=2.7.11b
- RSEM_VERSION=1.3.3
- TZ=Europe/Brussels
run: |
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
cd /tmp && \
wget --no-check-certificate https://github.com/alexdobin/STAR/archive/refs/tags/${STAR_VERSION}.zip && \
unzip ${STAR_VERSION}.zip && \
cd STAR-${STAR_VERSION}/source && \
make STARstatic CXXFLAGS_SIMD=-std=c++11 && \
cp STAR /usr/local/bin && \
cd /tmp && \
wget --no-check-certificate https://github.com/deweylab/RSEM/archive/refs/tags/v${RSEM_VERSION}.zip && \
unzip v${RSEM_VERSION}.zip && \
cd RSEM-${RSEM_VERSION} && \
make && \
make install && \
rm -rf /tmp/STAR-${STAR_VERSION} /tmp/${STAR_VERSION}.zip && \
rm -rf /tmp/RSEM-${RSEM_VERSION} /tmp/v${RSEM_VERSION}.zip && \
cd && \
apt-get clean && \
echo 'export PATH=$PATH:/usr/local/bin' >> /etc/profile && \
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc && \
/bin/bash -c "source /etc/profile && source ~/.bashrc && echo $PATH && which STAR"
- type: docker
run: |
echo "RSEM: `rsem-calculate-expression --version | sed -e 's/Current version: RSEM v//g'`" > /var/software_versions.txt && \
echo "STAR: `STAR --version | sed -e 's/STAR_//g'`" >> /var/software_versions.txt >> /var/software_versions.txt
runners:
- type: executable
- type: nextflow
21 changes: 7 additions & 14 deletions src/rsem/rsem_calculate_expression/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

## VIASH START
## VIASH END

set -eo pipefail

function clean_up {
Expand All @@ -12,30 +15,20 @@ tmpdir=$(mktemp -d "$meta_temp_dir/$meta_functionality_name-XXXXXXXX")
if [ $par_strandedness == 'forward' ]; then
strandedness='--strandedness forward'
elif [ $par_strandedness == 'reverse' ]; then
strandedness='--strandedness reverse'
strandedness="--strandedness reverse"
else
strandedness=''
fi

IFS="," read -ra input <<< $par_input
IFS=";" read -ra input <<< $par_input

INDEX=$(find -L $meta_resources_dir/ -name "*.grp" | sed 's/\.grp$//')
INDEX=$(find -L "${meta_resources_dir}/${par_index}/" -name "*.grp" | sed 's/\.grp$//')

rsem-calculate-expression \
${meta_cpus:+--num-theads $meta_cpus} \
$strandedness \
${par_paired:+--paired-end} \
$par_extra_args \
${input[*]} \
$INDEX \
$par_id

# Version
text="${meta_functionality_name}:
rsem: $(rsem-calculate-expression --version | sed -e 's/Current version: RSEM v//g')"
if [ -e "$par_versions" ]; then
echo "$text" >> "$par_versions"
mv "$par_versions" "$par_updated_versions"
else
echo "$text" > "$par_updated_versions"
fi

9 changes: 5 additions & 4 deletions src/rsem/rsem_calculate_expression/test.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash

echo ">>> Testing $meta_functionality_name"
echo ">>> Testing $meta_executable"

tar -xavf $meta_resources_dir/rsem.tar.gz
gunzip "${meta_resources_dir}/test_data/rsem.tar.gz"
tar -xf "${meta_resources_dir}/test_data/rsem.tar"

echo ">>> Calculating expression"
"$meta_executable" \
--id WT_REP1 \
--strandedness reverse \
--paired true \
--input "$meta_resources_dir/SRR6357070_1.fastq.gz,$meta_resources_dir/SRR6357070_2.fastq.gz" \
--input "${meta_resources_dir}/test_data/SRR6357070_1.fastq.gz;${meta_resources_dir}/test_data/SRR6357070_2.fastq.gz" \
--index rsem \
--extra_args "--star --star-output-genome-bam --star-gzipped-read-file --estimate-rspd --seed 1" \
--counts_gene WT_REP1.genes.results \
--counts_transctips WT_REP1.isoforms.results \
--counts_transcripts WT_REP1.isoforms.results \
--stat WT_REP1.stat \
--logs WT_REP1.log \
--bam_star WT_REP1.STAR.genome.bam \
Expand Down
Binary file modified src/rsem/rsem_calculate_expression/test_data/SRR6357070_1.fastq.gz
Binary file not shown.
Binary file modified src/rsem/rsem_calculate_expression/test_data/SRR6357070_2.fastq.gz
Binary file not shown.
Binary file modified src/rsem/rsem_calculate_expression/test_data/rsem.tar.gz
Binary file not shown.
11 changes: 11 additions & 0 deletions src/rsem/rsem_calculate_expression/test_data/script.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@
wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq3/testdata/GSE110004/SRR6357070_1.fastq.gz
wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq3/testdata/GSE110004/SRR6357070_2.fastq.gz

# decompress file without keeping the original
gunzip SRR6357070_1.fastq.gz
gunzip SRR6357070_2.fastq.gz

# only keep 100 reads per file
head -n 400 SRR6357070_1.fastq > SRR6357070_1.fastq.tmp
head -n 400 SRR6357070_2.fastq > SRR6357070_2.fastq.tmp

mv SRR6357070_1.fastq.tmp SRR6357070_1.fastq
mv SRR6357070_2.fastq.tmp SRR6357070_2.fastq

72 changes: 0 additions & 72 deletions src/rsem/rsem_prepare_reference/config.vsh.yaml

This file was deleted.

Loading

0 comments on commit 9745e4a

Please sign in to comment.