annotate region-motif-compare/README.md @ 17:7afdfd4f4c1b draft

Uploaded
author jeremyjliu
date Wed, 12 Nov 2014 15:21:11 -0500 (2014-11-12)
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
1 # Region-Motif-Compare Tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
2 Version 1.1 Released 2014
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
3 Park Laboratory
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
4 Center for Biomedical Informatics
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
5 Harvard University
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
6
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
7 Contact
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
8 Jeremy Liu (jeremy.liu@yale.edu)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
9 Nils Gehlenborg (nils@hms.harvard.edu)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
10
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
11 ## Overview
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
12 ### Structure
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
13 The tool suite consists of:
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
14
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
15 1. Two Rscripts: region_motif_compare.r and region_motif_intersect.r
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
16 2. Two Xml Files: region_motif_compare.xml and region_motif_intersect.xml
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
17 3. Motif Database Directory: region_motif_db
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
18 4. Dependency Library Directory: region_motif_lib
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
19 5. Galaxy Workflows: Files with suffix ".ga" that can be imported into the local
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
20 Galaxy instance after installation of the tool.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
21
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
22 ### Description
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
23 1. **region_motif_intersect.r** (1 bed -> 1 tsv):
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
24 Takes one bed file of regions as input. Then it calculates
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
25 the number of intersections of the regions and the motifs. region_motifs_intersect.r
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
26 outputs a tab separated values (tsv) file of motif names and intersection counts.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
27 **Important Note:** region_motif_intersect.r makes no assumptions about the nature
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
28 of the input regions. For example, if overlapping regions are inputted, motifs that
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
29 intersect the overlap will be double counted. Thus, it is recommended that regions
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
30 be merged before using this tool, using the merge tool in the Galaxy toolshed.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
31
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
32 2. **region_motif_compare.r** (2 tsv -> 2 tsv & 1 png):
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
33 Takes as input two tsv files of motifs / regions intersection
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
34 counts. These generally originate from running region_motif_intersect.r on two sets
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
35 of different regions with the same query motif database. Based on the counts,
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
36 region_motif_compare.r then determines the enrichment (or depletion) of certain
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
37 motifs across the two regions. This is done by a correcting for the size and gc
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
38 content of the region, and applying a Poisson test to the counts.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
39 Then, region_motif_compare.r outputs the most significant enriched or depleted
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
40 motifs as a tsv. In addition, the tool outputs a diagnostic plot containing
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
41 graphical representations of the motif counts, gc correction curves, and significant
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
42 motifs that distinguish the two regions (selected via p value).
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
43
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
44 3. **region_motif_db**: Contains motif positions as compressed, indexed tabix files.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
45
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
46 4. **region_motif_lib**: Contains dependencies (i.e. plotting.r) for region_motif_compare.r
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
47
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
48 ## Installation
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
49 Directions for installing the region-motif-compare tools into a personal computer
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
50 and a local Galaxy instance.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
51
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
52 1. Follow the online directions to install a local instance of Galaxy (getgalaxy.org).
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
53 Optionally, follow the directions to install Refinery (refinery-platform.readthedocs.org)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
54
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
55 2. Clone the github repository to your local computer
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
56 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
57 git clone https://github.com/parklab/refinery-galaxy-tools.git
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
58 cd refinery-galaxy-tools/region-motif-compare
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
59 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
60
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
61 3. Make a directory for the tools in Galaxy instance. This serves as a category
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
62 for the tool in the tools sidebar. You can also place the tools in an existing
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
63 or alternatively named directory, but remember to update tool_conf.xml to reflect this.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
64 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
65 cd ~/galaxy-dist/tools/
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
66 mkdir my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
67 cd my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
68 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
69
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
70 4. Copy over ".r" and ".xml" files, as well as `region_motif_db` and `region_motif_lib`
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
71 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
72 cd refinery-galaxy-tools/region-motif-compare
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
73 cp *.r ~/galaxy-dist/tools/my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
74 cp *.xml ~/galaxy-dist/tools/my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
75 cp -r region_motif_db ~/galaxy-dist/tools/my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
76 cp -r region_motif_lib ~/galaxy-dist/tools/my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
77 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
78
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
79 5. Edit `~/galaxy-dist/tool_conf.xml` to reflect the addition of the new tools.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
80 Add the following lines within the `<toolbox>` tags. If in Step 3 you copied
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
81 the tools to a different directory than `my_tools`, edit the code snippet
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
82 to reflect the correct path name.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
83 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
84 <section id="mTools" name="My Tools">
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
85 <tool file="my_tools/region_motif_intersect.xml" />
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
86 <tool file="my_tools/region_motif_compare.xml" />
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
87 </section>
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
88 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
89
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
90 6. Download the motif databases and place them into `region_motif_db`
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
91 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
92 cd ~/galaxy-dist/tools/my_tools/region_motif_db
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
93 wget ????/pouya_motifs.bed.bgz
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
94 wget ????/pouya_motifs.bed.bgz.tbi
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
95 wget ????/jaspar_jolma_motifs.bed.bgz
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
96 wget ????/jaspar_jolma_motifs.bed.bgz.tbi
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
97 wget ????/mm9_motifs.bed.bgz
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
98 wget ????/mm9_motifs.bed.bgz.tbi
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
99 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
100
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
101 7. Install the Bioconductor R package Rsamtools for dealing with tabix files
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
102 ```
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
103 $ R
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
104 > source("http://bioconductor.org/biocLite.R")
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
105 > biocLite("Rsamtools")
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
106 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
107
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
108 8. If in Step 3 you copied the tools to an existing directory or an alternatively
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
109 named directory, you must edit the following file paths.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
110 In `region_motif_intersect.r` and `region_motif_compare.r` edit `commonDir`:
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
111 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
112 # Replace this line
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
113 commonDir = concat(workingDir, "/tools/my_tools")
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
114 # With this edited line
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
115 commonDir = concat(workingDir, "<relative_path_from_galaxy_root>/<tool_directory>")
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
116 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
117 In addition, edit `region_motif_intersect.xml` and `region_motif_compare.xml` to
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
118 reflect the path of the tools relative to the galaxy root directory.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
119 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
120 <command interpreter="bash">
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
121 /usr/bin/R --slave --vanilla -f $GALAXY_ROOT_DIR/<path_to_tools>/region_motif_intersect.r --args $GALAXY_ROOT_DIR $db_type $in_bed $out_tab
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
122 </command>
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
123 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
124 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
125 <command interpreter="bash">
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
126 /usr/bin/R --slave --vanilla -f $GALAXY_ROOT_DIR/<path_to_tools>/region_motif_compare.r --args $GALAXY_ROOT_DIR $db_type $in_tab_1 $in_tab_2 $out_enriched $out_depleted $out_plots
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
127 </command>
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
128 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
129
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
130 ## Running the Tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
131 ### Running from Galaxy
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
132 1. To run the tools as workflows, import the .ga workflows included in the github
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
133 via the Galaxy workflow user interface. Then, upload and select two input BED files.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
134
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
135 2. To run the tools individually, select the tool from the tools toolbar, provide
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
136 a BED file (Region Motif Intersect) or two tsv files (Region Motif Compare), and
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
137 select a query database from the dropdown menu.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
138
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
139 ### Running from Refinery
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
140 1. Import the .ga workflows into a local Galaxy instance. These workflows have
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
141 already been annotated for Refinery.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
142
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
143 2. Add the local Galaxy instance to the Refinery installation.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
144 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
145 python manage.py create_workflowengine <instance_id> "<group_name>"
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
146 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
147
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
148 3. Import the Galaxy workflows into Refinery.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
149 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
150 python manage.py import_workflows
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
151 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
152 4. Run the tools from the Refinery user interface.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
153
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
154 ### Running as Command Line Tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
155 You can also run the tools from the command line, an example of which is shown below.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
156 More information is found in the headers of the r source files.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
157 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
158 cd ~/galaxy-dist/tools/my_tools
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
159 R --slave --vanilla -f region_motif_intersect.r --args ~/galaxy-dist p <path_to_bed_file> <path_to_output_tsv>
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
160 R --slave --vanilla -f region_motif_compare.r --args ~/galaxy-dist p <path_to_region1_counts> <path_to_region2_counts> <enriched_motifs_output_tsv> <depleted_motifs_output_tsv> <plots_png>
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
161 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
162
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
163 ## Interpreting Results
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
164 ### Motif Database and Result Notation
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
165 TF motif positions for hg19 and mm9 were curated from three databases:
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
166 ENCODE TF motif database "Pouya" (http://compbio.mit.edu/encode-motifs/)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
167 JASPAR database "Jaspar" (http://jaspar.genereg.net/)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
168 DNA binding specificities of human transciption factors "Jolma" (http://www.ncbi.nlm.nih.gov/pubmed/23332764)
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
169
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
170 For ENCODE TF motifs, the genomic locations were taken straight from the database.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
171 In addition, position weight matrices (pwms) were obtained by averaging the
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
172 sites in the genome for a motif. These are labeled with "\_8mer\_".
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
173 Fake motifs were also generated, by shuffling the pwms of actual motifs and
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
174 mapping to the genome and are labeled with "_8mer_C".
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
175
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
176 For JASPAR and Jolma motifs, mast was run to determine genomic locations from the
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
177 provided pwms. The motif alignmment thresholds were set to the top 5k, 20k, 100k, and
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
178 250k sites and the redundant maps removed with the top 30k sites have the same score.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
179 These are labeled with "_t5000" and likewise.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
180
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
181
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
182 ## Motif Tabix File Creation
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
183 Starting with a BED file of motif positions (minimal chr, start, end), follow
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
184 below to generate a tabix file that can be placed in `region_motif_db` and
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
185 used by the tools.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
186
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
187 1. Download Tabix (http://sourceforge.net/projects/samtools/files/tabix/) and install.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
188 Add `tabix` and `bgzip` binaries to your file path.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
189 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
190 tar -xvjf tabix-0.2.6.tar.bz2
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
191 cd tabix-0.2.6
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
192 make
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
193 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
194
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
195 2. Construct bgzip files and index files.
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
196 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
197 cd ~/galaxy-dist/tools/my_tools/region_motif/db
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
198 (grep ^"#" jaspar_motifs.bed; grep -v ^"#" jaspar_motifs.bed | sort -k1,1 -k2,2n) | bgzip > jaspa_motifs.bed.bgz
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
199 tabix -p bed jaspar_motifs.bed.bgz # this generates jaspar_motifs.bed.bgz.tbi
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
200 ````
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
201
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
202 3. Add the path to `jaspar_motifs.bed.bgz` to the selection options for the variable
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
203 `motifDB` in `region_motif_intersect.r` and `region_motif_compare.r`. To enable
7afdfd4f4c1b Uploaded
jeremyjliu
parents:
diff changeset
204 the new database in Galaxy, you will have to edit the xml files for both tools.