Hi Yvan,

We had this issue as well, and fixed it for now by adding the checkers.py from an old galaxy server. I've added it in attachment if you don't have it anymore.


put it in "galaxy-dist/lib/galaxy/datatypes/checkers.py"

If relevant, I also made a few changes to the stacks script itself, but I can't remember if is was related (I think due to ordereddict module in different python versions)

diff -r 0e0ff9e9c761 stacks.py
--- a/stacks.py Mon Sep 28 13:21:35 2015 +0000
+++ b/stacks.py Fri May 20 17:53:56 2016 +0200
@@ -14,6 +14,8 @@
 import os, sys, re, shutil
 import glob
 import collections
+import ordereddict
+from ordereddict import OrderedDict
 import gzip, zipfile, tarfile
 import subprocess
 from galaxy.datatypes.checkers import *
@@ -31,7 +33,8 @@
 """
 def galaxy_config_to_tabfiles(input_config):

-       tab_files=collections.OrderedDict()
+       #tab_files=collections.OrderedDict()
+       tab_files=OrderedDict()
        for line in open(input_config, "r").readlines():
                if line.strip() != '':
                        extract=line.strip().split("::")
@@ -43,7 +46,8 @@

 def galaxy_config_to_tabfiles_for_STACKS(input_config):

-       tab_files=collections.OrderedDict()
+       #tab_files=collections.OrderedDict()
+        tab_files=OrderedDict()
        for line in open(input_config, "r").readlines():
                if line.strip() != '':
                        extract=line.strip().split("::")


On 2016-05-20 17:28, Yvan Le Bras wrote:
Thank you John for the rapid answer and the PR!

I have had the same issue trying installing and use a Galaxy-M instance (https://gigascience.biomedcentral.com/articles/10.1186/s13742-016-0115-8) . I cc Ralf concerning this.

Cheers,

Yvan

------------------------------------------------------------------------

    *De: *"John Chilton" <jmchil...@gmail.com>
    *À: *"Yvan Le Bras" <yvan.le_b...@irisa.fr>
    *Cc: *"Amogelang Raphenya" <raphe...@mcmaster.ca>,
    galaxy-dev@lists.galaxyproject.org
    *Envoyé: *Vendredi 20 Mai 2016 17:15:19
    *Objet: *Re: [galaxy-dev] STACKS error

    This is one the reasons (though not the only one) I generally
    discourage putting datatypes in the tool shed - Galaxy isn't very
    clear about what interface it provides to datatypes and it would seem
    very difficult from my perspective to maintain that interface and grow
    Galaxy at the same time.

    This checkers module though is clearly useful to datatypes and it is
    quite trivial to provide backward compatibility so I've opened a PR to
    the new 16.04 release to restore this module -
    https://github.com/galaxyproject/galaxy/pull/2389.

    Sorry for the inconvenience.

    -John


    On Fri, May 20, 2016 at 10:45 AM, Yvan Le Bras
    <yvan.le_b...@irisa.fr> wrote:
    > Hi Amos,
    >
    > Thanks to use Stacks on Galaxy! I already seen this error. This
    is due, I
    > think, to newest Galaxy versions who don't have the checkers.py
    anymore on
    > the datatypes folder.... Thios can be fixed using an older
    Galaxy version...
    > Otherwise, we are working on a new version of the Stacks Galaxy
    tools... who
    > will be usable in the upcoming days.... or not ;)
    >
    > Cheers,
    >
    > Yvan
    >
    >
    > ________________________________
    >
    > De: "Amogelang Raphenya" <raphe...@mcmaster.ca>
    > À: galaxy-dev@lists.galaxyproject.org
    > Envoyé: Vendredi 20 Mai 2016 16:37:04
    > Objet: [galaxy-dev] STACKS error
    >
    >
    > Anyone encountered this error?
    >
    > Fatal error: Exit code 1 (Error in Stacks Process radtag execution)
    > Traceback (most recent call last):
    >   File
    >
    
"/galaxylab/production/new/shed_tools/toolshed.g2.bx.psu.edu/repos/cmonjeau/stacks/0e0ff9e9c761/stacks/STACKS_procrad.py",
    > line 16, in <module>
    >     from stacks import *
    >   File
    >
    
"/galaxylab/production/new/shed_tools/toolshed.g2.bx.psu.edu/repos/cmonjeau/stacks/0e0ff9e9c761/stacks/stacks.py",
    > line 19, in <module>
    >     from galaxy.datatypes.checkers import *
    > ImportError: No module named checkers
    >
    >
    > Cheers.
    >
    >
    > Amos Raphenya, B.Eng
    > Bioinformatics Software Developer
    > Department of Biochemistry & Biomedical Sciences
    > McMaster University, MDCL 2317
    > p: (905) 525-9140
    > a: 1280 Main St W.,Hamilton, Ontario, Canada L8S 4K1
    > e:  raphe...@mcmaster.ca
    > skype: amos_raphenya
    >
    >
    > ___________________________________________________________
    > 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/
    >
    >
    >
    >
    > --
    >
    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    > Yvan Le Bras, PhD
    > @Yvan2935
    > <°))))><
    >                   e-Biogenouest project
    > http://www.e-biogenouest.org
    >                        CNRS UMR 6074 IRISA-INRIA, Campus de
    Beaulieu, 35042
    > Rennes Cedex
> tél.: +33 (0) 2 99 84 71 79 / +33
    > (0) 6.10.43.96.51
    >
    > yvan.le_b...@irisa.fr
    >
    >
    > ___________________________________________________________
    > 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/




--
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Yvan Le Bras, PhD @Yvan2935          <°))))><
   e-Biogenouest project                  http://www.e-biogenouest.org
CNRS UMR 6074 IRISA-INRIA, Campus de Beaulieu, 35042 Rennes Cedex tél.: +33 (0) 2 99 84 71 79 / +33 (0) 6.10.43.96.51
yvan.le_b...@irisa.fr



___________________________________________________________
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/

import os, gzip, re, gzip, zipfile, binascii, bz2, imghdr
from galaxy import util

try:
    import Image as PIL
except ImportError:
    try:
        from PIL import Image as PIL
    except:
        PIL = None

def check_image( file_path ):
    if PIL != None:
        try:
            im = PIL.open( file_path )
        except:
            return False
        if im:
            return im
        return False
    else:
        if imghdr.what( file_path ) != None:
            return True
        return False

def check_html( file_path, chunk=None ):
    if chunk is None:
        temp = open( file_path, "U" )
    else:
        temp = chunk
    regexp1 = re.compile( "<A\s+[^>]*HREF[^>]+>", re.I )
    regexp2 = re.compile( "<IFRAME[^>]*>", re.I )
    regexp3 = re.compile( "<FRAMESET[^>]*>", re.I )
    regexp4 = re.compile( "<META[^>]*>", re.I )
    regexp5 = re.compile( "<SCRIPT[^>]*>", re.I )
    lineno = 0
    for line in temp:
        lineno += 1
        matches = regexp1.search( line ) or regexp2.search( line ) or regexp3.search( line ) or regexp4.search( line ) or regexp5.search( line )
        if matches:
            if chunk is None:
                temp.close()
            return True
        if lineno > 100:
            break
    if chunk is None:
        temp.close()
    return False

def check_binary( name, file_path=True ):
    # Handles files if file_path is True or text if file_path is False
    is_binary = False
    if file_path:
        temp = open( name, "U" )
    else:
        temp = name
    chars_read = 0
    for chars in temp:
        for char in chars:
            chars_read += 1
            if ord( char ) > 128:
                is_binary = True
                break
            if chars_read > 100:
                break
        if chars_read > 100:
            break
    if file_path:
        temp.close()
    return is_binary

def check_gzip( file_path ):
    # This method returns a tuple of booleans representing ( is_gzipped, is_valid )
    # Make sure we have a gzipped file
    try:
        temp = open( file_path, "U" )
        magic_check = temp.read( 2 )
        temp.close()
        if magic_check != util.gzip_magic:
            return ( False, False )
    except:
        return ( False, False )
    # We support some binary data types, so check if the compressed binary file is valid
    # If the file is Bam, it should already have been detected as such, so we'll just check
    # for sff format.
    try:
        header = gzip.open( file_path ).read(4)
        if binascii.b2a_hex( header ) == binascii.hexlify( '.sff' ):
            return ( True, True )
    except:
        return( False, False )
    CHUNK_SIZE = 2**15 # 32Kb
    gzipped_file = gzip.GzipFile( file_path, mode='rb' )
    chunk = gzipped_file.read( CHUNK_SIZE )
    gzipped_file.close()
    # See if we have a compressed HTML file
    if check_html( file_path, chunk=chunk ):
        return ( True, False )
    return ( True, True )

def check_bz2( file_path ):
    try:
        temp = open( file_path, "U" )
        magic_check = temp.read( 3 )
        temp.close()
        if magic_check != util.bz2_magic:
            return ( False, False )
    except:
        return( False, False )
    CHUNK_SIZE = 2**15 # reKb
    bzipped_file = bz2.BZ2File( file_path, mode='rb' )
    chunk = bzipped_file.read( CHUNK_SIZE )
    bzipped_file.close()
    # See if we have a compressed HTML file
    if check_html( file_path, chunk=chunk ):
        return ( True, False )
    return ( True, True )

def check_zip( file_path ):
    if zipfile.is_zipfile( file_path ):
        return True
    return False

def is_bz2( file_path ):
    is_bz2, is_valid = check_bz2( file_path )
    return is_bz2

def is_gzip( file_path ):
    is_gzipped, is_valid = check_gzip( file_path )
    return is_gzipped
___________________________________________________________
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/

Reply via email to