Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daveiles
    Junior Member
    • Nov 2012
    • 7

    #1

    trim_galore cutadapt error

    Hi,
    Having installed trim_galore and cutadapt, I get the following error running the software:
    Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.3/bin/cutadapt", line 10, in <module>
    cutadapt.main()
    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 798, in main
    (n, total_bp) = process_reads(reader, pe_reader, adapter_matcher, quality_trimmer, modifiers, readfilter, trimmed_outfile, untrimmed_outfile, pe_outfile, rest_writer, options.trim_primer)
    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 504, in process_reads
    matches = adapter_matcher.find_match(read)
    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 428, in find_match
    match = self._best_match(read)
    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 393, in _best_match
    match = adapter.match(read)
    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/adapters.py", line 163, in match
    self.max_error_rate, self.where, self.wildcard_flags)
    File "calign.pyx", line 25, in cutadapt.calign.globalalign_locate (cutadapt/calign.c:795)
    TypeError: expected bytes, str found

    RUN STATISTICS FOR INPUT FILE: zr608_1_R1.fastq.gz
    =============================================
    0 sequences processed in total
    Illegal division by zero at /Users/daveiles/perl/trim_galore_v0.3.3/trim_galore line 565.

    I'd be pleased to hear from anyone who can suggest a solution
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Can you post the command line you are using? Are you providing the right Q-score switch (--phred33 or --phred64)?

    Comment

    • daveiles
      Junior Member
      • Nov 2012
      • 7

      #3
      As follows:
      trim_galore --phred33 --rrbs --non_directional zr608_1_R1.fastq.gz

      Alas, the same error is returned regardless of the phred option, and when cut adapt is run directly with no options.

      Here is the complete report...

      trim_galore --phred33 --rrbs --non_directional zr608_1_R1.fastq.gz
      Writing report to 'zr608_1_R1.fastq.gz_trimming_report.txt'

      SUMMARISING RUN PARAMETERS
      ==========================
      Input filename: zr608_1_R1.fastq.gz
      Quality Phred score cutoff: 20
      Quality encoding type selected: ASCII+33
      Adapter sequence: 'AGATCGGAAGAGC'
      Maximum trimming error rate: 0.1 (default)
      Minimum required adapter overlap (stringency): 1 bp
      Minimum required sequence length before a sequence gets removed: 20 bp
      File was specified to be an MspI-digested RRBS sample. Sequences with adapter contamination will be trimmed a further 2 bp to remove potential methylation-biased bases from the end-repair reaction
      File was specified to be a non-directional MspI-digested RRBS sample. Sequences starting with either 'CAA' or 'CGA' will have the first 2 bp trimmed off to remove potential methylation-biased bases from the end-repair reaction
      Output file(s) will be GZIP compressed

      >>> Now performing adaptive quality trimming with a Phred-score cutoff of: 20 <<<

      Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.3/bin/cutadapt", line 10, in <module>
      cutadapt.main()
      File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 798, in main
      (n, total_bp) = process_reads(reader, pe_reader, adapter_matcher, quality_trimmer, modifiers, readfilter, trimmed_outfile, untrimmed_outfile, pe_outfile, rest_writer, options.trim_primer)
      File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 504, in process_reads
      matches = adapter_matcher.find_match(read)
      File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 428, in find_match
      match = self._best_match(read)
      File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 393, in _best_match
      match = adapter.match(read)
      File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/adapters.py", line 163, in match
      self.max_error_rate, self.where, self.wildcard_flags)
      File "calign.pyx", line 25, in cutadapt.calign.globalalign_locate (cutadapt/calign.c:795)
      TypeError: expected bytes, str found

      >>> Quality trimming completed <<<
      0 sequences processed in total

      Unable to close file handle:

      Hope to get some pointers! Many thanks.

      Comment

      • fkrueger
        Senior Member
        • Sep 2009
        • 627

        #4
        Hmm, do you get the same error if you run the Cutadapt command directly on the command line? Which version of Cutadapt are you using?
        This is the command used for quality trimming:

        Code:
        cutadapt -f fastq -q 20 -a X zr608_1_R1.fastq.gz

        Comment

        • daveiles
          Junior Member
          • Nov 2012
          • 7

          #5
          Here goes...

          cutadapt -f fastq -q 20 -a X zr608_1_R1.fastq.gz
          Traceback (most recent call last):
          File "/Library/Frameworks/Python.framework/Versions/3.3/bin/cutadapt", line 10, in <module>
          cutadapt.main()
          File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 798, in main
          (n, total_bp) = process_reads(reader, pe_reader, adapter_matcher, quality_trimmer, modifiers, readfilter, trimmed_outfile, untrimmed_outfile, pe_outfile, rest_writer, options.trim_primer)
          File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 504, in process_reads
          matches = adapter_matcher.find_match(read)
          File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 428, in find_match
          match = self._best_match(read)
          File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/scripts/cutadapt.py", line 393, in _best_match
          match = adapter.match(read)
          File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/cutadapt/adapters.py", line 163, in match
          self.max_error_rate, self.where, self.wildcard_flags)
          File "calign.pyx", line 25, in cutadapt.calign.globalalign_locate (cutadapt/calign.c:795)
          TypeError: expected bytes, str found

          I installed cutadapt-1.3

          As the traceback reports, I have Python 3.3 installed on my Mac. Might this be an issue?

          Comment

          • GenoMax
            Senior Member
            • Feb 2008
            • 7142

            #6
            README for cutadapt indicates that python 3 should work. I am wondering if there is a problem with your sequence file. Do you have another sequence file (or an example from someplace) to verify that your install of trim-galore/cutadapt is working fine?

            Comment

            • daveiles
              Junior Member
              • Nov 2012
              • 7

              #7
              No. It doesn't matter what file I try to process, the error is the same.

              Comment

              • fkrueger
                Senior Member
                • Sep 2009
                • 627

                #8
                Hmm, if you use a valid DNA sequence for trimming instead of X, eg. -a AGATC, does it still produce the same error? If yes it might be worth contacting Marcel Martin directly (the developer of Cutadapt)?

                Comment

                • GenoMax
                  Senior Member
                  • Feb 2008
                  • 7142

                  #9
                  Are you able to fall back and use v.2.7.5 (that is what I have on a 10.9.x)? It appears that you must have installed v.3.3 yourself.

                  Comment

                  • daveiles
                    Junior Member
                    • Nov 2012
                    • 7

                    #10
                    I was going to do that when I had run out of options! I'd like to get the software running :-)

                    Comment

                    • daveiles
                      Junior Member
                      • Nov 2012
                      • 7

                      #11
                      Yes, I did install Python 3.3 (my Mac came with 3.0 pre-installed). I'll see if installing Python 2.7.5 makes any difference.

                      Comment

                      • GenoMax
                        Senior Member
                        • Feb 2008
                        • 7142

                        #12
                        I think you have, unless author of cutadapt can chime in about now.

                        Trimmomatic
                        is also an option if you want to wait on that downgrade for now. I am sure Felix won't mind

                        Comment

                        • fkrueger
                          Senior Member
                          • Sep 2009
                          • 627

                          #13
                          Originally posted by GenoMax View Post
                          I think you have, unless author of cutadapt can chime in about now.

                          Trimmomatic
                          is also an option if you want to wait on that downgrade for now. I am sure Felix won't mind
                          I absolutely don't mind, especially since it doesn't seem to come from Trim Galore itself and I am about to go skiing during which I don't have a lot of time solving problems anyway :P

                          Comment

                          • daveiles
                            Junior Member
                            • Nov 2012
                            • 7

                            #14
                            I installed Python 2.7.6 and then re-built and re-installed cutadapt..... trim_galore now runs smoothly. There must be a few lines of code that need editing to make cutadapt Python 3.3 compatible. I didn't spot anything, but I didn't look closely ;-)

                            Thanks for your help. Much appreciated.

                            Comment

                            Latest Articles

                            Collapse

                            • SEQadmin2
                              How Immunogenomics Decodes Immunity’s Genetic Blueprint
                              by SEQadmin2




                              The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

                              This convergence of genetics, immunology, and computation...
                              Yesterday, 05:41 AM
                            • SEQadmin2
                              Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                              by SEQadmin2



                              CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                              Despite this, “CRISPR helped turn genome editing from a specialized technique into
                              ...
                              07-31-2026, 11:01 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by SEQadmin2, 08-24-2026, 10:32 AM
                            0 responses
                            42 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 08-20-2026, 11:17 AM
                            0 responses
                            48 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 08-18-2026, 10:05 AM
                            0 responses
                            55 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 08-13-2026, 12:22 PM
                            0 responses
                            50 views
                            0 reactions
                            Last Post SEQadmin2  
                            Working...