Mercurial > repos > eschen42 > multivariate
annotate test/test-multi @ 0:b2b02fb81a0a draft default tip
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
| author | eschen42 |
|---|---|
| date | Mon, 14 Aug 2017 20:57:59 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
|
0
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
1 #!/bin/bash |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
2 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
3 # Constants {{{1 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
4 ################################################################ |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
5 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
6 PROG_PATH=$(dirname $0) |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
7 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
8 # MAIN {{{1 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
9 ################################################################ |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
10 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
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 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
12 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
13 # Computed numbers are not always the same. We cannot use diff directly on files. |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
14 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
15 # 0) Check they have the same number of lines |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
16 nlines=$(wc -l <"$PROG_PATH/outputSampleMetadata.tsv") |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
17 ref_nlines=$(wc -l <"$PROG_PATH/../test-data/output-sampleMetadata.tsv") |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
18 if [ $nlines != $ref_nlines ] ; then |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
19 echo "Incorrect output sample metadata." >&2 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
20 exit 1 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
21 fi |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
22 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
23 # 1) We check the header line |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
24 head -n 1 "$PROG_PATH/outputSampleMetadata.tsv" > "$PROG_PATH/header.tsv" |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
25 head -n 1 "$PROG_PATH/../test-data/output-sampleMetadata.tsv" > "$PROG_PATH/ref_header.tsv" |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
26 if ! diff "$PROG_PATH/header.tsv" "$PROG_PATH/ref_header.tsv" ; then |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
27 echo "Incorrect output sample metadata." >&2 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
28 exit 1 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
29 fi |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
30 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
31 # 2) We remove computed values and compare what's left |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
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" |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
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" |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
34 if ! diff "$PROG_PATH/nocomput.tsv" "$PROG_PATH/ref_nocomput.tsv" ; then |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
35 echo "Incorrect output sample metadata." >&2 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
36 exit 1 |
|
b2b02fb81a0a
planemo upload for repository https://github.com/eschen42/multivariate/tree/dump_rdata forked from https://github.com/workflow4metabolomics/multivariate.git commit 2ace6612c83223925e25d38bce9530f90f20a602-dirty
eschen42
parents:
diff
changeset
|
37 fi |
