Mercurial > repos > devteam > get_flanks
changeset 5:dd9315a56c09 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/get_flanks commit cae3e05d02e60f595bb8b6d77a84f030e9bd1689
author | devteam |
---|---|
date | Thu, 22 Jun 2017 18:39:52 -0400 |
parents | 0f9775889036 |
children | |
files | get_flanks.py get_flanks.xml macros.xml tool_dependencies.xml |
diffstat | 4 files changed, 82 insertions(+), 67 deletions(-) [+] |
line wrap: on
line diff
--- a/get_flanks.py Fri Dec 18 19:38:14 2015 -0500 +++ b/get_flanks.py Thu Jun 22 18:39:52 2017 -0400 @@ -1,6 +1,5 @@ #!/usr/bin/env python -#Done by: Guru - +# Done by: Guru """ Get Flanking regions. @@ -8,8 +7,10 @@ -l, --cols=N,N,N,N: Columns for chrom, start, end, strand in file -o, --off=N: Offset """ +from __future__ import print_function import sys + from bx.cookbook import doc_optparse from galaxy.tools.util.galaxyops import parse_cols_arg @@ -54,12 +55,12 @@ j += 1 try: elems = line.split('\t') - #if the start and/or end columns are not numbers, skip that line. + # if the start and/or end columns are not numbers, skip that line. assert int(elems[start_col_1]) assert int(elems[end_col_1]) if strand_col_1 != -1: strand = elems[strand_col_1] - #if the stand value is not + or -, skip that line. + # if the stand value is not + or -, skip that line. assert strand in ['+', '-'] if direction == 'Upstream': if strand == '+': @@ -184,8 +185,9 @@ if skipped_lines == j: stop_err( "Data issue: click the pencil icon in the history item to correct the metadata attributes." ) if skipped_lines > 0: - print 'Skipped %d invalid lines starting with #%dL "%s"' % ( skipped_lines, first_invalid_line, invalid_line ) - print 'Location: %s, Region: %s, Flank-length: %d, Offset: %d ' % ( direction, region, size, offset ) + print('Skipped %d invalid lines starting with #%dL "%s"' % ( skipped_lines, first_invalid_line, invalid_line )) + print('Location: %s, Region: %s, Flank-length: %d, Offset: %d ' % ( direction, region, size, offset )) + if __name__ == "__main__": main()
--- a/get_flanks.xml Fri Dec 18 19:38:14 2015 -0500 +++ b/get_flanks.xml Thu Jun 22 18:39:52 2017 -0400 @@ -1,57 +1,62 @@ <tool id="get_flanks1" name="Get flanks" version="1.0.0"> - <description>returns flanking region/s for every gene</description> - <requirements> - <requirement type="package" version="0.7.1">bx-python</requirement> - <requirement type="package" version="1.0.0">galaxy-ops</requirement> - </requirements> - <command interpreter="python">get_flanks.py $input $out_file1 $size $direction $region -o $offset -l ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol}</command> - <inputs> - <param format="interval" name="input" type="data" label="Select data"/> - <param name="region" type="select" label="Region"> - <option value="whole" selected="true">Whole feature</option> - <option value="start">Around Start</option> - <option value="end">Around End</option> - </param> - <param name="direction" type="select" label="Location of the flanking region/s"> - <option value="Upstream">Upstream</option> - <option value="Downstream">Downstream</option> - <option value="Both">Both</option> - </param> - <param name="offset" type="integer" value="0" label="Offset" help="Use positive values to offset co-ordinates in the direction of transcription and negative values to offset in the opposite direction."/> - <param name="size" type="integer" value="50" label="Length of the flanking region(s)" help="Use non-negative value for length"/> - - - </inputs> - <outputs> - <data format="interval" name="out_file1" metadata_source="input"/> - </outputs> - <tests> - <test> - <param name="input" value="flanks_inp.bed"/> - <param name="offset" value="-500"/> - <param name="size" value="1000"/> - <param name="direction" value="Both"/> - <param name="region" value="whole"/> - <output name="out_file1" file="flanks_out1.bed"/> - </test> - <test> - <param name="input" value="flanks_inp.bed"/> - <param name="offset" value="200"/> - <param name="size" value="1000"/> - <param name="direction" value="Downstream"/> - <param name="region" value="start" /> - <output name="out_file1" file="flanks_out2.bed"/> - </test> - </tests> - <help> - -This tool finds the upstream and/or downstream flanking region(s) of all the selected regions in the input file. + <description>returns flanking region/s for every gene</description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements" /> + <command><![CDATA[ +python '$__tool_directory__/get_flanks.py' +'$input' +'$out_file1' +$size +$direction +$region +-o $offset +-l ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol} + ]]></command> + <inputs> + <param name="input" type="data" format="interval" label="Select data"/> + <param name="region" type="select" label="Region"> + <option value="whole" selected="true">Whole feature</option> + <option value="start">Around Start</option> + <option value="end">Around End</option> + </param> + <param name="direction" type="select" label="Location of the flanking region/s"> + <option value="Upstream">Upstream</option> + <option value="Downstream">Downstream</option> + <option value="Both">Both</option> + </param> + <param name="offset" type="integer" value="0" label="Offset" help="Use positive values to offset co-ordinates in the direction of transcription and negative values to offset in the opposite direction."/> + <param name="size" type="integer" value="50" label="Length of the flanking region(s)" help="Use non-negative value for length"/> + </inputs> + <outputs> + <data name="out_file1" format_source="input" metadata_source="input"/> + </outputs> + <tests> + <test> + <param name="input" value="flanks_inp.bed"/> + <param name="offset" value="-500"/> + <param name="size" value="1000"/> + <param name="direction" value="Both"/> + <param name="region" value="whole"/> + <output name="out_file1" file="flanks_out1.bed"/> + </test> + <test> + <param name="input" value="flanks_inp.bed"/> + <param name="offset" value="200"/> + <param name="size" value="1000"/> + <param name="direction" value="Downstream"/> + <param name="region" value="start" /> + <output name="out_file1" file="flanks_out2.bed"/> + </test> + </tests> + <help><![CDATA[ +This tool finds the upstream and/or downstream flanking region(s) of all the selected regions in the input file. **Note:** Every line should contain at least 3 columns: Chromosome number, Start and Stop co-ordinates. If any of these columns is missing or if start and stop co-ordinates are not numerical, the tool may encounter exceptions and such lines are skipped as invalid. The number of invalid skipped lines is documented in the resulting history item as a "Data issue". ----- - **Example 1** - For the following dataset:: @@ -75,8 +80,5 @@ chr22 500 800 NM_028946 0 - .. image:: flanks_ex2.gif - -</help> - - + ]]></help> </tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Thu Jun 22 18:39:52 2017 -0400 @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<macros> + <xml name="requirements"> + <requirements> + <requirement type="package" version="0.7.1">bx-python</requirement> + <requirement type="package" version="1.0.0">galaxy-ops</requirement> + </requirements> + </xml> + <token name="@SCREENCASTS@"> +----- + +**Screencasts!** + +See Galaxy Interval Operation Screencasts_ (right click to open this link in another window). + +.. _Screencasts: https://galaxyproject.org/learn/interval-operations/ + +----- + </token> +</macros>
--- a/tool_dependencies.xml Fri Dec 18 19:38:14 2015 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<tool_dependency> - <package name="bx-python" version="0.7.1"> - <repository changeset_revision="35e2457234ef" name="package_bx_python_0_7" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" /> - </package> - <package name="galaxy-ops" version="1.0.0"> - <repository changeset_revision="60c9a7af1345" name="package_galaxy_ops_1_0_0" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" /> - </package> -</tool_dependency>