File: test.sh.in

package info (click to toggle)
pigx-rnaseq 0.0.10%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,680 kB
  • sloc: python: 448; makefile: 332; sh: 320; lisp: 11
file content (45 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

set -e
set -u

root=$(mktemp --tmpdir -d "pigx.XXXX")
testfolder=${root}/tests/test_genome_coverage
mkdir -p ${testfolder}

echo "TEST FOLDER: ${testfolder}"

# copy necessary input files to the test folder
# we copy them to avoid re-creating these files when testing the pipeline
cp -r ${srcdir}/tests/sample_data/preprocessed/mapped_reads/ ${testfolder}

# make these copies writable
chmod +w -R ${testfolder}

# prepare temporary sample sheet and settings files
settings=${srcdir}/tests/settings_no_de.yaml
tmp_settings="${testfolder}/settings.yaml"
sed -e "s,reads-dir: ,reads-dir: ${srcdir}/tests/,g" \
    -e "s,genome-fasta: ,genome-fasta: ${srcdir}/tests/,g" \
    -e "s,cdna-fasta: ,cdna-fasta: ${srcdir}/tests/,g" \
    -e "s,gtf-file: ,gtf-file: ${srcdir}/tests/,g" \
    -e "s,output-dir:.*,output-dir: ${testfolder},g" \
    ${settings} > ${tmp_settings}

#create links to already preprocessed sample data
samplesheet=${srcdir}/tests/sample_sheet.csv
tmp_samplesheet="${testfolder}/sample_sheet.csv"
head -n 2 ${samplesheet} > ${tmp_samplesheet}

${builddir}/pigx-rnaseq -s ${tmp_settings} --target genome_coverage ${tmp_samplesheet}

rm ${tmp_settings} ${tmp_samplesheet}

rm -rf ${testfolder}/mapped_reads/

if ! test -f ${testfolder}/bigwig_files/HBR_Rep1.forward.bigwig
then
  echo "ERROR: failed to create bigwig file from input BAM file"
  exit 1
fi