# HG changeset patch # User iuc # Date 1642014439 0 # Node ID b5bca6d58e4c69f301e957a674b8273f80e99116 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_genomic_super_signature_ravmodels commit 1aadd5dce3b254e7714c2fdd39413029fd4b9b7a" diff -r 000000000000 -r b5bca6d58e4c README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,1 @@ +Adds new entries to data tables for GenomicSuperSignature Replicable Axes of Variation (RAV) models (RAVmodels). See also https://www.biorxiv.org/content/10.1101/2021.05.26.445900v1. \ No newline at end of file diff -r 000000000000 -r b5bca6d58e4c data_manager/data_manager_genomic_super_signature_ravmodels.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/data_manager_genomic_super_signature_ravmodels.py Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# Dan Blankenberg + + +import argparse +import json +import os +import re +import shutil +import urllib.request + + +OUTPUT_BASE_NAME = 'RAVmodel.rds' + +BUCKET_NAME = "genomic_super_signature" +RAVMODEL_NAME = "RAVmodel_{prior}.rds" +PRIOR_URL = "https://storage.googleapis.com/{bucket_name}/{prior_filename}" + + +def get_prior_url(prior): + return PRIOR_URL.format(bucket_name=BUCKET_NAME, prior_filename=RAVMODEL_NAME.format(prior=prior)) + + +def clean(text): + return re.sub(r'[^\w\-_\.]', '-', text) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--output', dest='output', action='store', type=str, default=None) + parser.add_argument('--json', dest='json', action='store', type=str, default=None) + parser.add_argument('--dbkey', dest='dbkey', action='store', type=str, default=None, help='dbkey') + parser.add_argument('--name', dest='name', action='store', type=str, default=None) + parser.add_argument('--id', dest='id', action='store', type=str, default=None) + parser.add_argument('--prior', dest='prior', action='store', type=str, default=None) + parser.add_argument('--url', dest='url', action='store', type=str, default=None) + parser.add_argument('--input', dest='input', action='store', type=str, default=None) + parser.add_argument('--symlink', dest='symlink', action='store_true', default=False) + parser.add_argument('--version', dest='version', action='store', type=str, default="0") + parser.add_argument('--tablename', dest='tablename', action='store', type=str, default="genomic_super_signature_ravmodels") + args = parser.parse_args() + + os.makedirs(args.output, exist_ok=True) + output_filename = os.path.join(args.output, OUTPUT_BASE_NAME) + if args.symlink: + assert args.input, "You must provide a filename when using symlink functionality." + os.symlink(args.input, output_filename) + else: + url = args.url + if args.prior: + url = get_prior_url(args.prior) + if url: + urllib.request.urlretrieve(url, output_filename) + else: + assert args.input, "You must provide a filename, prior, or URL." + shutil.copyfile(args.input, output_filename) + data_manager_dict = {'data_tables': {args.tablename: [dict(value=clean(args.id), dbkey=args.dbkey, version=args.version, name=args.name, path=OUTPUT_BASE_NAME)]}} + + with open(args.json, 'w') as fh: + json.dump(data_manager_dict, fh, sort_keys=True) + + +if __name__ == "__main__": + main() diff -r 000000000000 -r b5bca6d58e4c data_manager/data_manager_genomic_super_signature_ravmodels.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/data_manager_genomic_super_signature_ravmodels.xml Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,89 @@ + + into built-in cache + + python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Fetches a reference RAVmodel from various sources (Google Cloud, URL, Galaxy History, or a server file) and populates the "genomic_super_signature_ravmodels" data table. + +------ + +.. class:: infomark + +**Notice:** If you leave name or id blank, it will be generated automatically. + + diff -r 000000000000 -r b5bca6d58e4c data_manager_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager_conf.xml Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + ${dbkey}/genomic_super_signature_ravmodels/${version}/${value} + + ${GALAXY_DATA_MANAGER_DATA_PATH}/${dbkey}/genomic_super_signature_ravmodels/${version}/${value}/${path} + abspath + + + + + diff -r 000000000000 -r b5bca6d58e4c test-data/RAVmodel_prior_C2.data_manager_json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/RAVmodel_prior_C2.data_manager_json Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,1 @@ +{"data_tables": {"genomic_super_signature_ravmodels": [{"dbkey": "hg38", "name": "MSigDB C2 (curated gene sets)", "path": "RAVmodel.rds", "value": "C2", "version": "0"}]}} \ No newline at end of file diff -r 000000000000 -r b5bca6d58e4c tool-data/genomic_super_signature_ravmodels.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/genomic_super_signature_ravmodels.loc.sample Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,1 @@ +# diff -r 000000000000 -r b5bca6d58e4c tool_data_table_conf.xml.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.sample Wed Jan 12 19:07:19 2022 +0000 @@ -0,0 +1,7 @@ + + + + value, dbkey, version, name, path + +
+