Mercurial > repos > bgruening > eden_cluster_motif_finder
changeset 2:295e085b8d60 draft default tip
Uploaded
author | bgruening |
---|---|
date | Thu, 12 Jun 2014 12:22:56 -0400 |
parents | f8111c9f037d |
children | |
files | eden_cluster_motif_finder.py eden_cluster_splitter.pyc eden_iterative_motif_finder.pyc eden_utilities.py eden_utilities.pyc eden_wrapper.pyc motif_finder.xml tool_dependencies.xml |
diffstat | 8 files changed, 18 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/eden_cluster_motif_finder.py Thu Jun 12 11:38:08 2014 -0400 +++ b/eden_cluster_motif_finder.py Thu Jun 12 12:22:56 2014 -0400 @@ -40,8 +40,10 @@ motif_count = seq.count(motif) if motif_count > 0: res = '%s\t%s\t%s\t%s\n' % (record.id, motif_id, motif, motif_count) - print res, - + args.motif_file.write(res) + + args.motif_file.close() + if __name__ == '__main__': parser = argparse.ArgumentParser(description='Extract motifs patterns with EDeN.')
--- a/eden_utilities.py Thu Jun 12 11:38:08 2014 -0400 +++ b/eden_utilities.py Thu Jun 12 12:22:56 2014 -0400 @@ -59,7 +59,7 @@ dest="fraction_center_scan", type=int, help='Fraction of total number of instances which is used to compute densities.', - default=1.0) + default=1) if mode == 'eden_iterative_motif_finder' or mode == 'eden_cluster_motif' : parser.add_argument("-f", "--output-file", @@ -83,4 +83,10 @@ help='Number of negative instances per order per positive instance.', default=3) - return parser \ No newline at end of file + if mode == 'eden_cluster_motif' : + parser.add_argument("--motif-file", + dest="motif_file", + type=argparse.FileType('w'), + default=sys.stdout, + help="Path to the output motif file.") + return parser
--- a/motif_finder.xml Thu Jun 12 11:38:08 2014 -0400 +++ b/motif_finder.xml Thu Jun 12 12:22:56 2014 -0400 @@ -2,7 +2,7 @@ <description>based on EDeN</description> <requirements> <requirement type="package" version="1.63">biopython</requirement> - <requirement type="package" version="1.3.5">eden</requirement> + <requirement type="package" version="10">eden</requirement> </requirements> <command interpreter="python"> eden_cluster_motif_finder.py @@ -10,7 +10,7 @@ --input-file $infile --radius $radius --distance $distance - --output-dir ./ + --output-dir "./foo" --num-nearest-neighbors $num_nearest_neighbors --neighborhood-intersection-size $neighborhood_intersection_size --fraction-center-scan $fraction_center_scan @@ -18,7 +18,7 @@ --max-order $max_order --min-motif-size $min_motif_size --num-negative-repetitions $num_negative_repetitions - > $output + --motif-file $output </command> <inputs> <param name="infile" type="data" format="fasta" label="sequences" help="in FASTA format (--input-file)"/> @@ -27,7 +27,7 @@ <param name="num_nearest_neighbors" type="integer" value="10" label="Number of nearest neighbors used in the density estimation" help="(--num-nearest-neighbors)" /> <param name="neighborhood_intersection_size" type="integer" value="5" label="Number of nearest neighbors that must be shared in neighborhood in order to trigger neighborhood joining." help="(--neighborhood-intersection-size)" /> - <param name="fraction_center_scan" type="float" value="1.0" label="Fraction of total number of instances which is used to compute densities" help="(--fraction-center-scan)" /> + <param name="fraction_center_scan" type="integer" value="1" label="Fraction of total number of instances which is used to compute densities" help="(--fraction-center-scan)" /> <param name="max_order" type="integer" value="3" label="Size of the order for negative shuffling" help="(--max_order)" /> <param name="min_motif_size" type="integer" value="4" label="Size of the smallest returned motif" help="(--min-motif-size)" /> <param name="num_negative_repetitions" type="integer" value="3" label="Size of the smallest returned motif" help="(--num-negative-repetitions)" />
--- a/tool_dependencies.xml Thu Jun 12 11:38:08 2014 -0400 +++ b/tool_dependencies.xml Thu Jun 12 12:22:56 2014 -0400 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <tool_dependency> - <package name="eden" version="1.3.5"> - <repository changeset_revision="dc13e98b0e3d" name="package_eden_1_3" owner="rnateam" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <package name="eden" version="10"> + <repository changeset_revision="d1fd8665ea78" name="package_eden_latest" owner="bgruening" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> <package name="biopython" version="1.63"> <repository changeset_revision="d8b200f1f5a5" name="package_biopython_1_63" owner="biopython" toolshed="https://testtoolshed.g2.bx.psu.edu" />