Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with cutadapt --length for paired-end reads #345

Closed
mdurante1 opened this issue Dec 12, 2018 · 4 comments

Comments

@mdurante1
Copy link

commented Dec 12, 2018

Hi,

I am using cutadapt version 1.18 installed by conda on python 2.7.15. When I run cutadapt to trim the reads to a certain length it trims read 1 but does not trim read 2 accordingly. I checked this using fastqc and this can be observed in the "total written" output. Is my command correct or is there a way to properly reduce the length of my paired-end reads?

Thanks,
Michael

(py2.7) [mdurante@n002 UMM066_VDJ_T_220_run2]$ cutadapt --length 151 -o UMM066_VDJ_T_220_run2_S1_L001_R1_001.trim.fastq.gz -p UMM066_VDJ_T_220_run2_S1_L001_R2_001.trim.fastq.gz UMM066_VDJ_T_220_run2_S1_L001_R1_001.fastq.gz UMM066_VDJ_T_220_run2_S1_L001_R2_001.fastq.gz
This is cutadapt 1.18 with Python 2.7.15
Command line parameters: --length 151 -o UMM066_VDJ_T_220_run2_S1_L001_R1_001.trim.fastq.gz -p UMM066_VDJ_T_220_run2_S1_L001_R2_001.trim.fastq.gz UMM066_VDJ_T_220_run2_S1_L001_R1_001.fastq.gz UMM066_VDJ_T_220_run2_S1_L001_R2_001.fastq.gz
Processing reads on 1 core in paired-end legacy mode ...
WARNING: Legacy mode is enabled. Read modification and filtering options
*ignore* the second read. To switch to regular paired-end mode,
provide the --pair-filter=any option or use any of the
-A/-B/-G/-U/--interleaved options.
Finished in 581.49 s (19 us/read; 3.08 M reads/minute).

=== Summary ===

Total read pairs processed:         29,856,488
  Read 1 with adapter:                       0 (0.0%)
  Read 2 with adapter:                       0 (0.0%)
Pairs written (passing filters):    29,856,488 (100.0%)

Total basepairs processed: 18,033,318,752 bp
  Read 1: 9,016,659,376 bp
  Read 2: 9,016,659,376 bp
Total written (filtered):  13,524,989,064 bp (75.0%)
  Read 1: 4,508,329,688 bp
  Read 2: 9,016,659,376 bp
@marcelm

This comment has been minimized.

Copy link
Owner

commented Dec 12, 2018

Thanks for the report. To get the desired behavior, you should follow the advice given in the note that Cutadapt prints:

WARNING: Legacy mode is enabled. Read modification and filtering options
*ignore* the second read. To switch to regular paired-end mode,
provide the --pair-filter=any option or use any of the
-A/-B/-G/-U/--interleaved options.

You are using --length, which is a read-modification option. Because Cutadapt is running in “legacy mode” in your case, that option is not applied to the second read. So just add --pair-filter=any to your options and it should work.

Legacy mode exists for compatibility with very old Cutadapt versions. That it is enabled here is actually a bug that I need to fix. And posssibly I just remove the legacy mode entirely in the next major version. There have been many bug reports like yours where people stumble over this suprising behavior (this is why the warning gets printed nowadays).

@marcelm marcelm closed this in fdd5e60 Dec 12, 2018

@marcelm

This comment has been minimized.

Copy link
Owner

commented Dec 12, 2018

I fixed the bug now such that --length no longer enables legacy mode. I think I will remove legacy mode entirely as well, but in any case, the next release will be fixed.

@marcelm

This comment has been minimized.

Copy link
Owner

commented Dec 12, 2018

See issue #330

@mdurante1

This comment has been minimized.

Copy link
Author

commented Dec 13, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.