Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

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

    Comment


    • #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


      • #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


        • #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


          • #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


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

              Comment


              • #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


                • #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


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

                    Comment


                    • #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


                      • #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


                        • #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


                          • #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

                            • seqadmin
                              Essential Discoveries and Tools in Epitranscriptomics
                              by seqadmin


                              The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                              Yesterday, 07:01 AM
                            • seqadmin
                              Current Approaches to Protein Sequencing
                              by seqadmin


                              Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                              04-04-2024, 04:25 PM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by seqadmin, 04-11-2024, 12:08 PM
                            0 responses
                            55 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-10-2024, 10:19 PM
                            0 responses
                            51 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-10-2024, 09:21 AM
                            0 responses
                            45 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-04-2024, 09:00 AM
                            0 responses
                            55 views
                            0 likes
                            Last Post seqadmin  
                            Working...
                            X