This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
run-gistic-openpbta.sh
70 lines (58 loc) · 2.3 KB
/
run-gistic-openpbta.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
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Jaclyn Taroni for ALSF CCDL 2020
# Configure environmental variables for MCR
ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mcr/v83/runtime/glnxa64:/opt/mcr/v83/bin/glnxa64:/opt/mcr/v83/sys/os/glnxa64
export XAPPLRESDIR=/opt/mcr/v83/X11/app-defaults
# This script should always run as if it were being called from
# the directory it lives in.
cd "$(dirname "${BASH_SOURCE[0]}")"
# The gzipped SEG file to use and a "nickname" for it
# The FILEPREFIX is appended to the base file name for the
# gunzipped version of the file in scratch
SEGFILE=${SEGFILE:-"../results/pbta-cnv-consensus-gistic-only.seg.gz"}
FILEPREFIX=${FILEPREFIX:-"consensus"}
# An array list file is used if we want to subset the cohort, by default
# we don't want to do that
ARRAYLIST=${ARRAYLIST:-""}
# The results directory relative to where this script lives
# and the folder name that will contain the GISTIC results, respectively
# These will be constructed into a file path that is the basedir argument
# for GISTIC
RESULTSDIR=${RESULTSDIR:-"../results"}
OUTPUTFOLDER=${OUTPUTFOLDER:-"pbta-cnv-consensus-gistic"}
basedir=${RESULTSDIR}/${OUTPUTFOLDER}
mkdir -p $basedir
# It's unclear if GISTIC can handle gzipped files
# So we will gunzip the file specified and put it in
# a "compartmentalized" scratch folder and name the file
# using the FILEPREFIX variable
scratchdir="../../../scratch/uncompressed-seg-for-gistic"
mkdir -p $scratchdir
segfile=${scratchdir}/${FILEPREFIX}_seg_file_for_gistic.seg
gunzip -c $SEGFILE > $segfile
# This is the correct genome build for OpenPBTA
refgenefile=/home/rstudio/gistic_install/refgenefiles/hg38.UCSC.add_miR.160920.refgene.mat
# Run GISTIC! These parameters are from: https://github.com/d3b-center/OpenPBTA-workflows/blob/cb87a2b725d0e41d34a88436492830802c40f7f0/bash/run-gistic.sh#L16
/home/rstudio/gistic_install/gp_gistic2_from_seg \
-v 30 \
-b $basedir \
-alf $ARRAYLIST \
-seg $segfile \
-refgene $refgenefile \
-genegistic 1 \
-smallmem 1 \
-broad 1 \
-twoside 1 \
-brlen 0.98 \
-conf 0.90 \
-armpeel 1 \
-savegene 1 \
-gcm extreme \
-js 2 \
-rx 0
# compress GISTIC output
cd $RESULTSDIR && zip -r ${OUTPUTFOLDER}.zip $OUTPUTFOLDER
# 'Undo' environmental variables for MCR
export LD_LIBRARY_PATH=$ORIG_LD_LIBRARY_PATH
unset XAPPLRESDIR