# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Dan Blankenberg dan@bx.psu.edu # Date 1279032285 14400 # Node ID 3225b99dd49318ac798fc6ffdc99282f89225e83 # Parent 3aaca346bc07a6e13ce48bdee8c27dfd32a3d00b Enhance VCF to MAF error message when no input file is provided.
--- 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 ):
--- a/tools/maf/vcf_to_maf_customtrack.xml +++ b/tools/maf/vcf_to_maf_customtrack.xml @@ -1,13 +1,19 @@ <tool id="vcf_to_maf_customtrack1" name="VCF to MAF Custom Track"><description>for display at UCSC</description> - <command interpreter="python">vcf_to_maf_customtrack.py $out_file1 ${vcf_source_type.vcf_file[0].vcf_input.dbkey} ${vcf_source_type.vcf_source} -n '$track_name' - ## + <command interpreter="python">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 </command><inputs><param name="track_name" type="text" label="Custom Track Name" value="Galaxy Custom Track" size="30" />