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

Reverse complements #220

Closed
marcelm opened this issue Nov 29, 2016 · 6 comments
Closed

Reverse complements #220

marcelm opened this issue Nov 29, 2016 · 6 comments
Labels

Comments

@marcelm
Copy link
Owner

@marcelm marcelm commented Nov 29, 2016

There should be an option to process both a read and its reverse complement. After adapter detection, it needs to decide which of the two versions it keeps.

@peterjc

This comment has been minimized.

Copy link

@peterjc peterjc commented Oct 2, 2019

And, as discussed on #402, optionally return the reverse complement if flipping was needed.

@marcelm

This comment has been minimized.

Copy link
Owner Author

@marcelm marcelm commented Oct 2, 2019

I’ve closed #402 in favor of this issue.

Copying one of my comments:

Similar to Mothur, I’d like to implement this by searching both the read and its reverse complement for the adapter.

In your case, if the adapter was found on the reverse complement, would you like to have the reverse-complemented (and of course trimmed) sequence in the output? Or would you prefer to have it in the original orientation?

Reverse-complementing the output would be quite nice for a use case that I have because it would allow me to “normalize” the read orientation.

I will probably implement both options, but I’d like to know how to name them and with which one to start.

Brainstorming:

  • --reverse-complements (and perhaps --rc=yes or --revcomp as aliases) would not modify read orientations
  • --rc-normalize, --normalize or perhaps --rc=normalize would modify read orientations.

I could then imagine that some people would want to have an indication of whether a read has been reverse-complemented by some extra string in the header. I’m not sure how to do this. One idea is to use the --suffix option and allow some special string such as {rc} in the given suffix.

Oh, and I guess we need to count how many reads were reverse-complemented and print that in the report.


To which @koopkaup replied:

I think it makes downstream analysis easier if reverse reads were reverse complemented. Maybe make that the default option and add --norevcomp for keeping the original orientation.

@marcelm

This comment has been minimized.

Copy link
Owner Author

@marcelm marcelm commented Oct 2, 2019

I’m working in branch revcomp. My to do list:

  • Create a test dataset for single-end and paired-end reads. (Re-use the R1 file from the paired-end dataset to test single-end functionality.)
  • Implement a reverse complement function.
  • Add the command-line option(s).
  • Think about where the reverse complementation needs to be done. Is it Single-/PairedEndPipeline or (Paired-)AdapterCutter? Or a new class? → A new class.
  • Find out which other options reverse-complementation could interact with.
  • Implement the actual logic for single-end reads: revcomp if requested and re-check for adapter matches, then somehow pick one version.
  • Implement logic for paired-end reads (also swap R1 and R2).
  • Keep track of how often a read or read pair was reverse-complemented.
  • Show the count in the report
  • Write changelog and documentation
@peterjc

This comment has been minimized.

Copy link

@peterjc peterjc commented Oct 2, 2019

If my primers are not found on the original orientation, I would like you to try the reverse complement - and if the primers match return the trimmed reverse complement. I think @koopkaup wanted the same.

Possible API suggestions:

  • --revcomp false = ignore reverse complement, current behaviour, default
  • --revcomp true = if not match, check rev-comp, and if that matches return trimmed read in original orientation (is there a use case?)
  • --revcomp normalize = if no match, check rev-comp, and if that matches return trimmed read flipped to the rev-comp orientation

Or more simply:

  • no switch = ignore reverse complement, current behaviour, default
  • --revcomp = if no match, check rev-comp, and if that matches return the rev-comp trimmed read (i.e. flip the orientation)
marcelm added a commit that referenced this issue Oct 2, 2019
Statistics and documentation are missing

issue #220
marcelm added a commit that referenced this issue Oct 17, 2019
Statistics and documentation are missing

issue #220
@marcelm marcelm mentioned this issue Oct 26, 2019
marcelm added a commit that referenced this issue Nov 4, 2019
Statistics and documentation are missing

issue #220
marcelm added a commit that referenced this issue Nov 8, 2019
Statistics and documentation are missing

issue #220
marcelm added a commit that referenced this issue Jan 9, 2020
Statistics and documentation are missing

issue #220
@marcelm marcelm closed this in 2a0c105 Jan 10, 2020
@marcelm

This comment has been minimized.

Copy link
Owner Author

@marcelm marcelm commented Jan 10, 2020

This is now implemented. I’ve added only a --revcomp option that always normalizes. If there’s a use case for not normalizing, please file a new issue.

@marcelm

This comment has been minimized.

Copy link
Owner Author

@marcelm marcelm commented Jan 13, 2020

I’ve released version 2.8 just now, which includes --revcomp.

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.