Mercurial > repos > iuc > nanocompore_db
changeset 2:d193d0e411bd draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/nanocompore commit e0d4688a59e6eeba33adcfe803ac43d0bc2863e7"
| author | iuc |
|---|---|
| date | Wed, 01 Sep 2021 07:47:15 +0000 |
| parents | 97a6b3f9a98d |
| children | |
| files | NanocomporeDB_process.py macros.xml nanocompore_db.xml test-data/KS_intensity_pvalue.bedgraph |
| diffstat | 4 files changed, 44 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/NanocomporeDB_process.py Wed Jun 17 17:27:33 2020 +0000 +++ b/NanocomporeDB_process.py Wed Sep 01 07:47:15 2021 +0000 @@ -40,7 +40,7 @@ help='path to the annotations') parser.add_argument('--bedgraph', action="store_true", help='write output in BEDGRAPH format instead of BED') - parser.add_argument('--pvalue-threshold', default=1.0, + parser.add_argument('--pvalue-threshold', type=float, default=1.0, help='Maximum reported p-value.') parser.add_argument('--out-dir', default="./", type=is_valid_directory, help='path the plotting output directory.') @@ -52,9 +52,15 @@ print(db) print("DB read ids:", db.ref_id_list) + if args.bedgraph: + file_ext = 'bedgraph' + else: + file_ext = 'bed' + if args.annotation_bed: for pt in args.pvalue_types.split(','): - print("bedgraph output for p-value type:", pt) - db.save_to_bed(output_fn='{}/{}.bedgraph'.format(args.out_dir, pt), + out_path = '{}/{}.{}'.format(args.out_dir, pt, file_ext) + print("%s output for p-value type:" % out_path, pt) + db.save_to_bed(output_fn=out_path, pvalue_field=pt, pvalue_thr=args.pvalue_threshold, bedgraph=args.bedgraph)
--- a/macros.xml Wed Jun 17 17:27:33 2020 +0000 +++ b/macros.xml Wed Sep 01 07:47:15 2021 +0000 @@ -2,6 +2,11 @@ <macros> <token name="@TOOL_VERSION@">1.0.0rc3.post2</token> <token name="@DESCRIPTION@"></token> + <xml name="bio_tools"> + <xrefs> + <xref type="bio.tools">Nanocompore</xref> + </xrefs> + </xml> <xml name="requirements"> <requirements> <requirement type="package" version="@TOOL_VERSION@">nanocompore</requirement>
--- a/nanocompore_db.xml Wed Jun 17 17:27:33 2020 +0000 +++ b/nanocompore_db.xml Wed Sep 01 07:47:15 2021 +0000 @@ -1,61 +1,60 @@ -<tool id="nanocompore_db" name="NanoComporeDB" version="@TOOL_VERSION@+galaxy1"> +<tool id="nanocompore_db" name="NanoComporeDB" version="@TOOL_VERSION@+galaxy2"> <description>Process SampComp results database</description> + <expand macro="bio_tools"/> <macros> <import>macros.xml</import> </macros> <expand macro="requirements"/> <command detect_errors="exit_code"><![CDATA[ -mkdir results && -tar -xf $db --strip-components 1 -C results/ && +mkdir -p results plots && +tar -xf '$db' --strip-components 1 -C results/ && python '$__tool_directory__/NanocomporeDB_process.py' --db-path 'results/out_SampComp.db' --ref-fasta '$reference' --annotation-bed '$annotation' +--pvalue-types '$pvalue_types' +--pvalue-threshold $pvalue_threshold +--out-dir ./plots/ $bedgraph + ]]></command> <inputs> <param name="reference" type="data" format="fasta" label="The reference genome used for read alignment."/> <param name="annotation" format="bed" type="data" label="BED file containing the annotation of the transcriptome used as reference when mapping"/> <param name="db" type="data" format="tar" label="SampComp Database" /> - <param argument="--bedgraph" type="boolean" truevalue="--bedgraph" falsevalue="" label="Write output in BEDGRAPH format instead of BED"/> + <param argument="--pvalue-types" type="text" value="GMM_logit_pvalue,KS_dwell_pvalue,KS_intensity_pvalue" label="pvalue field names" help="Comma-separated values."> + <validator type="regex" message="No valid pvalue field name list.">^(\w+(,\w+)*)?$</validator> + </param> + <param argument="pvalue-threshold" type="float" value="1.0" min="0.0" label="Maximum reported p-value"/> + <param argument="--bedgraph" type="boolean" truevalue="--bedgraph" falsevalue="" label="Write output in BedGraph format instead of BED"/> </inputs> <outputs> - <data name="GMM_logit" format="bed" from_work_dir="GMM_logit_pvalue.bedgraph" label="${tool.name} on ${on_string}: GMM_logit"> - <change_format> - <when input="bedgraph" value="true" format="bedgraph"/> - </change_format> - </data> - - <data name="KS_dwell" format="bed" from_work_dir="KS_dwell_pvalue.bedgraph" label="${tool.name} on ${on_string}: KS_dwell"> - <change_format> - <when input="bedgraph" value="true" format="bedgraph"/> - </change_format> - </data> - - <data name="KS_intensity" format="bed" from_work_dir="KS_intensity_pvalue.bedgraph" label="${tool.name} on ${on_string}: KS_intensity"> - <change_format> - <when input="bedgraph" value="true" format="bedgraph"/> - </change_format> - </data> + <collection name="pvalue_output" type="list"> + <discover_datasets pattern="__name_and_ext__" directory="plots" /> + </collection> </outputs> <tests> <test> <param name="reference" value="reference.fa"/> <param name="annotation" value="annot.bed"/> - <param name="db" value="DB.tar"/> - <output name="GMM_logit" file="GMM_logit_pvalue.bed"/> - <output name="KS_dwell" file="KS_dwell_pvalue.bed"/> - <output name="KS_intensity" file="KS_intensity_pvalue.bed"/> + <param name="db" value="DB.tar" ftype="tar" /> + <output_collection name="pvalue_output" type="list" count="3"> + <element name="GMM_logit_pvalue" file="GMM_logit_pvalue.bed" ftype="bed"/> + <element name="KS_dwell_pvalue" file="KS_dwell_pvalue.bed" ftype="bed"/> + <element name="KS_intensity_pvalue" file="KS_intensity_pvalue.bed" ftype="bed"/> + </output_collection> </test> <test> <param name="reference" value="reference.fa"/> <param name="annotation" value="annot.bed"/> - <param name="db" value="DB.tar"/> - <param name="bedgraph" value="true"/> - <output name="GMM_logit" file="GMM_logit_pvalue.bedgraph"/> - <output name="KS_dwell" file="KS_dwell_pvalue.bedgraph"/> - <output name="KS_intensity" file="KS_intensity_pvalue.bedgraph"/> - </test> + <param name="db" value="DB.tar" ftype="tar" /> + <param name="bedgraph" value="true"/> + <param name="pvalue_types" value="GMM_logit_pvalue,KS_dwell_pvalue"/> + <output_collection name="pvalue_output" type="list" count="2"> + <element name="GMM_logit_pvalue" file="GMM_logit_pvalue.bedgraph" ftype="bedgraph"/> + <element name="KS_dwell_pvalue" file="KS_dwell_pvalue.bedgraph" ftype="bedgraph"/> + </output_collection> + </test> </tests> <help><