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
                              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                              by SEQadmin2



                              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                              ...
                              10-14-2026, 09:55 AM
                            • SEQadmin2
                              New Genomics Technologies Take Aim at Long-Standing Limits
                              by SEQadmin2


                              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                              ...
                              09-28-2026, 10:25 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by SEQadmin2, 10-22-2026, 11:13 AM
                            0 responses
                            25 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-22-2026, 10:48 AM
                            0 responses
                            20 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-15-2026, 10:52 AM
                            0 responses
                            36 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 10-14-2026, 05:39 AM
                            0 responses
                            42 views
                            0 reactions
                            Last Post SEQadmin2  
                            Working...