-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

For those reading this thread from the future, there's a secret to
adding completely new datatypes locally (and not through a toolshed).

You have to manually edit lib/galaxy/datatypes/registry.py and import
the module you've written at the top of the file.

For instance, if you add a new "gbk.py" datatype, you'll need to add
"import gbk" to the top of registry.py. This will cause your errors to
go away and your datatype to be loaded on startup.

Thanks to John Chilton for answering this on IRC.

Cheers,
Eric

On 07/16/2014 09:02 AM, Eric Rasche wrote:
> Forgive me, I'm not 100% clear on the custom plugin system used by
> galaxy, but if I "subclass" from the text data type, will sniffers I
> implement override text's and function? The lack of being able to add an
> entry to the sniffer section (unlike with the tabular example) led me to
> believe my genbank datatype wouldn't be sniffed.
> 
> Additionally, I'd still like to be able to add completely new datatypes,
> do you know of any working examples of this? As mentioned in my original
> post, duplicating an existing datatype and changing names on it
> surprisingly doesn't work.
> 
> I'd be lovely to have the emboss datatypes split out.
> 
> Cheers,
> Eric
> 
> On July 16, 2014 8:34:55 AM CDT, Peter Cock <p.j.a.c...@googlemail.com>
> wrote:
> 
>     Indeed - ideally (once working) we can upload under the IUC ToolShed as a
>     community maintained resource rather than under a personal account which
>     becomes a single point of failure (the bus factor).
> 
>     We (the ICU) have previously discussed doing this so that the EMBOSS
>     datatypes could become more of a meta-entry depending on other smaller
>     specific datatype defining ToolShed repositories. But it hasn't reached 
> the
>     top of my personal TODO list yet ;)
> 
>     Peter
> 
>     On Wed, Jul 16, 2014 at 1:47 PM, Björn Grüning
>     <bjoern.gruen...@gmail.com> wrote:
> 
>         Hi Eric,
> 
>         please have a look at:
> 
>         
> https://github.com/bgruening/galaxytools/blob/master/datatypes/msa_datatypes/datatypes_conf.xml
> 
>         You need somthing like:
>         <datatype extension="genbank" type="galaxy.datatypes.data:Text"
>         subclass="True" />
> 
>         Lets try to split the EMBOSS datatypes a little bit into small
>         chunks. E.g.
>         sequences_datatypes, msa_datatypes ... and so on ...
> 
>         Cheers,
>         Bjoern
> 
> 
>         Am 14.07.2014 20:31, schrieb Eric Rasche:
> 
> I'm trying to add a new datatype to my galaxy instance for
> genbank
> files, however I'm running into various issues. I've
> followed the
> tutorial
> (https://wiki.galaxyproject.org/Admin/Datatypes/Adding%20Datatypes)
> 
> however that example subclasses tabular, and I'd like to
> subclass Text
> as they're plain text files, and I'd like to be able to
> define a sniffer
> for them (not possible if your type=galaxy.datatypes.data:Text)
> 
> I figured the call ought to be something like
> 
> <datatype extension="gb" type="galaxy.datatypes.data:Genbank"
> subclass="True" />
> 
> however, everything I try fails with
> 
>     Error importing datatype module galaxy.datatypes.data:
>     'module' object
>     has no attribute 'Genbank'
> 
> 
> 
> To avoid this particular issue, I tried writing a separate
> datatype just
> for genbank files (type="galaxy.datatypes.genbank:Genbank"),
> however
> that fails with the same error:
> 
>     galaxy.datatypes.registry ERROR 2014-07-14 13:23:23,100
>     Error importing
>     datatype module galaxy.datatypes.genbank: 'module'
>     object has no attribute
>     'genbank'
>     Traceback (most recent call last):
>     File
>     "/home/hxr/work/galaxy-central/lib/galaxy/datatypes/registry.py
>     <http://registry.py>",
>     line 206, in load_datatypes
>     module = getattr( module, mod )
>     AttributeError: 'module' object has no attribute 'genbank'
> 
> 
> 
> Here's my lib/galaxy/datatypes/genbank.py
> <http://genbank.py> looks like:
> 
>     import pkg_resources
>     pkg_resources.require( "bx-python" )
>     import logging
>     from galaxy.datatypes import data
>     log = logging.getLogger(__name__)
> 
>     class Genbank( data.Text ):
>     file_ext = "gb"
> 
>     def sniff( self, filename ):
>     header = open(filename).read(5)
>     return header == 'LOCUS'
> 
> 
> 
> To debug this, I've tried copying the tabular data type
> completely,
> removed all the classes other than Tabular, and renamed it
> "Genbank",
> however this fails too with the same error.
> 
> Can anyone offer some insight?
> 
> Cheers,
> Eric
>             
> ------------------------------------------------------------------------
> 
>             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/
> 
>             To search Galaxy mailing lists use the unified search at:
>             http://galaxyproject.org/search/mailinglists/
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         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/
> 
>         To search Galaxy mailing lists use the unified search at:
>         http://galaxyproject.org/search/mailinglists/
> 
> 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJTx+w/AAoJEMqDXdrsMcpVXqgP/0IaiufJwoP5gKS1suQ8fLJz
U/V/9ysgZsW0NUfZR7sCuPP/h6x+HlhRM41IweoYwqDI5qJHClrDIHahYNM4rJ76
OyP1qgpQdlZE8R/kveKRUIEh1YpzAHsIZlFUAnuuFrEeJN2QGrmffsuDEQ/E5AoS
tvLxcFrJ1gY45KhfhUr9OLgsTX1pt30jlgswzlG7I6ii3hmWgex/EKh+Xf0CRJHD
fIS0qc3RNzrxvUmfFtXlFLn6WM/ZbJyLMB4qE8B2S2hLvIQa14KlsziCs9n13GtW
qr0o+6E05LpqbKYCFvINEbasyxjVpFKoccRYWsZNu8UP3taiyw14COTgqvlnyXJQ
QlM7a8NlmG2wnOpuwY2uEnqbAKeaUbtawz0jIlRGbVs4x7TkC/O8UrL8VTcqOt+0
s5Ix2Rf5qevt5jKIvLxHxjwXvP3mP8gZSWJjMG31Kq3vQjErNn/bczb3WKgfVCW7
h39bjt0nALam5bLcHcCvzS39/ea0M7NlvJqUA1b/a/ViqIxru3IPL927fWsvACe/
1Cfep6gFc/tmJHZM8hZEtgiOnh8pqkGOiuEevM4NAaBLWsrT1a/oijq9xQEyoG2+
vEyFmzGF1DmqELRdh97AD7MWqlZSB3V+TfsuEboF+67sB1p0MLv5HQthtP63k9eH
0xstC2V6X0LHoTMUDiwa
=ClA/
-----END PGP SIGNATURE-----
___________________________________________________________
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Reply via email to