Mercurial > repos > greg > ideas
view ideas.xml @ 91:6f8af8e816d0 draft
Uploaded
author | greg |
---|---|
date | Tue, 29 Aug 2017 10:10:04 -0400 |
parents | 029e18c3c17b |
children | 0c2cf49dfb58 |
line wrap: on
line source
<tool id="ideas" name="IDEAS" version="1.2.0"> <description>accounts for position dependent epigenetic events and detects local cell type relationships</description> <requirements> <requirement type="package" version="2.26.0">bedtools</requirement> <requirement type="package" version="332">ucsc-bedgraphtobigwig</requirement> <requirement type="package" version="332">ucsc-bedsort</requirement> <requirement type="package" version="332">ucsc-bigwigaverageoverbed</requirement> <requirement type="package" version="1.2.0">ideas</requirement> <requirement type="package" version="1.3.2">r-optparse</requirement> </requirements> <command detect_errors="exit_code"><![CDATA[ #set tmp_dir = "tmp" #set prep_input_config = "prep_input_config.txt" #set prep_output_config = "prep_output_config.txt" ############################################## ## Create the config file and prepare the data ############################################## #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window cp '$gen_prep_input_config' $prep_input_config && prepMat $prep_input_config #if str($specify_genomic_window) == "yes": -bed '$specify_genomic_window_cond.bed_input' #else: -gsz '$chromInfo' -wsz $specify_genomic_window_cond.window_size #set restrict_chromosomes = $specify_genomic_window_cond.restrict_chromosomes_cond.restrict_chromosomes #if str($restrict_chromosomes) == "yes": #set chroms = [] #set chrom_repeat = $specify_genomic_window_cond.restrict_chromosomes_cond.chrom_repeat #for $i in $chrom_repeat.chrom $chroms.append($i) #end for -chr ",".join(chroms) #end if #end if $bychr -c $reads_per_bp #if str($blacklist_input) not in ["None", ""]: -exclude '$blacklist_input' #end if $norm ############################################## ## Coerce the prepMat config output to the ## format expected by IDEAS. ############################################## && cut -d' ' $prep_input_config -f1,2 > file1.txt && ls tmp/*.bed.gz > file2.txt && paste <(cat file1.txt) <(cat file2.txt) -d' ' > $prep_output_config ############################################## ## Run IDEAS ############################################## && ideas '$prep_output_config' #set specify_genomic_window = $specify_genomic_window_cond.specify_genomic_window #if str($specify_genomic_window) == "yes": '$specify_genomic_window_cond.bed_input' #else: $tmp_dir/*.bed #end if $hp #if str($log2) != "0.0": -log2 $log2 #end if #if str($max_states) != "0.0": -G $max_states #end if #if str($initial_states) != "0": -C $initial_states #end if #if str($max_position_classes) != "0": -P $max_position_classes #end if #if str($max_cell_type_clusters) != "0": -K $max_cell_type_clusters #end if #if str($prior_concentration) != "0.0": -A $prior_concentration #end if -sample $burnin_num $mcmc_num #if str($minerr) != "0.0": -minerr $minerr #end if #if str($maxerr) != "0.0": -maxerr $maxerr #end if -rseed 1234 -thread \${GALAXY_SLOTS:-4} #if str($save_ideas_log) == "yes": > $output_log #else: > /dev/null #end if && mv ./*.cluster $output_cluster && mv ./*.para $output_para && mv ./*.profile $output_profile && mv ./*.state $output_state ]]></command> <configfiles> <configfile name="gen_prep_input_config"><![CDATA[#import os #if str($cell_type_epigenetic_factor_cond.cell_type_epigenetic_factor) == "extract": #set input_name_positions = $cell_type_epigenetic_factor_cond.input_name_positions #for $i in $cell_type_epigenetic_factor_cond.input: #set file_name_with_ext = $i.name #assert str($file_name_with_ext).find("-") >= 0, "The selected input '%s' is invalid because it does not include the '-' character which is required when setting cell type and epigenetic factor names by extracting them from the input file names." % $file_name_with_ext #set file_name = $file_name_with_ext.split(".")[0] #if str($input_name_positions) == "cell_first": #set cell_type_name = $file_name.split("-")[0] #set epigenetic_factor_name = $file_name.split("-")[1] #else: #set cell_type_name = $file_name.split("-")[1] #set epigenetic_factor_name = $file_name.split("-")[0] #end if ${cell_type_name} ${epigenetic_factor_name} ${i} #end for #else: #for $input_items in $cell_type_epigenetic_factor_cond.input_repeat: ${input_items.cell_type_name} ${input_items.epigenetic_factor_name} ${input_items.input} #end for #end if]]></configfile> </configfiles> <inputs> <conditional name="cell_type_epigenetic_factor_cond"> <param name="cell_type_epigenetic_factor" type="select" label="Set cell type and epigenetic factor names by"> <option value="extract" selected="true">extracting them from the selected input file names</option> <option value="manual">manually setting them for each selected input</option> </param> <when value="extract"> <param name="input" type="data" format="bigwig,bam" multiple="True" label="BAM or BigWig files"> <validator type="empty_field"/> <validator type="unspecified_build"/> </param> <param name="input_name_positions" type="select" display="radio" label="Selected input file name pattern is" help="A '-' character must separate cell type and epigenetic factor names within the selected input file names"> <option value="cell_first" selected="true">Cell type name - Epigenetic factor name</option> <option value="cell_last">Epigenetic factor name - Cell type name</option> </param> </when> <when value="manual"> <repeat name="input_repeat" title="Cell type, Epigenetic factor and Input" min="1"> <param name="cell_type_name" type="text" value="" label="Cell type name"> <validator type="empty_field"/> </param> <param name="epigenetic_factor_name" type="text" value="" label="Epigenetic factor name"> <validator type="empty_field"/> </param> <param name="input" type="data" format="bigwig,bam" label="BAM or BigWig file"> <validator type="empty_field"/> <validator type="unspecified_build"/> </param> </repeat> </when> </conditional> <conditional name="specify_genomic_window_cond"> <param name="specify_genomic_window" type="select" label="Select Bed file that defines genomic windows on which to process the data"> <option value="no" selected="true">No</option> <option value="yes">Yes</option> </param> <when value="no"> <param name="window_size" type="integer" value="200" label="Window size in base pairs"/> <conditional name="restrict_chromosomes_cond"> <param name="restrict_chromosomes" type="select" label="Restrict processing to specified chromosomes"> <option value="no" selected="true">No</option> <option value="yes">Yes</option> </param> <when value="no"/> <when value="yes"> <repeat name="chrom_repeat" title="Chromosomes" min="1"> <param name="chrom" type="text" value="" label="Chromosome"/> </repeat> </when> </conditional> </when> <when value="yes"> <param name="bed_input" type="data" format="bed" label="Bed file specifying the genomic windows"/> </when> </conditional> <param argument="-bychr" type="boolean" truevalue="-bychr" falsevalue="" checked="False" label="Output chromosomes in separate files"/> <param name="reads_per_bp" type="select" display="radio" label="Calculate the average signal in each genomic window using"> <option value="6" selected="true">mean</option> <option value="8">max</option> </param> <param name="blacklist_input" type="data" format="bed" optional="True" multiple="True" label="Select file(s) containing regions to exclude"/> <param argument="-norm" type="boolean" truevalue="-norm" falsevalue="" checked="False" label="Standardize all datasets"/> <param argument="-hp" type="boolean" truevalue="-hp" falsevalue="" checked="False" label="Discourage state transition across chromosomes"/> <param name="log2" type="float" value="0" min="0" label="Use log2(x+number) transformation" help="Zero value has no affect"/> <param name="max_states" type="float" value="0" min="0" label="Maximum number of states to be inferred" help="Zero value has no affect"/> <param name="initial_states" type="integer" value="20" min="0" label="Initial number of states" help="Zero value has no affect"/> <param name="max_position_classes" type="integer" value="0" min="0" label="Maximum number of position classes to be inferred" help="Zero value has no affect"/> <param name="max_cell_type_clusters" type="integer" value="0" min="0" label="Maximum number of cell type clusters allowed" help="Zero value has no affect"/> <param name="prior_concentration" type="float" value="1" min="0" label="Prior concentration" help="Zero value results in the default value: sqrt(number of cell types)"/> <param name="burnin_num" type="integer" value="20" min="1" label="Number of burnin steps"/> <param name="mcmc_num" type="integer" value="20" min="1" label="Number of maximization steps"/> <param name="minerr" type="float" value="0.5" min="0" label="Minimum standard deviation for the emission Gaussian distribution" help="Zero value results in the default value: 0.5"/> <param name="maxerr" type="float" value="1000000" min="0" label="Maximum standard deviation for the emission Gaussian distribution" help="Zero value results in the default value: 1000000"/> <param name="save_ideas_log" type="select" display="radio" label="Save IDEAS log in an additional history item"> <option value="no" selected="true">No</option> <option value="yes">Yes</option> </param> </inputs> <outputs> <data name="output_log" format="txt" label="${tool.name} (ideas output log) on ${on_string}"> <filter>save_ideas_log == 'yes'</filter> </data> <data name="output_cluster" format="txt" label="${tool.name} (local cell type clustering) on ${on_string}"/> <data name="output_para" format="tabular" label="${tool.name} (epigenetic state frequency, mean and variance parameters) on ${on_string}"/> <data name="output_profile" format="txt" label="${tool.name} (profile) on ${on_string}"/> <data name="output_state" format="txt" label="${tool.name} (epigenetic states and position classes) on ${on_string}"/> </outputs> <tests> <test> <param name="cell_type_epigenetic_factor" value="extract"/> <param name="input" value="e001-h3k4me3.bigwig" ftype="bigwig" dbkey="hg19"/> <param name="input_name_positions" value="cell_first"/> <param name="specify_genomic_window" value="yes"/> <param name="bed_input" value="genomic_windows.bed" ftype="bed" dbkey="hg19"/> <output name="output_state" file="output_state.txt" ftype="txt"/> <output name="output_profile" file="output_profile.txt" ftype="txt"/> <output name="output_para" file="output_para.tabular" ftype="tabular"/> <output name="output_cluster" file="output_cluster.txt" ftype="txt"/> </test> <test> <param name="cell_type_epigenetic_factor" value="manual"/> <repeat name="input_repeat"> <param name="cell_type_name" value="e001" /> <param name="epigenetic_factor_name" value="h3k4me3"/> <param name="input" value="e001-h3k4me3.bigwig" ftype="bigwig" dbkey="hg19"/> </repeat> <param name="specify_genomic_window" value="yes"/> <param name="bed_input" value="genomic_windows.bed" ftype="bed" dbkey="hg19"/> <output name="output_state" file="output_state.txt" ftype="txt"/> <output name="output_profile" file="output_profile.txt" ftype="txt"/> <output name="output_para" file="output_para.tabular" ftype="tabular"/> <output name="output_cluster" file="output_cluster.txt" ftype="txt"/> </test> </tests> <help> **What it does** Employs the IDEAS (Integrative and Discriminative Epigenome Annotation System) method for jointly and quantitatively characterizing multivariate epigenetic landscapes in many cell types, tissues or conditions. The method accounts for position dependent epigenetic events and detects local cell type relationships, which not only help to improve the accuracy of annotating functional classes of DNA sequences, but also reveal cell type constitutive and specific loci. The method utilizes Bayesian non-parametric techniques to automatically identify the best model size fitting to the data so users do not have to specify the number of states. On the other hand, users can still specify the number of states if desired. ----- **Options** * **Select input type** - select a data matrix file produced in a previous run or one or more Bam or Bigwig datasets. * **Set cell type and epigenetic factor names by** - cell type and epigenetic factor names can be set manually or by extracting them from the names of the selected input datasets. The latter case requires all selected datasets to have names that contain a "-" character. * **BAM or BigWig files** - select one or more Bam or Bigwig files from yhour history, making sure that the name of every selected input include a "-" character. * **Cell type, Epigenetic factor and Input** - manually select any number of inputs, setting the cell type and epigenetic factor name for each. The combination of "cell type name" and "epigenetic factor name" must be unique for each input. For example, if you have replicate data you may want to specify the cell name as "cell_rep1", "cell_rep2", etc and the factor name as "factor_rep1", "factor_rep2", etc. * **Cell type name** - cell type name * **Epigenetic factor name** - epigenetic factor name * **BAM or BigWig file** - BAM or BigWig file * **Select Bed file that defines genomic windows on which to process the data** - if "No" is selected, IDEAS will run whole genome segmentation. If "Yes" is selected, IDEAS will segment genomes in the unit of the windows defined by the bed file. This file can be in BED3, BED4 or BED5 format, but only the first three columns (chr posst posed) will be used. * **Window size in base pairs** - Window size in base pairs (if "No" is selected) * **Restrict processing to specified chromosomes** - If "Yes" is selected, processing will be restricted to specified chromosomes * **Chromosomes** - processing will be restricted to specified chromosomes (if "Yes" is selected) * **Bed file specifying the genomic windows** - bed file specifying the genomic windows (if "Yes" is selected) * **Output chromosomes in separate files** - select "Yes" to produce separate files for each chromosome, allowing you to run IDEAS on different chromosomes separately. * **Calculate the average signal in each genomic window using** - use the bigWigAverageOverBed utility from the UCSC genome browser to calculate average signal (number of reads per bp) in each genomic window. * **Select file(s) containing regions to exclude** - select one or more bed files that contains regions you'd like excluded from your datasets. * **Standardize all datasets** - select "Yes" to standardize all datasets (e.g., reads / total_reads * 20 million) so that the signals from different cell types become comparable - your datasets can be read counts, logp-values or fold change. * **Discourage state transition across chromosomes** - select "Yes" to produce similar states in adjacent windows, making the annotation smoother, but at risk of reducing precision. * **Use log2(x+number) transformation** - perform Log2-transformation of the input data by log2(x+number) (recommended for read count data to reduce skewness). You can enter a number less than 1. For example, if your input data is mean read count per window, using 0.1 may produce better results. * **Maximum number of states to be inferred** - restrict the maximum number of states to be generated by IDEAS; the final number of inferred states may be smaller than the number you specified * **Initial number of states** - while IDEAS may infer 30 states or more by starting from just 20 states, it may not do so if it is trapped in a local mode. We recommend setting the initial number of states slightly larger than the number of states you expect. * **Maximum number of position classes to be inferred** - Set this value only if: * you do not want position classes (e.g., for testing purposes), in this case set the value to 1 * IDEAS runs slow because there are too many position classes, generally less than 100 position classes will run fine * **Maximum number of cell type clusters allowed** - Set this value only for testing. If you set the value to 1, then all cell types will be clustered in one group. * **Prior concentration** - specify the prior concentration parameter; default is A=sqrt(number of cell types). A smaller concentration parameter (e.g., 1 or less) will emphasize more on position specificity and a larger concentration parameter (e.g., 10 * number of cell types) will emphasize more on global homogeneity. * **Set the the number of burnin and maximization steps** - specify the number of burnin and maximization steps; default it is 50 50. Increasing these two numbers will increase computing and only slightly increase accuracy. Decreasing these two numbers will reduce computing but may also reduce accuracy. We recommend to run IDEAS with at least 20 burnins and 20 maximizations. IDEAS will not stop even if it reaches a maximum mode. * **Minimum standard deviation for the emission Gaussian distribution** - you should change the default value of 0.5 if the standard deviation of your data is much smaller or much larger than 1. The first line of the output produced by IDEAS is **ysd=xxx**, which is the total standard deviation of your data. If that value is less than 0.5, you may set the minimum standard deviation to an even smaller number (e.g., xxx/2). If the standard deviation of your data is much greater than 1, (e.g., 20), you may set the minimum standard deviation to a larger value, (e.g., 5). Modifying the minimum standard deviation in the former case is more necessary than in the latter case because otherwise you may end up finding no interesting segmentations. We do not recommend setting the minimum standard deviation to be 0 or smaller, as doing so may capture some artificial and uninteresting states due to tightly clustered data, such as 0 in read counts. * **Maximim standard deviation for the emission Gaussian distribution** - if you want to find fine-grained states you may use this option (if not used, IDEAS uses infinity), but it is rearely used unless you need more states to be inferred. </help> <citations> <citation type="doi">10.1093/nar/gkw278</citation> </citations> </tool>