forked from milaboratory/mixcr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regression_clna
executable file
·56 lines (40 loc) · 1.64 KB
/
regression_clna
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
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
assert() {
expected=$(echo -ne "${2:-}")
result="$(eval 2>/dev/null $1)" || true
result="$(sed -e 's/ *$//' -e 's/^ *//' <<<"$result")"
if [[ "$result" == "$expected" ]]; then
return
fi
result="$(sed -e :a -e '$!N;s/\n/\\n/;ta' <<<"$result")"
[[ -z "$result" ]] && result="nothing" || result="\"$result\""
[[ -z "$2" ]] && expected="nothing" || expected="\"$2\""
echo "expected $expected got $result for" "$1"
exit 1
}
set -euxo pipefail
divideBy=$2
subset=$1
i=0
while IFS= read -r line; do
array[i%$divideBy]+="$line "
((++i))
done < <(ls ./regression/*.clna)
for filename in ${array[$subset]}; do
id=${filename#./regression/*}
id=${id%*.clna}
mixcr exportPreset --mixcr-file "regression/${id}.clna" "${id}_preset.yaml"
mixcr exportClonesPretty "regression/${id}.clna" "${id}_export_clones_pretty.txt"
mixcr exportClones "regression/${id}.clna" "${id}_export_clones.tsv"
mixcr exportAlignmentsPretty "regression/${id}.clna" "${id}_export_alignments_pretty.txt"
mixcr exportAlignments "regression/${id}.clna" "${id}_export_alignments.tsv"
mixcr exportClonesOverlap "regression/${id}.clna" "${id}_overlap.tsv"
mixcr exportQc align "regression/${id}.clna" "${id}_qc_align.svg"
mixcr postanalysis individual --default-downsampling none --default-weight-function none "regression/${id}.clna" "${id}_pa.json"
if grep -q '\- "assembleContigs"' "${id}_preset.yaml"
then
mixcr assembleContigs "regression/${id}.clna" "${id}.contigs.clns"
fi
mixcr exportReports "regression/${id}.clna" "${id}_report.txt"
assert "cat ${id}_report.txt | grep 'file has too old version' | wc -l" "0"
done