Mercurial > repos > jbrayet > ccat_1_0_docker
changeset 6:623cbd717b5e draft
Deleted selected files
author | jbrayet |
---|---|
date | Thu, 21 Jan 2016 09:46:39 -0500 |
parents | c554b210e2d9 |
children | c0e515f669a7 |
files | ccat_wrapper.py ccat_wrapper.xml tool_dependencies.xml |
diffstat | 3 files changed, 0 insertions(+), 204 deletions(-) [+] |
line wrap: on
line diff
--- a/ccat_wrapper.py Thu Jan 21 09:43:32 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -import sys, subprocess, tempfile, shutil, os.path - -def get_top_count( filename ): - for line in open( filename ): - if line.startswith( 'outputNum' ): - return int( line.split()[-1].strip() ) - -def stop_err( tmp_dir, exception ): - print >> sys.stderr, "Error running CCAT." - shutil.rmtree( tmp_dir ) #some error has occurred, provide info and remove possibly non-empty temp directory - raise exception - -def main(): - CCAT_BINARY = "/usr/bin/ccat/CCAT3.0/bin/CCAT" - input_tag_file = sys.argv[1] - input_control_file = sys.argv[2] - genome = sys.argv[3] - input_config_file = sys.argv[4] - project_name = sys.argv[5] - output_peak_file = sys.argv[6] - output_region_file = sys.argv[7] - output_top_file = sys.argv[8] - output_log_file = sys.argv[9] - root_dir = sys.argv[10] - - ###### CREATE ANNOTATION FILES ######### - databasePath = root_dir+"/database/files" - - subprocess.Popen('mkdir -p '+databasePath+'/nebulaAnnotations', shell=True) - subprocess.Popen('mkdir -p '+databasePath+'/nebulaAnnotations/'+genome, shell=True) - - nebulaGenomePath=databasePath+"/nebulaAnnotations/"+genome - - FAIFILE='n' - LENFILE='n' - DICTFILE='n' - CHROFILE='n' - MAPFILE='n' - - if not os.path.isfile(nebulaGenomePath+"/"+genome+".len"): - FAIFILE='y' - LENFILE='y' - - FILEPATH=databasePath.replace("database/files","tool-data") - - cmd='bash /usr/bin/create_annotation_files.sh '+FAIFILE+" "+LENFILE+" "+DICTFILE+" "+CHROFILE+" "+FILEPATH+" "+genome+" "+MAPFILE+" "+nebulaGenomePath - process=subprocess.Popen(cmd, shell=True) - process.wait() - - chrom_info_file=nebulaGenomePath+"/"+genome+".len" - - tmp_dir = tempfile.mkdtemp() - try: - proc = subprocess.Popen( args="%s %s > %s" % ( CCAT_BINARY, " ".join( map( lambda x: "%s" % x, [ input_tag_file, input_control_file, chrom_info_file, input_config_file, project_name ] ) ), output_log_file ), shell=True, cwd=tmp_dir ) - proc.wait() - if proc.returncode: - raise Exception( "Error code: %i" % proc.returncode ) - output_num = get_top_count( input_config_file ) - shutil.move( os.path.join( tmp_dir, "%s.significant.peak" % project_name ), output_peak_file ) - shutil.move( os.path.join( tmp_dir, "%s.significant.region" % project_name ), output_region_file ) - shutil.move( os.path.join( tmp_dir, "%s.top%i.peak" % ( project_name, output_num ) ), output_top_file ) - except Exception, e: - return stop_err( tmp_dir, e ) - os.rmdir( tmp_dir ) #clean up empty temp working directory - -if __name__ == "__main__": main()
--- a/ccat_wrapper.xml Thu Jan 21 09:43:32 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -<tool id="peakcalling_ccat" name="CCAT" version="0.0.1"> - <description>Control-based ChIP-seq Analysis Tool</description> - <requirements> - <container type="docker">institutcuriengsintegration/ccat:1.0</container> - </requirements> - <command interpreter="python">ccat_wrapper.py '$input_tag_file' '$input_control_file' '$genome' - #if str( $options_type[ 'options_type_selector' ] ) == 'advanced': - '$input_advanced_config_file' - #else: - '$options_type.input_config_file' - #end if - 'CCAT' - '$output_peak_file' '$output_region_file' '$output_top_file' '$output_log_file' '${__root_dir__}'</command> - <inputs> - <param name="input_tag_file" type="data" format="bed" label="ChIP-Seq Tag File" /> - <param name="input_control_file" type="data" format="bed" label="ChIP-Seq Control File" /> - <param name="genome" type="select" label="Genome" > - <option value="hg19" selected="True">Human (hg19)</option> - <option value="mm10" >Mouse (mm10)</option> - <option value="hg18" >Human (hg18)</option> - <option value="mm9" >Mouse (mm9)</option> - </param> - <conditional name="options_type"> - <param name="options_type_selector" type="select" label="Advanced Options"> - <option value="basic" selected="True">Hide Advanced Options and select configuration file</option> - <option value="advanced">Show Advanced Options</option> - </param> - <when value="basic"> - <param name="input_config_file" type="data" format="txt" label="Select a pre-defined configuration file" /> - </when> - <when value="advanced"> - <param name="fragment_size" type="integer" label="Length of DNA fragment" value="200"/> - <param name="sliding_window_size" type="integer" label="Sliding window size" value="500" help="transcription factor binding default: 300; histone modifications default: 500"/> - <param name="moving_step" type="integer" label="Step of sliding window" value="50" help="transcription factor binding default: 10; histone modifications default: 50"/> - <param name="is_strand_sensitive_mode" type="select" label="isStrandSensitiveMode" > - <option value="1">Transition from sense strand to anti-sense strand</option> - <option value="0" selected="True">Local maximum of read-enrichment profile</option> - </param> - <param name="min_count" type="integer" label="Minimum number of read counts at the peak" value="4"/> - <param name="output_num" type="integer" label="Number of peaks reported in top peak file" value="100000"/> - <param name="random_seed" type="integer" label="Random Seed" value="123456"/> - <param name="min_score" type="float" label="Minimum score of normalized difference" value="3.0"/> - <param name="bootstrap_pass" type="integer" label="Number of passes in the bootstrapping process" value="50"/> - </when> - </conditional> -</inputs> - <outputs> - <data name="output_peak_file" format="interval" label="${tool.name} on ${on_string} (peaks)"> - <actions> - <action type="metadata" name="chromCol" default="1"/> - <action type="metadata" name="startCol" default="3"/> - <action type="metadata" name="endCol" default="4"/> - </actions> - </data> - <data name="output_region_file" format="interval" label="${tool.name} on ${on_string} (regions)"> - <actions> - <action type="metadata" name="chromCol" default="1"/> - <action type="metadata" name="startCol" default="3"/> - <action type="metadata" name="endCol" default="4"/> - </actions> - </data> - <data name="output_top_file" format="interval" label="${tool.name} on ${on_string} (top peaks)"> - <actions> - <action type="metadata" name="chromCol" default="1"/> - <action type="metadata" name="startCol" default="3"/> - <action type="metadata" name="endCol" default="4"/> - </actions> - </data> - <data name="output_log_file" format="txt" label="${tool.name} on ${on_string} (log)"/> - </outputs> - <configfiles> - <configfile name="input_advanced_config_file">#if str( $options_type['options_type_selector' ] ) == 'advanced': -fragmentSize ${options_type[ 'fragment_size' ]} -slidingWinSize ${options_type[ 'sliding_window_size' ]} -movingStep ${options_type[ 'moving_step' ]} -isStrandSensitiveMode ${options_type[ 'is_strand_sensitive_mode' ]} -minCount ${options_type[ 'min_count' ]} -outputNum ${options_type[ 'output_num' ]} -randomSeed ${options_type[ 'random_seed' ]} -minScore ${options_type[ 'min_score' ]} -bootstrapPass ${options_type[ 'bootstrap_pass' ]} -#end if</configfile> - </configfiles> - <tests> - <test> - <param name="input_tag_file" value="chipseq_enriched.bed.gz" ftype="bed" dbkey="hg18" /> - <param name="input_control_file" value="chipseq_input.bed.gz" ftype="bed" dbkey="hg18" /> - <param name="options_type_selector" value="advanced" /> - <param name="fragment_size" value="200" /> - <param name="sliding_window_size" value="500" /> - <param name="moving_step" value="50" /> - <param name="is_strand_sensitive_mode" value="0" /> - <param name="min_count" value="4" /> - <param name="output_num" value="100000" /> - <param name="random_seed" value="123456" /> - <param name="min_score" value="5.0" /> - <param name="bootstrap_pass" value="50" /> - <output name="output_peak_file" file="peakcalling_ccat/3.0/ccat_test_peak_out_1.interval.re_match" compare="re_match" /> - <output name="output_region_file" file="peakcalling_ccat/3.0/ccat_test_region_out_1.interval.re_match" compare="re_match" /> - <output name="output_top_file" file="peakcalling_ccat/3.0/ccat_test_top_out_1.interval.sorted.re_match" compare="re_match" sort="True" /> - <output name="output_log_file" file="peakcalling_ccat/3.0/ccat_test_log_out_1.txt" /> - </test> - <test> - <param name="input_tag_file" value="chipseq_enriched.bed.gz" ftype="bed" dbkey="hg18" /> - <param name="input_control_file" value="chipseq_input.bed.gz" ftype="bed" dbkey="hg18" /> - <param name="options_type_selector" value="basic" /> - <param name="input_config_file" value="ccat_3.0_histone_config" /> - <output name="output_peak_file" file="peakcalling_ccat/3.0/ccat_test_peak_out_1.interval.re_match" compare="re_match" /> - <output name="output_region_file" file="peakcalling_ccat/3.0/ccat_test_region_out_1.interval.re_match" compare="re_match" /> - <output name="output_top_file" file="peakcalling_ccat/3.0/ccat_test_top_out_1.interval.sorted.re_match" compare="re_match" sort="true" /> - <output name="output_log_file" file="peakcalling_ccat/3.0/ccat_test_log_out_1.txt" /> - </test> - </tests> - <help> -**What it does** - -This tool allows ChIP-seq peak/region calling using CCAT. - -View the original CCAT `documentation. <http://cmb.gis.a-star.edu.sg/ChIPSeq/paperCCAT.html>`_ - ------- - -**Citation** - -For the underlying tool, please cite `Xu H, Handoko L, Wei X, Ye C, Sheng J, Wei CL, Lin F, Sung WK. A signal-noise model for significance analysis of ChIP-seq with negative control. Bioinformatics. 2010 May 1;26(9):1199-204. <http://www.ncbi.nlm.nih.gov/pubmed/20371496>`_ - -If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.* - - </help> -</tool>
--- a/tool_dependencies.xml Thu Jan 21 09:43:32 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<tool_dependency> - <package name="docker_ccat" version="0.1"> - <repository changeset_revision="724ace069078" name="docker_ccat" owner="jbrayet" toolshed="https://testtoolshed.g2.bx.psu.edu" /> - </package> -</tool_dependency>