Mercurial > repos > jeremyjliu > region_motif_enrichment
changeset 35:4ce22698acb0 draft
Uploaded
author | jeremyjliu |
---|---|
date | Thu, 26 Feb 2015 22:54:09 -0500 |
parents | fe8a884363df |
children | b868314320e2 |
files | pwms/jaspar.jolma.pwms.from.seq.RData pwms/mm9.pwms.from.seq.RData pwms/pouya.pwms.from.seq.RData region_motif_compare.r region_motif_compare.xml region_motif_db/MOTIF_DB_GOES_HERE region_motif_db/pouya_test_motifs.bed.bgz region_motif_db/pouya_test_motifs.bed.bgz.tbi region_motif_intersect.r region_motif_intersect.xml repository_dependencies.xml tool_dependencies.xml |
diffstat | 11 files changed, 31 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/region_motif_compare.r Tue Feb 10 02:03:15 2015 -0500 +++ b/region_motif_compare.r Thu Feb 26 22:54:09 2015 -0500 @@ -4,13 +4,12 @@ # corrections. All enrichment ratios relative to overall count / gc ratios. # Author: Jeremy liu # Email: jeremy.liu@yale.edu -# Date: 15/02/04 +# Date: 15/02/11 # Note: This script is meant to be invoked with the following command -# R --slave --vanilla -f ./region_motif_compare.r --args <workingdir> <db> <intab1> <intab2> -# <enriched_tab> <depleted_tab> <plots_png> +# R --slave --vanilla -f ./region_motif_compare.r --args <workingdir> <pwm_file> +# <intab1> <intab2> <enriched_tab> <depleted_tab> <plots_png> # <workingdir> is working directory of galaxy installation -# <db> types: "t" test, "p" pouya, "j" jaspar jolma, "m" mouse, "c" combined -# Dependencies: plotting.r +# Dependencies: region_motif_data_manager, plotting.r # Auxiliary function to concatenate multiple strings concat <- function(...) { @@ -24,20 +23,7 @@ # Set common and data directories args <- commandArgs() workingDir = args[7] -dbCode = args[8] -# dbCode "c" implemented when pwmFile is loaded -if (dbCode == "t" | dbCode == "p") { - pwmFile = concat(workingDir, "/pwms/pouya.pwms.from.seq.RData") -} else if (dbCode == "j") { - pwmFile = concat(workingDir, "/pwms/jaspar.jolma.pwms.from.seq.RData") -} else if (dbCode == "m") { - pwmFile = concat(workingDir, "/pwms/mm9.pwms.from.seq.RData") -} else if (dbCode == "c") { # rest of dbCode "c" implemented when pwmFile loaded - pwmFile = concat(workingDir, "/pwms/pouya.pwms.from.seq.RData") - pwmFile2 = concat(workingDir, "/pwms/jaspar.jolma.pwms.from.seq.RData") -} else { - pwmFile = concat(workingDir, "/pwms/pouya.pwms.from.seq.RData") -} +pwmFile = args[8].split(',')[0] # If duplicate entires, take first one # Set input and reference files inTab1 = args[9] @@ -63,11 +49,11 @@ # Loading motif position weight matrix (pwm) file and input tab file cat("Loading and reading input region motif count files...\n") load(pwmFile) # pwms data structure -if (dbCode == "c") { # Remaining implementation of dbCode "c" combined - temp = pwms - load(pwmFile2) - pwms = append(temp, pwms) -} +#if (dbCode == "c") { # Remaining implementation of dbCode "c" combined +# temp = pwms +# load(pwmFile2) +# pwms = append(temp, pwms) +#} region1DF = read_tsv(inTab1) region2DF = read_tsv(inTab2) region1Counts = region1DF$counts
--- a/region_motif_compare.xml Tue Feb 10 02:03:15 2015 -0500 +++ b/region_motif_compare.xml Thu Feb 26 22:54:09 2015 -0500 @@ -4,18 +4,28 @@ <requirement type="set_environment">RMOTIF_PATH</requirement> </requirements> <command interpreter="Rscript"> - region_motif_compare.r --args \$RMOTIF_PATH $db_type $in_tab_1 $in_tab_2 $out_enriched $out_depleted $out_plots + region_motif_compare.r --args \$RMOTIF_PATH $pwm_file.fields.path $in_tab_1 $in_tab_2 + $out_enriched + $out_depleted + $out_plots </command> <inputs> <param name="in_tab_1" type="data" format="tabular" label="Region Set 1 Motif Count File"/> <param name="in_tab_2" type="data" format="tabular" label="Region Set 2 Motif Count File"/> + + <param name="pwm_file" type="select" label="Using motif database PWM file"> + <options from_data_table="motif_databases"/> + </param> + + <!-- COMBINED OPTION IS LOST <param name="db_type" type="select" label="Select Motif Database" > - <option value="t">Test Pouya Subset (hg19)</option> - <option value="p">Pouya Encode Motifs (hg19)</option> + <option value="t">Test Encode Motifs (hg19)</option> + <option value="e">Encode Motifs (hg19)</option> <option value="j">Jaspar and Jolma Motifs (hg19)</option> <option value="m">Mouse Motifs (mm9)</option> <option value="c">Pouya, Jaspar, and Jolma Combined (hg19)</option> - </param> + </param> --> + </inputs> <outputs> <data name="out_enriched" format="tabular" label="Enriched Motifs"/>
--- a/region_motif_intersect.r Tue Feb 10 02:03:15 2015 -0500 +++ b/region_motif_intersect.r Thu Feb 26 22:54:09 2015 -0500 @@ -1,9 +1,9 @@ # Name: region_motif_intersect.r # Description: Takes a bed file of target regions and counts intersections # of each motif (in separately installed tabix database) and target regions. -# Author: Jeremy liu +# Author: Jeremy Liu # Email: jeremy.liu@yale.edu -# Date: 15/02/04 +# Date: 15/02/11 # Note: This script is meant to be invoked with the following command # R --slave --vanilla -f ./region_motif_intersect.r --args <db_bgz> <db_tbi> <inbed> <outtab> # Dependencies: region_motif_data_manager @@ -16,8 +16,8 @@ # Retrive motif database path args <- commandArgs() -motifDB_bgz = args[7] -motifDB_tbi = args[8] +motifDB_bgz = args[7].split(',')[0] # Handles duplicate entries in data table +motifDB_tbi = args[8].split(',')[0] # Just takes the first one # Set input and reference files, comment to toggle commmand line arguments inBed = args[9]
--- a/region_motif_intersect.xml Tue Feb 10 02:03:15 2015 -0500 +++ b/region_motif_intersect.xml Thu Feb 26 22:54:09 2015 -0500 @@ -1,8 +1,5 @@ <tool id="region_motif_intersect" name="Region Motif Intersect"> <description>for computing the motifs that lie inside a region set</description> - <!--<requirements> - <requirement type="package" version="1.0.0">MOTIF_DATA_MANAGER</requirement> - </requirements>--> <command interpreter="Rscript"> region_motif_intersect.r --args $bgz_file.fields.path $tbi_file.fields.path $in_bed $out_tab </command> @@ -17,8 +14,8 @@ </param> <!--<param name="db_type" type="select" label="Select Motif Database" > - <option value="t">Test Pouya Subset (hg19)</option> - <option value="p">Pouya Encode Motifs (hg19)</option> + <option value="t">Test Encode Motifs (hg19)</option> + <option value="e">Encode Motifs (hg19)</option> <option value="j">Jaspar and Jolma Motifs (hg19)</option> <option value="m">Mouse Motifs (mm9)</option> </param>-->
--- a/repository_dependencies.xml Tue Feb 10 02:03:15 2015 -0500 +++ b/repository_dependencies.xml Thu Feb 26 22:54:09 2015 -0500 @@ -1,4 +1,4 @@ <?xml version="1.0"?> <repositories description="Region_Motif_Enrichment requires Region_Motif_Data_Manager motif databases"> - <repository changeset_revision="e4229c66d78d" name="region_motif_data_manager" owner="jeremyjliu" toolshed="http://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="a5421f83f972" name="region_motif_data_manager" owner="jeremyjliu" toolshed="http://testtoolshed.g2.bx.psu.edu" /> </repositories>
--- a/tool_dependencies.xml Tue Feb 10 02:03:15 2015 -0500 +++ b/tool_dependencies.xml Thu Feb 26 22:54:09 2015 -0500 @@ -3,14 +3,4 @@ <set_environment version="1.0"> <environment_variable name="RMOTIF_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable> </set_environment> - <!--<package name="MOTIFS" version="1.0.0"> - <install version="1.0"> - <actions> - <action type="download_by_url">http://gehlenborg.com/wp-content/uploads/motif/pouya_test_motifs.bed.bgz</action> - <action type="shell_command">mv pouya_test_motifs.bed.bgz $REPOSITORY_INSTALL_DIR/region_motif_db</action> - <action type="download_by_url">http://gehlenborg.com/wp-content/uploads/motif/pouya_test_motifs.bed.bgz.tbi</action> - <action type="shell_command">mv pouya_test_motifs.bed.bgz.tbi $REPOSITORY_INSTALL_DIR/region_motif_db</action> - </actions> - </install> - </package>--> </tool_dependency> \ No newline at end of file