Hey Mark,

A few things, instead of printing stuff out you could use the global
variable log in the binary.py file. Maybe something like
log.warn("SNIFFING csra"). I think your logging statements will be
more likely to show up then.

I don't know why what you are doing won't work (it looks like it
should), but a recent dist update included some changes that I
submitted that allow for the addition of binary datatypes without
needing to modify upload.py which I think is a big improvement. I
would recommend updating galaxy and transitioning to this new
mechanism.

I have been working with Ira Cooke to gather a lot of generally useful
proteomics datatypes into one place, this includes Pieter Neerincx RAW
file datatype from the original dev list e-mail you linked to so it is
a good example of how this has changed. Here is said file:

https://bitbucket.org/iracooke/protk-toolshed/src/tip/lib/galaxy/datatypes/proteomics.py

Basically, after you define your binary type all you need to do is
register it as a sniffable binary format, in your case this would be
adding this line:

Binary.register_sniffable_binary_format('crsa', 'crsa', Crsa)

after the last line of this example: http://pastie.org/5030960. Note
there is no indenting this should be at the top level of the python
code.

As a side note (since this isn't documented anywhere else), in the
proteomics.py example I went a step further to allow for backward
compatibility with Galaxy versions predating the inclusion of these
binary datatype rewrites by using the following construct:

if hasattr(Binary, 'register_sniffable_binary_format'):
    Binary.register_sniffable_binary_format('RAW', 'RAW', RAW)

I hope this helps, but I imagine my rambling e-mails only ever serve
to confuse issues.

-John

------------------------------------------------
John Chilton
Senior Software Developer
University of Minnesota Supercomputing Institute
Office: 612-625-0917
Cell: 612-226-9223
Bitbucket: https://bitbucket.org/jmchilton
Github: https://github.com/jmchilton
Web: http://jmchilton.net

On Wed, Oct 10, 2012 at 1:21 PM, Mark Johnson <mjohn...@ncbi.nlm.nih.gov> wrote:
> I'm trying to add CSRA (NCBI Compressed Sequence Read Archive) as a new
> datatype for Galaxy.
>
> I've followed the instructions on the wiki, and the module seems to load OK.
> csra shows up as a datatype in the upload view.
>
> But the upload fails, and the uploaded file size is always 0. The actual
> file I upload is 156k.
>
> Here are my changes:
>
> In binary.py:
> http://pastie.org/5030960
>
> In upload.py (following the example at
> http://dev.list.galaxyproject.org/Binary-datatypes-td4135969.html):
> http://pastie.org/5030967
>
> datatypes_conf.xml:
> http://pastie.org/5030970
>
> I also have a very hard time debugging Galaxy. Where can I look for an error
> stream that explains what it's doing? paster.log only tells me the HTTP
> traffic. I need to know where it is failing to know where to look. And my
> code needs to be able to, at the very least, print debug messages. How do
> people generally do that in Galaxy?
>
> Thanks
>
> --Mark Johnson
>
>
> ___________________________________________________________
> 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:
>
>   http://lists.bx.psu.edu/
___________________________________________________________
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:

  http://lists.bx.psu.edu/

Reply via email to