annotate test/test-multi @ 1:60c360e466a8 draft default tip

planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit 0f382a5296aae9bfc77df06b0a5ad493eb3c01f3
author ethevenot
date Wed, 28 Feb 2018 10:04:14 -0500
parents 4b9488602d57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
1 #!/bin/bash
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
2
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
3 # Constants {{{1
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
4 ################################################################
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
5
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
6 PROG_PATH=$(dirname $0)
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
7
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
8 # MAIN {{{1
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
9 ################################################################
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
10
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
11 $PROG_PATH/../multivariate_wrapper.R dataMatrix_in $PROG_PATH/../test-data/input-dataMatrix.tsv sampleMetadata_in $PROG_PATH/../test-data/input-sampleMetadata.tsv variableMetadata_in $PROG_PATH/../test-data/input-variableMetadata.tsv respC age predI 1 orthoI 1 testL FALSE sampleMetadata_out $PROG_PATH/outputSampleMetadata.tsv variableMetadata_out $PROG_PATH/outputVariableMetadata.tsv
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
12
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
13 # Computed numbers are not always the same. We cannot use diff directly on files.
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
14
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
15 # 0) Check they have the same number of lines
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
16 nlines=$(wc -l <"$PROG_PATH/outputSampleMetadata.tsv")
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
17 ref_nlines=$(wc -l <"$PROG_PATH/../test-data/output-sampleMetadata.tsv")
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
18 if [ $nlines != $ref_nlines ] ; then
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
19 echo "Incorrect output sample metadata." >&2
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
20 exit 1
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
21 fi
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
22
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
23 # 1) We check the header line
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
24 head -n 1 "$PROG_PATH/outputSampleMetadata.tsv" > "$PROG_PATH/header.tsv"
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
25 head -n 1 "$PROG_PATH/../test-data/output-sampleMetadata.tsv" > "$PROG_PATH/ref_header.tsv"
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
26 if ! diff "$PROG_PATH/header.tsv" "$PROG_PATH/ref_header.tsv" ; then
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
27 echo "Incorrect output sample metadata." >&2
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
28 exit 1
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
29 fi
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
30
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
31 # 2) We remove computed values and compare what's left
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
32 awk 'BEGIN{FS=OFS="\t"} {$7=$8=$9="";sub("\t\t","\t")}1' "$PROG_PATH/outputSampleMetadata.tsv" > "$PROG_PATH/nocomput.tsv"
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
33 awk 'BEGIN{FS=OFS="\t"} {$7=$8=$9="";sub("\t\t","\t")}1' "$PROG_PATH/../test-data/output-sampleMetadata.tsv" > "$PROG_PATH/ref_nocomput.tsv"
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
34 if ! diff "$PROG_PATH/nocomput.tsv" "$PROG_PATH/ref_nocomput.tsv" ; then
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
35 echo "Incorrect output sample metadata." >&2
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
36 exit 1
4b9488602d57 planemo upload for repository https://github.com/workflow4metabolomics/multivariate.git commit ebbe4eb415f9e153eec5015bbffcdf0a925f2fa4
ethevenot
parents:
diff changeset
37 fi