From 72c3b8cb89129c6049bd4f534ba4bac6ef67bf35 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 13 Jul 2010 10:44:45 -0400 Subject: [PATCH] Enhance VCF to MAF error message when no input file is provided. --- tools/maf/vcf_to_maf_customtrack.py | 4 ++++ tools/maf/vcf_to_maf_customtrack.xml | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/maf/vcf_to_maf_customtrack.py b/tools/maf/vcf_to_maf_customtrack.py index da193dd46c6..8a65a67c808 100644 --- a/tools/maf/vcf_to_maf_customtrack.py +++ b/tools/maf/vcf_to_maf_customtrack.py @@ -1,5 +1,6 @@ #Dan Blankenberg from optparse import OptionParser +import sys import galaxy_utils.sequence.vcf from galaxy import eggs @@ -57,11 +58,14 @@ def main(): parser.add_option( "-p", "--population", action="store_true", dest="population", default=False, help="Create MAF on a per population basis") parser.add_option( "-s", "--sample", action="store_true", dest="sample", default=False, help="Create MAF on a per sample basis") parser.add_option( "-n", "--name", dest="name", default='Unknown Custom Track', help="Name for Custom Track") + parser.add_option( "-g", "--galaxy", action="store_true", dest="galaxy", default=False, help="Tool is being executed by Galaxy (adds extra error messaging).") ( options, args ) = parser.parse_args() if len ( args ) < 3: + if options.galaxy: + print >>sys.stderr, "It appears that you forgot to specify an input VCF file, click 'Add new VCF...' to add at least input.\n" parser.error( "Need to specify an output file, a dbkey and at least one input file" ) if not ( options.population ^ options.sample ): diff --git a/tools/maf/vcf_to_maf_customtrack.xml b/tools/maf/vcf_to_maf_customtrack.xml index 6ad5309c9ab..1d572f0ada2 100644 --- a/tools/maf/vcf_to_maf_customtrack.xml +++ b/tools/maf/vcf_to_maf_customtrack.xml @@ -1,13 +1,19 @@ for display at UCSC - vcf_to_maf_customtrack.py $out_file1 ${vcf_source_type.vcf_file[0].vcf_input.dbkey} ${vcf_source_type.vcf_source} -n '$track_name' - ## + vcf_to_maf_customtrack.py '$out_file1' + #if $vcf_source_type.vcf_file + '${vcf_source_type.vcf_file[0].vcf_input.dbkey}' + #else + '?' + #end if + ${vcf_source_type.vcf_source} -n '$track_name' #for $vcf_repeat in $vcf_source_type.vcf_file '${vcf_repeat.vcf_input}' #if $vcf_source_type.vcf_source == '-p' '${vcf_repeat.population_name}' #end if #end for + -g