# HG changeset patch # User sanbi-uwc # Date 1536676778 14400 # Node ID f86c65c60056c5479ad28cdf02bf005c26f40bc8 planemo upload for repository https://github.com/pvanheus/data_manager_shapeit_reference commit c9acc04bcb85873e6eb78b4163d1a7daa2679f22 diff -r 000000000000 -r f86c65c60056 LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 pvanheus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -r 000000000000 -r f86c65c60056 data_manager/shapeit_ref.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/shapeit_ref.py Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + +from __future__ import division, print_function +import argparse +import json +import os +import os.path + + +def _add_data_table_entry(data_manager_dict, data_table_name, data_table_entry): + data_manager_dict['data_tables'] = data_manager_dict.get('data_tables', {}) + data_manager_dict['data_tables'][data_table_name] = data_manager_dict['data_tables'].get(data_table_name, []) + data_manager_dict['data_tables'][data_table_name].append(data_table_entry) + return data_manager_dict + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Generate a data manager output for SHAPEIT reference data') + parser.add_argument('key', help='Short key to identify this reference set (no spaces)') + parser.add_argument('description', help='Description of reference set') + parser.add_argument('path', help='Filesystem path to directory containing this reference set') + parser.add_argument('prefix', help='Filename prefix for files in this reference set') + parser.add_argument('output_file', type=argparse.FileType('w'), help='JSON file used to write data manager values to') + args = parser.parse_args() + + if not os.path.exists(args.path): + exit("Unable to find specified path {}".format(args.path)) + + prefix_exists = False + for filename in os.listdir(args.path): + if filename.startswith(args.prefix): + prefix_exists = True + break + else: + if not prefix_exists: + exit("Unable to find a file with prefix {} in {}".format(args.prefix, args.path)) + + for column in ('key', 'description', 'path', 'prefix'): + value = getattr(args, column) + if '\t' in value: + exit("TAB character found in {} argument".format(column)) + + data_manager_dict = {} + data_table_entry = dict(key=args.key, description=args.description, path=args.path, prefix=args.prefix) + _add_data_table_entry(data_manager_dict, 'shapeit_ref', data_table_entry) + + args.output_file.write(json.dumps(data_manager_dict) + '\n') diff -r 000000000000 -r f86c65c60056 data_manager/shapeit_ref.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/shapeit_ref.xml Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,30 @@ + + > + + + + + + + + + + + + 10.1038/nmeth.1785 + + \ No newline at end of file diff -r 000000000000 -r f86c65c60056 data_manager_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager_conf.xml Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 000000000000 -r f86c65c60056 tool-data/shapeit_ref.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/shapeit_ref.loc.sample Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,7 @@ +#This file lists the locations of SHAPEIT reference data connections +# +# +# +#For example +# +#1000G_Phase3 1000 Genomes project haplotypes /path/to/shapeit_ref/1000G 1000GP_Phase3_ diff -r 000000000000 -r f86c65c60056 tool_data_tables_conf.xml.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_tables_conf.xml.sample Tue Sep 11 10:39:38 2018 -0400 @@ -0,0 +1,7 @@ + + + + key, description, path, prefix + +
+
\ No newline at end of file