Hi Ilya,

You can validate dbkeys using validators including metadata, dataset_metadata_in_file/data_table, unspecified_build and others. 

Could you clarify what GATK tools you are trying to modify and exactly what you are trying accomplish? A complete example xml file, and any additional files (e.g. *.loc) would need to be provided to give you direction.

Thanks for using Galaxy,

Dan


On Oct 27, 2011, at 1:03 PM, Chorny, Ilya wrote:

Hi Dan,
 
I want to modify the wrappers to get genome information from the bam/sam attribute. I did this for the tophat/cufflinks wrappers. I add another option to select genome called attribute and then I pass $bam.metadata.dkey in the command line (see example below). Is this something you might be interested in? Can you suggest an alternative way to do this? My only concern is my inability to validate that the $input.metadata.dbkey exists.
 
Thanks,
 
Ilya
 
See example below.
 
#if $reference_annotation.use_ref == "Use reference annotation":
                #if $reference_annotation.annotationSource.reference_annotation_file == "indexed":
                   -G "${ filter( lambda x: str( x[0] ) == str( $reference_annotation.annotationSource.indices ), $__app__.tool_data_tables[ 'gtf_index' ].get_fields() )[0][-1] }"
                #else:
                     #if $reference_annotation.annotationSource.reference_annotation_file == "attribute":
                         -G "${ filter( lambda x: str( x[0] ) == str( $input.metadata.dbkey ), $__app__.tool_data_tables[ 'gtf_index' ].get_fields() )[0][-1] }"
                     #else:
                         -G "${reference_annotation.annotationSource.ownFile}"
                     #end if
                #end if
#end if
 
<conditional name="annotationSource">
                        <param name="reference_annotation_file" type="select" label="Please select a reference Aonnotation">
                           <option value="indexed">Use a built-in index</option>
                           <option value="history">Use one from the history</option>
                           <option value="attribute">Use input bam metadata.dbkey attribute</option>
                        </param>
                        <when value="indexed">
                          <param name="indices" type="select" label="Select genome for gtf annotation">
                            <options from_data_table="gtf_index">
                              <filter type="sort_by" column="3" />
                              <validator type="no_options" message="No indexes are available for the selected input dataset" />
                            </options>
                          </param>
                        </when>
                        <when value="history">
                          <param name="ownFile" type="data" format="gff3, gtf" label="Select a reference annotation file" />
                        </when>
</conditional>
 
 
 
Ilya Chorny Ph.D.
Bioinformatics Scientist I
Illumina, Inc.
9885 Towne Centre Drive
San Diego, CA 92121
Work: 858.202.4582