-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Peter, I saw that in an initial search for genbank modules, however it didn't meet our requirements (lack of features/"heavy" by requiring all of emboss). And, you are correct, it doesn't fix the problem. Thanks for the suggestion. Cheers, Eric On 07/15/2014 03:14 AM, Peter Cock wrote:
Hi Eric
There is already a genbank format in the EMBOSS datatypes (although there is talk of defining this and others in a set of smaller repositories defined as its dependencies for more modularity). Note it uses "genbank" not "gb" as the name!
https://toolshed.g2.bx.psu.edu/view/devteam/emboss_datatypes
However that doesn't answer your question :(
Peter
On Mon, Jul 14, 2014 at 7:31 PM, Eric Rasche <rasche.eric@yandex.ru> wrote: 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", line 206, in load_datatypes module = getattr( module, mod ) AttributeError: 'module' object has no attribute 'genbank'
Here's my lib/galaxy/datatypes/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/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAEBAgAGBQJTxULLAAoJEMqDXdrsMcpVtsAP/j8i8rNcrJqgOCnYexD2dHoQ yn6JYRQRNziJrqhwVTuH1i47rFJXUoo2whaD4QKwSnrXg0iQSpSgiM74e+IKmOFQ lnqyQQP50YHMars3U9441T15GcSSpNEW1FwxtBIrIt76bV26BPx+YKqhukA76eQ8 e5X+HRPsFu8+jczL0zcAv5DGSmskoJz6wDc9jlaWbFu21mjPPZiY6FFdXZaBR/h2 AesD68P85d4sygzcE42BDuSUg2obPSiBA5DJ/CMWlUNDeZi4V6/KO/F2LmC2PAak rR9xSSS2HXryuqREzRX8Ny1jq6Y0v34zTjObwtWTExE2olTPqPxB0pvEsaoKFis7 KNEP9qLgOMTKjCTzrb1qRgQ5Iq5utNP0TyYEWGQKolpGA1L7updETFfQBw9PY2pu /w8EkRzd6zermy2cQFYRKgvR081R6jwngJV4UUG2FXH6+bFAK4knpQ1+fT0/2PoD qIxnB5bEUW00RiJRnKbMCWoepcl4CAQepLdgHa0ofYMNkPsZIi2mR6DBv49HRx9v P56TRNfXDYW0nyoFRkQKNlMafjWg8ykOUsHVAcC++uicCLebWWHrQWNMEsWQr7Qk QIg1YLhejYK1Lfiafqnu23xMat2TVS149w4bik9VNhvtIxImOvoXCpU5EpDCq2BG gCTFHSzb7/kS3yvj1EQQ =qop5 -----END PGP SIGNATURE-----