-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-fr-lightgbm
executable file
·32 lines (25 loc) · 1.07 KB
/
run-fr-lightgbm
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
#!/bin/sh
GRAPH=$1
FRPREFIX=$2
MINSUPPORT=$3
MAXP=$4
MINPRI=$5
## make the filtered SVM files
java -server -cp "build/install/pangenomics/lib/*" org.ncgr.pangenomics.genotype.fr.FRUtils -svm -g $GRAPH -p $GRAPH -f $FRPREFIX \
--minsupport $MINSUPPORT --maxpvalue $MAXP --minpriority $MINPRI
java -server -cp "build/install/pangenomics/lib/*" org.ncgr.pangenomics.genotype.fr.FRUtils -svm -g $GRAPH -p $GRAPH.testing -f $FRPREFIX \
--minsupport $MINSUPPORT --maxpvalue $MAXP --minpriority $MINPRI
## remove the extra chunk from the file names
mv $FRPREFIX.$GRAPH.svm.txt $FRPREFIX.svm.txt
mv $FRPREFIX.$GRAPH.testing.svm.txt $FRPREFIX.testing.svm.txt
## fix the LIBSVM format
cut -f1 --complement $FRPREFIX.svm.txt > temp0.train
cut -f1 --complement $FRPREFIX.testing.svm.txt > temp0.test
sed s/ctrl/0/ temp0.train > temp1.train
sed s/ctrl/0/ temp0.test > temp1.test
sed s/case/1/ temp1.train > pathfrs.train
sed s/case/1/ temp1.test > pathfrs.test
## train the classifier
lightgbm config=train.conf
## run predictions, use stats.R to view the results
lightgbm config=predict.conf