forked from stuartwillis/poolparty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPPrunls.sh
executable file
·57 lines (47 loc) · 1.97 KB
/
PPrunls.sh
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
57
#!/bin/bash
#PoolParty v04.01.2022
#PPrunls
BASEDIR=$(dirname "$0")
if [[ ${BASEDIR} != *poolparty* ]];then
SLOC=$(readlink -f "$0")
BASEDIR=${SLOC%/*}
fi
#pass local score analysis to R script
set -o pipefail
#Define arguments
while getopts ":o:i:x:s:u:h:" opt; do
case $opt in
o) output="$OPTARG"
;;
i) input="$OPTARG"
;;
x) tuningparam="$OPTARG"
;;
s) scaff="$OPTARG"
;;
u) forceuni="$OPTARG"
;;
h) help="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&6
;;
esac
done
#help
if [ -z "$output" ] || [ -z "$input" ] ; then
printf "\nPPrunls : Uses local score R script to calculate significant regions from p-values (FET,CMH,FLK) \n \n"
printf " Requires PPanalyze output format: 4 columns (Chr,pos,SnpID,p) \n "
printf "Please read Accounting for linkage disequilibrium in genome scans forselection without individual genotypes: The local score approach (Fariello et al. 2017) \n\n "
printf "Usage: PPrunls -i [input] -o [output name] -s [scaffold prefix] -x [tuning parameter] \n"
printf "\n Argument Description Default\n \n"
printf " - i [input] : Input file with four column format (CHR,POS,SNP,P) [REQUIRED] \n"
printf " - o [output name] : Prefix for output name to define the analysis [REQUIRED] \n"
printf " - s [scaffold prefix] : If scaffolds present, prefix that identifies them [scaff] \n"
printf " - x [tuning parameter] : Override tuning parameter for local score (number) [NULL] \n"
printf " - u [force uniformity] : Force p-value distribution to be recognized as uniform [NULL] \n \n"
exit
fi
[ -z "$scaff" ] && scaff=scaff
[ -z "$tuningparam" ] && tuningparam=NULL
[ -z "$forceuni" ] && forceuni=NULL
Rscript $BASEDIR/rscripts/r_localscore.R $input $output $scaff $tuningparam $forceuni