Ok, so I don't give the user the option to select the correct data type to reduce the amount of stuff the user has to know when using the tool.

I do leave the format as auto and Galaxy just leaves it as the generic data type 'data'.

As for how the format is defined in Galaxy, I'm not quite sure what the answer to this question is because I am just testing the tool with really simple text files, with extension .txt. and it can't seem to pick it up, it just leaves it as 'data'. Also not quite sure how to test the Python code in the sniff function outside of Galaxy... (only starting working with Galaxy 3 weeks ago).

Let me know if I should provide you with the tool config file if that would be a little more useful. It's quite straightforward
Thanks for helping with this.

On Wed, Jun 29, 2016 at 11:16 AM, Peter Cock <p.j.a.cock@googlemail.com> wrote:
OK. What happens?

Can you select the correct datatype in the upload tool?
If not, check the file format definition as some file formats
are configured not to appear here.

Are you leaving the datatype as "auto"? If so, does
Galaxy fail to identify the file, and leave it as the
default generic "data" type, or does Galaxy mis-identify
it as another type?

Have you looked at the Galaxy logs while doing the
upload?

How is this file format defined in Galaxy? Did you add it?
Can you test the Python code in the sniff function outside
of Galaxy to confirm that works?

If Galaxy wrongly picks another fileformat, check where
in the datatypes_conf.xml is your file format listed? The
order the sniffing functions are run is important.

Peter

On Wed, Jun 29, 2016 at 3:56 PM, Katherine Beaulieu
<katherine.beaulieu014@gmail.com> wrote:
> I am trying to import a file into galaxy.
>
> On Wed, Jun 29, 2016 at 10:45 AM, Peter Cock <p.j.a.cock@googlemail.com>
> wrote:
>>
>> The auto-detection is only used when importing a
>> file into Galaxy (e.g. by uploading it).
>>
>> If you are writing a tool which produces output in your
>> format, then the tool's XML should specify that output
>> format.
>>
>> Which of these are you trying to do? Or both?
>>
>> Peter
>>
>> On Wed, Jun 29, 2016 at 3:36 PM, Katherine Beaulieu
>> <katherine.beaulieu014@gmail.com> wrote:
>> > Hmm, I must have some sort of other logic error which is preventing the
>> > detection of the format. Thanks for the information!
>> >
>> > On Wed, Jun 29, 2016 at 10:24 AM, Peter Cock <p.j.a.cock@googlemail.com>
>> > wrote:
>> >>
>> >> Have you invented your own file format, or are you using
>> >> an existing file format defined within Galaxy?
>> >>
>> >> The Galaxy file formats with automatic detection are all
>> >> defined via Python classes which define a sniff method.
>> >>
>> >> Peter
>> >>
>> >> On Wed, Jun 29, 2016 at 3:15 PM, Katherine Beaulieu
>> >> <katherine.beaulieu014@gmail.com> wrote:
>> >> > Hi everyone,
>> >> > I am looking to auto-detect the file format of a file outputted by a
>> >> > python
>> >> > tool I have written. Does anyone have any idea how to do this? I have
>> >> > tried
>> >> > setting the format attribute to "auto" with no luck. Let me know if
>> >> > you
>> >> > would like to see my tool config file.
>> >> > Cheers,
>> >> > Katherine
>> >> >
>> >> > ___________________________________________________________
>> >> > Please keep all replies on the list by using "reply all"
>> >> > in your mail client.  To manage your subscriptions to this
>> >> > and other Galaxy lists, please use the interface at:
>> >> >   https://lists.galaxyproject.org/
>> >> >
>> >> > To search Galaxy mailing lists use the unified search at:
>> >> >   http://galaxyproject.org/search/mailinglists/
>> >
>> >
>
>