forked from namphuon/ViFi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_linux_mac.sh
60 lines (51 loc) · 2.43 KB
/
setup_linux_mac.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
#Get ViFi
git clone https://github.com/sara-javadzadeh/ViFi.git
cd ViFi
VIFI_DIR=`pwd`
#Get data repos
if [ ! -d "data_repo" ]; then
echo "Downloading the data_repo"
wget "https://raw.githubusercontent.com/circulosmeos/gdown.pl/master/gdown.pl"
perl gdown.pl "https://drive.google.com/file/d/1il10KUxJ5Q5JvR5pHJB4GUMBlBPgTjrj/view?usp=sharing" data_repo.tar.gz
tar -zxvf data_repo.tar.gz
echo "GRCh38" > ./data_repo/reference.txt
rm data_repo.tar.gz
fi
if [ ! -d "viral_data" ]; then
echo "Uncompressing the HMM models"
tar -xzvf viral_data.tar.gz
rm viral_data.tar.gz
fi
#Set up environmental variables
echo "Set environmental variables"
echo export VIFI_DIR=$VIFI_DIR >> ~/.bashrc
echo export AA_DATA_REPO=$PWD/data_repo >> ~/.bashrc
echo export REFERENCE_REPO=$PWD/viral_data >> ~/.bashrc
VIFI_DIR=$VIFI_DIR
AA_DATA_REPO=$PWD/data_repo
REFERENCE_REPO=$PWD/viral_data
source ~/.bashrc
#Pull the Docker file
echo "Getting the dockerized version of ViFi"
docker pull docker.io/namphuon/vifi
#Set up reference for alignment
HUMAN_REF="GRCh38"
HUMAN_REF_FILE_NAME="hg38full.fa"
for virus in "hpv" "hbv" "hcv"; do
if [ ! -d $REFERENCE_REPO/${virus} ]; then
echo "Reference for virus $virus is not downloaded. Contact the author to get access to the viral references."
else
HUMAN_VIRAL_REF="grch38_${virus}.fas"
echo "Building the ${HUMAN_REF}+${virus} reference"
cat $AA_DATA_REPO//${HUMAN_REF}/${HUMAN_REF_FILE_NAME} $REFERENCE_REPO/${virus}/${virus}.unaligned.fas > $REFERENCE_REPO/${virus}/${HUMAN_VIRAL_REF}
docker run -v $REFERENCE_REPO/${virus}/:/home/${virus}/ docker.io/namphuon/vifi bwa index /home/${virus}/${HUMAN_VIRAL_REF}
#Build reduced list of HMMs for testing
echo "Creating the list of hmms for testing in $VIFI_DIR"
ls $VIFI_DIR/viral_data/${virus}/hmms/*.hmmbuild > $VIFI_DIR/viral_data/${virus}/hmms/hmms.txt
ls $VIFI_DIR/viral_data/${virus}/hmms/*.[0-9].hmmbuild > $VIFI_DIR/viral_data/${virus}/hmms/partial_hmms.txt
fi
done
#Run ViFi under docker mode on HPV test dataset on reduced HMM list set
virus="hpv"
echo "Running test for ViFi"
python $VIFI_DIR/scripts/run_vifi.py --cpus 2 --hmm_list $VIFI_DIR/viral_data/${virus}/hmms/partial_hmms.txt -f $VIFI_DIR/test/data/test_R1.fq.gz -r $VIFI_DIR/test/data/test_R2.fq.gz -o $VIFI_DIR/tmp/docker/ --docker --viral_reference_dir $REFERENCE_REPO --hg_data_dir $AA_DATA_REPO --vifi_dir $VIFI_DIR