-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathREADME.how.to.use.Amazon.AMI
More file actions
98 lines (59 loc) · 4.25 KB
/
README.how.to.use.Amazon.AMI
File metadata and controls
98 lines (59 loc) · 4.25 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
This file describes how to use Amazon Cloud machine image created by modENCODE DCC to run the
uniform processing/peak calling pipeline from the command line. If you have any questions about
this, please email [email protected].
Step 1. Do Step 1 to Step 3 as described in the https://github.com/modENCODE-DCC/Galaxy/blob/master/docs/README.how.to.launch.Galaxy.
** Modify "KEYPAIR", "GROUP", "REGION", or "AVAILABILITY_ZONE" according to your setup. **
For example, the following values could be used for each of the aforementioned variables, where <name> is your name:
KEYPAIR = myKeyPair
GROUP = <name>Group
REGION = us-east-1
AVAILABILITY_ZONE = us-east-1a
Step 2. If you don't have one, creating your keypair to be used with an Amazon instance. This step needs to be done once only.
> ec2-create-keypair $KEYPAIR --region $REGION > $KEYPAIR.pem
We need to modify the permissions for our newly created keypair file.
> chmod 600 $KEYPAIR.pem
Creating Security Group: (port 22 for ssh)
> ec2-create-group $GROUP --region $REGION -d "modENCODE AMI."
> ec2-authorize $GROUP -P tcp -p 22
NOTE: Creating keypair and security group steps need only to be done once. Afterward, you can just set your environments as shown below
and go to the next Step.
> . env.sh
Step 2.
Now we will run an instance using the ami-c65dcbaf AMI along with our credentials.
> ec2-run-instances ami-c65dcbaf -k $KEYPAIR -g $GROUP -t m1.medium --region $REGION --availability-zone $AVAILABILITY_ZONE
Look at the output for the name of your instance, it should be something like i-(alpha-numeric characters). Suppose this
value is $INSTANCE_NAME
Now, we need to get the Public DNS of the instance.
> ec2-describe-instances $INSTANCE_NAME
Look at the output for the DNS address, it should be something like ec2-*.amazonaws.com. Suppose this value is $PUBLIC_DNS.
We are now ready to ssh into the instance. If the following command reports connection refusal, wait before trying again.
> ssh -i $KEYPAIR.pem ubuntu@$PUBLIC_DNS
> cd /modencode/softwares
> . env.sh
ANALYSIS_DIR="/mnt/data"
sudo mkdir $ANALYSIS_DIR
cd $ANALYSIS_DIR
sudo chown ubuntu:ubuntu $ANALYSIS_DIR
wget http://data.modencode.org/modENCODE_Galaxy/Test_Data/bam/3066_Snyder_GEI-11_GFP_L3_rep1.fastq.gz%23Cele_WS220%23gei-11%23rep_all%23ChIP.bam
wget http://data.modencode.org/modENCODE_Galaxy/Test_Data/bam/3066_Snyder_GEI-11_Input_L3_rep1.fastq.gz%23Cele_WS220%23gei-11%23rep_all%23input.bam
wget http://data.modencode.org/modENCODE_Galaxy/Test_Data/bam/3066_Snyder_GEI-11_GFP_L3_rep2.fastq.gz%23Cele_WS220%23gei-11%23rep_all%23ChIP.bam
wget http://data.modencode.org/modENCODE_Galaxy/Test_Data/bam/3066_Snyder_GEI-11_Input_L3_rep2.fastq.gz%23Cele_WS220%23gei-11%23rep_all%23input.bam
##########################################################
running MACS2
> cd $ANALYSIS_DIR
> mkdir ${ANALYSIS_DIR}/macs2_output
# rep1
> macs2 callpeak -t 3066_Snyder_GEI-11_GFP_L3_rep1.fastq.gz#Cele_WS220#gei-11#rep_all#ChIP.bam -c 3066_Snyder_GEI-11_Input_L3_rep1.fastq.gz#Cele_WS220#gei-11#rep_all#input.bam -f BAM -g ce -n macs2_output/3066_Snyder_GEI-11_GFP_L3_rep1 -B -q 0.01
# rep2
> macs2 callpeak -t 3066_Snyder_GEI-11_GFP_L3_rep2.fastq.gz#Cele_WS220#gei-11#rep_all#ChIP.bam -c 3066_Snyder_GEI-11_Input_L3_rep2.fastq.gz#Cele_WS220#gei-11#rep_all#input.bam -f BAM -g ce -n macs2_output/3066_Snyder_GEI-11_GFP_L3_rep2 -B -q 0.01
##########################################################
running IDR
> mkdir ${ANALYSIS_DIR}/macs2_output/IDR_out ; cd /modencode/softwares/peakcallers/IDR/idrCode ; Rscript batch-consistency-analysis.r ${ANALYSIS_DIR}/macs2_output/3066_Snyder_GEI-11_GFP_L3_rep1_peaks.encodePeak ${ANALYSIS_DIR}/macs2_output/3066_Snyder_GEI-11_GFP_L3_rep2_peaks.encodePeak 1000 ${ANALYSIS_DIR}/macs2_output/IDR_out/3066 0 F p.value
##########################################################
running IDR-plot
> cd /modencode/softwares/peakcallers/IDR/idrCode ; Rscript batch-consistency-plot.r 2 ${ANALYSIS_DIR}/macs2_output/IDR_out/3066 ${ANALYSIS_DIR}/macs2_output/IDR_out/3066 ${ANALYSIS_DIR}/macs2_output/IDR_out/3066
##########################################################
sudo apt-get install ghostscript
sudo ps2pdf /mnt/data/macs2_output/IDR_out/3066-plot.ps
sudo apt-get install evince
evince 3066-plot.pdf