"Local Data" Generic Input tool

A number of tools such as Stringtie don’t accept files from “local data” .loc files so I’m trying to create a generic Input tool that presents the user with the dropdown of a specified .loc file and pass it to the downstream tool. For instance, we have a list of Reference Annotation files that we can pass to Stringtie. The problem is that if the file is compressed, the downstream tool doesn’t recognize that it is compressed because all it can see is filename.dat.

Does there already exist a way to do this? I’m taking this approach of creating a generic Input tool rather than modifying currently existing tools because there are many that do not accept Local Data and I thought it’d be faster to create a tool just for our group.

I’d prefer to use the Local Files route instead of Shared Files because the user might not always have access to the Galaxy interface (a Tripal site using Galaxy API, for instance).

The code is below. If the AA_reference_annotation.loc file lists files that are uncompressed, the downstream tools work (Stringtie), but not if they are compressed. Ordinarily, the downstream tool such as Stringtie would be able to detect if a file is compressed or not, but something with my tool and the way it gets passed makes Stringtie detect it as uncompressed.

    <description>An input specifically designed for local Reference Annotations</description>
    <command>
    <![CDATA[
        ln -sf '$input1.fields.path' '$reference_annotation'
        ]]>
    </command>

    <inputs>
	<!-- Reference annotation -->
        <param name="input1" type="select" label="Select a reference annotation. Ensure that you select the correct organism - it should match the reference genome selected (below).">
            <options from_data_table="AA_reference_annotation">
                <filter type="sort_by" column="2" />
                <validator type="no_options" message="No reference annotations are available" />
            </options>
        </param>
    </inputs>
    

    <outputs>
	<data name="reference_annotation" type="data" format="gff3" label="output" />
    </outputs>

</tool>```

Sean,

You can tell downstream tools the dataset’s extension using the following syntax:

#if $input1.is_of_type('fasta.gz')
    #set $input_file = 'input.fasta.gz'
    ln -s '$input1' input.fasta.gz
#elif $input1.is_of_type('fasta')
    #set $input_file = 'input.fasta'
    ln -s '$input1' input.fasta
#end if
<command> --input $input_file

Hi Dave, thanks for your reply.
I had seen the is_of_type() function used similarly in another tool, but for some reason with this tool that I am writing, I get the error cannot find 'is_of_type' while searching for 'is_of_type' when the workflow runs. I suspect my $input1 is not of the correct type to have that function available.

Also, I am a little confused about the last line with the opening <command> tag. Is this meant to go in the downstream tool?

I was a bit unclear, my mistake. The <command> was meant to indicate whichever command you’d run for your tool, e.g. bwa.

The same syntax in your XML:

    <command>
    <![CDATA[
        #if $input1.is_of_type('fasta.gz')
            #set $input_file = 'input.fasta.gz'
            ln -s '$input1' input.fasta.gz
        #elif $input1.is_of_type('fasta')
            #set $input_file = 'input.fasta'
            ln -s '$input1' input.fasta
        #end if
        awesometool --input $input_file
        ]]>
    </command>