Mercurial > repos > sanbi-uwc > data_manager_novoalign_license_uploader
changeset 1:c2002302e045 draft
planemo upload for repository https://github.com/zipho/data_manager_novoalign_license_uploader commit be79b240ea4f15deeaa8dfaf1a221bfbb23cc5e7
author | sanbi-uwc |
---|---|
date | Mon, 29 Feb 2016 06:57:55 -0500 |
parents | 0b64aa6d4214 |
children | fab9709c897c |
files | data_manager/upload_novoalign_lic.py data_manager/upload_novoalign_lic.xml data_manager_conf.xml upload_novoalign_lic.py |
diffstat | 4 files changed, 63 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/upload_novoalign_lic.py Mon Feb 29 06:57:55 2016 -0500 @@ -0,0 +1,28 @@ +#!/usr/bin/env +# Zipho Masholoigu (SANBI-UWC) + +import os +import argparse + +import logging +log = logging.getLogger( __name__ ) + +LICENSE_TARGET_DIRECTORY = "novoalign" + +#Parse Command Line +parser = argparse.ArgumentParser(description="Upload the nonoalign license to the tool-data path") +parser.add_argument('--license_filename') +parser.add_argument('--license_dir') + +args = parser.parse_args() +filename = args.license_filename + +#create the license target directory +target_dir = args.license_dir + "/" + LICENSE_TARGET_DIRECTORY +license_file = target_dir+"/"+"license.lic" +if not os.path.isfile(license_file): + os.mkdir( target_dir ) + #move/copy license file to the tool-data path + os.rename( filename, target_dir+"/"+"license.lic") +else: + log.debug("License for novoalign seems to exists already")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/upload_novoalign_lic.xml Mon Feb 29 06:57:55 2016 -0500 @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UT:F-8" ?> +<tool id="data_manager_novoalign_license_uploader" name="Novo-align License Uploader" version="1.0" workflow_compatible="false"> + <description>Upload a license file to Galaxy tool-data directory </description> + <stdio> + <exit_code range=":-1" /> + <exit_code range="1:" /> + </stdio> + <command interpreter="python"> + upload_novoalign_lic.py --license_filename "${in_file}" --license_dir ${GALAXY_DATA_INDEX_DIR} + </command> + <inputs> + <param format="data" name="in_file" type="data" label="License for the Novoalign program" /> + </inputs> + <outputs> + <data format="tabular" name="out_file" label="Novoalign License uploader on ${in_file.name}"/> + </outputs> + <help> + Loading the license file for Novo-align program to the tool-data path. + </help> + <citations> + <citation></citation> + </citations> + <tests> + <test> + <param name="input" value="novoalign_input.lic"/> + <output name="out_file1" file="novoalign_output.lic"/> + </test> + </tests> +</tool>
--- a/data_manager_conf.xml Sun Feb 28 14:51:11 2016 -0500 +++ b/data_manager_conf.xml Mon Feb 29 06:57:55 2016 -0500 @@ -1,27 +1,7 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<tool id="novoalign_license_uploader" name="Novo-align Licence Uploader" version="1.0"> - <description>Upload a license file to Galaxy tool-data directory </description> - <stdio> <exit_code range=":-1" /> - <exit_code range="1:" /> - </stdio> - <command interpreter="python"> - upload_novoalign_lic.py $in_file $out_file - </command> - <inputs> - <param format="data" name="in_file" type="data" label="Licence for the Novoalign program" /> - </inputs> +<?xml version="1.0" encoding="utf-8" ?> +<data_managers> + <data_manager tool_file="data_manager/upload_novoalign_lic.xml" id="data_manager_novoalign_license_uploader" + undeclared_tables="True" version="0.0.1"> - <outputs> - <data format="tabular" name="out_file" label="Novoalign License uploader on ${in_file.name}"/> - <!--<move type="file"> - <source>${out_file}</source> - <target base="${GALAXY_PATH}">/tool-data/${out_file}</target> - </move>--> - </outputs> - <help> Loading the license file for Novo-align program to the tool-data path. - </help> - <citations> - <citation></citation> - </citations> - <tests></tests> -</tool> + </data_manager> +</data_managers> \ No newline at end of file
--- a/upload_novoalign_lic.py Sun Feb 28 14:51:11 2016 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env -# Zipho Masholoigu (SANBI-UWC) - -import sys -import os -import tempfile -import shutil -import optparse -import urllib2 -import subprocess - -import logging -log = logging.getLogger( __name__ ) - -LICENCE_TARGET_DIRECTORY = "tool-data/novoalign/" - -#Parse Command Line -parser = optparse.OptionParser() -args = parser.parse_args() - -filename = args[0] - -#read the contents of the license file -license_str = open( filename ).read() - -#create the licence target directory -os.mkdir( LICENCE_TARGET_DIRECTORY ) - -#save info to json file -open( filename, 'wb' ).write( license_str )