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

Add optional merging and trimming #142

Merged
merged 56 commits into from
Mar 4, 2019
Merged

Add optional merging and trimming #142

merged 56 commits into from
Mar 4, 2019

Conversation

maxibor
Copy link
Member

@maxibor maxibor commented Feb 11, 2019

In response to #137

Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested on pull requests (PRs).

PR checklist

  • This comment contains a description of changes (with reason)
  • If you've fixed a bug or added code that should be tested, add tests!
  • If necessary, also make a PR on the nf-core/eager branch on the nf-core/test-datasets repo
  • Ensure the test suite passes (nextflow run . -profile test,docker).
  • Make sure your code lints (nf-core lint .).
  • Documentation in docs is updated
  • CHANGELOG.md is updated
  • README.md is updated

Learn more about contributing: https://github.com/nf-core/eager/tree/master/.github/CONTRIBUTING.md

Copy link
Member

@apeltzer apeltzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atm, this doesn't allow skipping the entire module and thus conflicts a bit with the open PR #138 - could you adjust these to also allow an entire skipping of the AR2 process in general, not just the merging part? Some people might want to run adapter clipping but without merging (which is now possible), others might just want to skip AR entirely - which isn't possible yet (see other PR #138). I guess it makes more sense to include #138 into this PR here and make it work 👍

Thanks for contributing, much appreciated!

docs/usage.md Outdated Show resolved Hide resolved
docs/usage.md Outdated Show resolved Hide resolved
main.nf Outdated Show resolved Hide resolved
main.nf Outdated Show resolved Hide resolved
main.nf Outdated Show resolved Hide resolved
@maxibor maxibor changed the title Add optional merging Add optional merging and trimming Feb 12, 2019
@maxibor
Copy link
Member Author

maxibor commented Feb 12, 2019

Integrating PR #138
Now inivudualized to:

  • skip_collapse
  • skip_trim

It it now possible to:

  • trim but not collapse
  • collapse but not trim
  • avoid collapssing and trimming alltogether (skips ar2)

I went with the "lazy" option of skipping ar2 by changing the script of the ar2 process to just a simple mv.
However, it is suboptimal and might need some rewriting later with something like that.

Also, I think there is an issue with the test of damageprofiler that always errors with the last test (from the bam file)
nextflow run ${TRAVIS_BUILD_DIR} -profile testbam,docker --bam

main.nf Outdated
@@ -44,6 +44,8 @@ def helpMessage() {
--saveReference Saves reference genome indices for later reusage

Skipping Skip any of the mentioned steps
--skip_collapse Skip merging Forward and Reverse reads together. (Only for pairedEnd samples)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be clearer/more consistent to have a --skip_adapterremoval flag here (which switches both --skip_collapse and --skip_trim to false).

Then we move the --skip_collapse and --skip_trim in help message to 'AdapterRemoval' section, as in that section you're actually modifying the module, not turning entire modules on and off.

main.nf Outdated Show resolved Hide resolved
@apeltzer
Copy link
Member

Hi @maxibor @jfy133 ! I'll go through the code asap and will adjust the testcase or figure out why it fails now. Probably something smaller, but anyways a good point to check it first 👍

@apeltzer
Copy link
Member

apeltzer commented Mar 1, 2019

Sorry for not looking at this earlier - I'll take some time very soon to get this in and comment on the various points to get this going 👍

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

I fixed the merge conflicts and we'll see if things work fine now - once this passes I think I'm already pretty happy about it - maybe some option renaming as @jfy133 suggested and some docs / changelog updates and we're almost good to go 👍

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

Ok, bam input is broken now - everything else works fine - @maxibor do you want to take a look at this and maybe also have the command line switches as suggested by @jfy133 implemented?

@maxibor
Copy link
Member Author

maxibor commented Mar 4, 2019

Ok, bam input is broken now - everything else works fine - @maxibor do you want to take a look at this and maybe also have the command line switches as suggested by @jfy133 implemented?

  • Matched @jfy133 skip_* pattern suggestion
  • Updated test
  • Updated doc
  • Local executor selection when skip_adapterremoval is set to true to avoid waiting for job scheduler (SLURM, SGE, ...) to allocate ressources for a simple mv

@jfy133
Copy link
Member

jfy133 commented Mar 4, 2019

Looks good me now. Have you tested it locally yourself? I've never had any cases where I needed to skip collapse or merge so I cant see what happens downstream. Edit: meant collapse or trim

I'll try and test the skip module itself this evening. Edit2: Confirm --skip_adapterremoval works with no issue on my test case.

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

I guess we could actually use a mix operator here to get around the local executor. Might have a look too :-)

@jfy133
Copy link
Member

jfy133 commented Mar 4, 2019

Note to self once merged: add to docs saying that if --skip_adapterremoval selected by user, the input FASTQs must be with --singleEnd

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

Is that true? I mean it wouldn't be a big issue to make both bwa, bwa alncapable of running in PE mode then for these cases as we have the command line switch already there and present. I could even add specific tests to test this behaviour as well... ?

@jfy133
Copy link
Member

jfy133 commented Mar 4, 2019

Is that true? I mean it wouldn't be a big issue to make both bwa, bwa alncapable of running in PE mode then for these cases as we have the command line switch already there and present. I could even add specific tests to test this behaviour as well... ?

Partly true. That note would admittedly be aimed more more novice users (I will switch out 'must' with 'generally will be'). But I personally can't think of any case where you would run paired end data without merging/trimming. Although on second thoughts that's maybe what Alex Huebner was partly referring to with the whole modern data issue in #64 ...

At least in my experience the only time when I wanted to skip AR was when I had already processed it previously and wanted to map the merged/trimmed data to a different reference genome.

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

Yes, but as we already have everything configurable now - I'm working on adding the purely modern handling (just apply trimming to reads, keep them as pairs and map them using bwa/bwa mem in PE mode) as an option in the pipeline too. This will just require speciying --skip_collapse when having PE data, then just trimming will be applied and mapping will happen in PE mode as one would do for modern data 👍

@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

maxibor#1

Here you go - once this is merged, we can basically just add something on top of it :-)

@apeltzer apeltzer changed the base branch from dev to ar_optional March 4, 2019 21:29
@apeltzer
Copy link
Member

apeltzer commented Mar 4, 2019

I merged this into the ar_possible branch and will merge my changes on top of this - this should make it possible for both of us to have a final check before merging to dev in the end!

@apeltzer apeltzer merged commit 291990f into nf-core:ar_optional Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants