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

Integrate cellranger workflow #90

Merged
merged 34 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c6da098
WIP cellranger workflow
grst Jan 26, 2022
796ad5b
Enable cellranger count
grst Jan 31, 2022
00d0908
Fix cellranger input path
grst Feb 21, 2022
562d0fa
Update check_samplesheet.py
fmalmeida May 23, 2022
09f7d87
Update check_samplesheet.py
fmalmeida May 23, 2022
e8b40a1
input check has a new parameter
fmalmeida May 23, 2022
b840c01
adding test_cellranger profile
fmalmeida May 24, 2022
b48778f
fixing schema for linting
fmalmeida May 24, 2022
fe6b82f
fixed unchanged templates with lint tool
fmalmeida May 24, 2022
e3f8108
Update ci.yml
fmalmeida May 27, 2022
b0cef8b
updating cellranger module to nf-core latest
fmalmeida May 30, 2022
180e627
Update check_samplesheet.py
fmalmeida May 30, 2022
910449c
Update kallistobustools_count.nf
fmalmeida May 30, 2022
d222ab4
Update scrnaseq.nf
fmalmeida May 30, 2022
3bc8b93
added parsing loop to handle replicates
fmalmeida May 31, 2022
60af471
added indentation to file
fmalmeida May 31, 2022
5998412
fixed cellranger test calling
fmalmeida May 31, 2022
6d4aada
Update check_samplesheet.py
fmalmeida May 31, 2022
3ed8ca3
updating cellranger module mkgtf to same version as count
fmalmeida May 31, 2022
84774fa
Delete .markdownlint.yml
fmalmeida May 31, 2022
e136763
updated to nf-core latest to have same docker image
fmalmeida May 31, 2022
7988823
Create .prettierrc.yml
fmalmeida May 31, 2022
f75a077
Update .prettierrc.yml
fmalmeida May 31, 2022
78674d9
Update nextflow.config
fmalmeida May 31, 2022
60aeed7
diminishing complexity on input channel generation
fmalmeida Jun 2, 2022
d8828bf
Update align_cellranger.nf
fmalmeida Jun 2, 2022
6d9caad
fixing and commenting channel generation
fmalmeida Jun 2, 2022
5955ac5
changing bad for loop
fmalmeida Jun 2, 2022
abf4b7e
Update align_cellranger.nf
fmalmeida Jun 2, 2022
5c2a21a
executed prettier on files
fmalmeida Jun 3, 2022
e44be22
Merge branch 'dev' into cellranger2
fmalmeida Jun 3, 2022
c8abde4
ran prettier after solving conflict
fmalmeida Jun 3, 2022
510a1b3
Revert "executed prettier on files" as it broke linting
fmalmeida Jun 3, 2022
ee5535b
added comment about input reads on relevant "local" modules
fmalmeida Jun 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Contributions to the code are even more welcome ;)

If you'd like to write some code for nf-core/scrnaseq, the standard workflow is as follows:

1. Check that there isn't already an issue about your idea in the [nf-core/scrnaseq issues](https://github.com/nf-core/scrnaseq/issues) to avoid duplicating work
* If there isn't one already, please create one so that others know you're working on this
1. Check that there isn't already an issue about your idea in the [nf-core/scrnaseq issues](https://github.com/nf-core/scrnaseq/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/scrnaseq repository](https://github.com/nf-core/scrnaseq) to your GitHub account
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
4. Use `nf-core schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
Expand Down Expand Up @@ -49,9 +48,9 @@ These tests are run both with the latest available version of `Nextflow` and als

:warning: Only in the unlikely and regretful event of a release happening with a bug.

* On your own fork, make a new branch `patch` based on `upstream/master`.
* Fix the bug, and bump version (X.Y.Z+1).
* A PR should be made on `master` from patch to directly this particular bug.
- On your own fork, make a new branch `patch` based on `upstream/master`.
- Fix the bug, and bump version (X.Y.Z+1).
- A PR should be made on `master` from patch to directly this particular bug.

## Getting help

Expand All @@ -73,7 +72,7 @@ If you wish to contribute a new step, please use the following coding standards:
6. Add sanity checks and validation for all relevant parameters.
7. Perform local tests to validate that the new code works as expected.
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
9. Update MultiQC config `assets/multiqc_config.yaml` so relevant suffixes, file name clean up and module plots are in the appropriate order. If applicable, add a [MultiQC](https://https://multiqc.info/) module.
9. Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name clean up and module plots are in the appropriate order. If applicable, add a [MultiQC](https://https://multiqc.info/) module.
10. Add a description of the output files and if relevant any appropriate images from the MultiQC report to `docs/output.md`.

### Default values
Expand All @@ -92,8 +91,8 @@ The process resources can be passed on to the tool dynamically within the proces

Please use the following naming schemes, to make it easy to understand what is going where.

* initial process channel: `ch_output_from_<process>`
* intermediate and terminal channels: `ch_<previousprocess>_for_<nextprocess>`
- initial process channel: `ch_output_from_<process>`
- intermediate and terminal channels: `ch_<previousprocess>_for_<nextprocess>`

### Nextflow version bumping

Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

name: Bug report
description: Report something that is broken or incorrect
labels: bug
body:

- type: markdown
attributes:
value: |
Expand Down
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ Remember that PRs should be made against the dev branch, unless you're preparing

Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/scrnaseq/tree/master/.github/CONTRIBUTING.md)
-->
<!-- markdownlint-disable ul-indent -->

## 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 you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/scrnaseq/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/scrnaseq _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/scrnaseq/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/scrnaseq _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] Make sure your code lints (`nf-core lint`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
- [ ] Usage Documentation in `docs/usage.md` is updated.
- [ ] Output Documentation in `docs/output.md` is updated.
- [ ] `CHANGELOG.md` is updated.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
run: |
{ [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/scrnaseq ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]


# If the above check failed, post a comment on the PR explaining the failure
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets
- name: Post PR comment
Expand Down Expand Up @@ -43,4 +42,3 @@ jobs:
Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false

1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
"test,docker --aligner alevin",
"test,docker --aligner kallisto",
"test,docker --aligner star",
"test,docker --aligner cellranger"
]
steps:
- name: Check out pipeline code
Expand Down
93 changes: 14 additions & 79 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,43 @@
name: nf-core linting
# This workflow is triggered on pushes and PRs to the repository.
# It runs the `nf-core lint` and markdown lint tests to ensure that the code meets the nf-core guidelines
# It runs the `nf-core lint` and markdown lint tests to ensure
# that the code meets the nf-core guidelines.
on:
push:
pull_request:
release:
types: [published]

jobs:
Markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10'
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Run Markdownlint
run: markdownlint .

# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
## Markdown linting is failing

To keep the code consistent with lots of contributors, we run automated code consistency checks.
To fix this CI test, please run:

* Install `markdownlint-cli`
* On Mac: `brew install markdownlint-cli`
* Everything else: [Install `npm`](https://www.npmjs.com/get-npm) then [install `markdownlint-cli`](https://www.npmjs.com/package/markdownlint-cli) (`npm install -g markdownlint-cli`)
* Fix the markdown errors
* Automatically: `markdownlint . --fix`
* Manually resolve anything left from `markdownlint .`

Once you push these changes the test should pass, and you can hide this comment :+1:

We highly recommend setting up markdownlint in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!

Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false

EditorConfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '10'
- uses: actions/setup-node@v2

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker

- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile')

YAML:
Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10'
- name: Install yaml-lint
run: npm install -g yaml-lint
- name: Run yaml-lint
run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yml" -o -name "*.yaml")

# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
## YAML linting is failing

To keep the code consistent with lots of contributors, we run automated code consistency checks.
To fix this CI test, please run:

* Install `yaml-lint`
* [Install `npm`](https://www.npmjs.com/get-npm) then [install `yaml-lint`](https://www.npmjs.com/package/yaml-lint) (`npm install -g yaml-lint`)
* Fix the markdown errors
* Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml")`
* Fix any reported errors in your YAML files
- uses: actions/checkout@v2

Once you push these changes the test should pass, and you can hide this comment :+1:
- uses: actions/setup-node@v2

We highly recommend setting up yaml-lint in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!
- name: Install Prettier
run: npm install -g prettier

Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
- name: Run Prettier --check
run: prettier --check ${GITHUB_WORKSPACE}

nf-core:
runs-on: ubuntu-latest
steps:

- name: Check out pipeline code
uses: actions/checkout@v2

Expand All @@ -112,10 +48,10 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- uses: actions/setup-python@v1
- uses: actions/setup-python@v3
with:
python-version: '3.6'
architecture: 'x64'
python-version: "3.6"
architecture: "x64"

- name: Install dependencies
run: |
Expand All @@ -142,4 +78,3 @@ jobs:
lint_log.txt
lint_results.md
PR_number.txt

2 changes: 0 additions & 2 deletions .github/workflows/linting_comment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: nf-core linting comment
# This workflow is triggered after the linting action is complete
# It posts an automated comment to the PR, even if the PR is coming from a fork
Expand Down Expand Up @@ -27,4 +26,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr_number.outputs.pr_number }}
path: linting-logs/lint_results.md

14 changes: 0 additions & 14 deletions .markdownlint.yml

This file was deleted.

1 change: 1 addition & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repository_type: pipeline
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
printWidth: 120
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

## Introduction

The **nf-core/scrnaseq** is a bioinformatics best-practise analysis pipeline for transciptomic data of single-cell RNAs. The pipeline creates count matrices from FASTQ sequence reads. It is suitable for droplets-based sequencing technologies.
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker containers making installation trivial and results highly reproducible.
<!-- TODO nf-core: Write a 1-2 sentence summary of what data the pipeline is for and what it does -->
**nf-core/scrnaseq** is a bioinformatics best-practice analysis pipeline for processing 10x Genomics single-cell RNA-seq data.

The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!

<!-- TODO nf-core: Add full-sized test dataset and amend the paragraph below if applicable -->
On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/scrnaseq/results).

## Pipeline summary
Expand Down
5 changes: 3 additions & 2 deletions bin/check_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def check_samplesheet(file_in, file_out):
sample_mapping_dict[sample] = [sample_info]
else:
if sample_info in sample_mapping_dict[sample]:
print_error("Samplesheet contains duplicate rows!", "Line", line)
# print_error("Samplesheet contains duplicate rows!", "Line", line)
sample_mapping_dict[sample].append(sample_info)
else:
sample_mapping_dict[sample].append(sample_info)

Expand All @@ -129,7 +130,7 @@ def check_samplesheet(file_in, file_out):
print_error("Multiple runs of a sample must be of the same datatype!", "Sample: {}".format(sample))

for idx, val in enumerate(sample_mapping_dict[sample]):
fout.write(",".join(["{}_T{}".format(sample, idx + 1)] + val) + "\n")
fout.write(",".join(["{}".format(sample)] + val) + "\n")
else:
print_error("No entries to process!", "Samplesheet: {}".format(file_in))

Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if(params.aligner == "cellranger") {
ext.args = "--attribute=gene_biotype:protein_coding --attribute=gene_biotype:lncRNA --attribute=gene_biotype:pseudogene"
}
withName: CELLRANGER_MKREF {
publishDir = null
publishDir = []
}
withName: CELLRANGER_COUNT {
publishDir = [
Expand Down
6 changes: 3 additions & 3 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ params {
max_time = '6.h'

// Input data
input = 'https://github.com/nf-core/test-datasets/raw/scrnaseq/samplesheet-2-0.csv'
input = 'https://github.com/nf-core/test-datasets/raw/scrnaseq/samplesheet-2-0.csv'
genome_fasta = 'https://github.com/nf-core/test-datasets/raw/scrnaseq/reference/GRCm38.p6.genome.chr19.fa'
gtf = 'https://github.com/nf-core/test-datasets/raw/scrnaseq/reference/gencode.vM19.annotation.chr19.gtf'
protocol = '10XV2'
gtf = 'https://github.com/nf-core/test-datasets/raw/scrnaseq/reference/gencode.vM19.annotation.chr19.gtf'
protocol = '10XV2'
// Ignore `--input` as otherwise the parameter validation will throw an error
schema_ignore_params = 'genomes,input_paths,input'
}
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

The nf-core/scrnaseq documentation is split into the following pages:

* [Usage](usage.md)
* An overview of how the pipeline works, how to run it and a description of all of the different command-line flags.
* [Output](output.md)
* An overview of the different results produced by the pipeline and how to interpret them.
- [Usage](usage.md)
- An overview of how the pipeline works, how to run it and a description of all of the different command-line flags.
- [Output](output.md)
- An overview of the different results produced by the pipeline and how to interpret them.

You can find a lot more documentation about installing, configuring and running nf-core pipelines on the website: [https://nf-co.re](https://nf-co.re)
4 changes: 2 additions & 2 deletions lib/NfcoreSchema.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NfcoreSchema {
/* groovylint-disable-next-line UnusedPrivateMethodParameter */
public static void validateParameters(workflow, params, log, schema_filename='nextflow_schema.json') {
def has_error = false
//=====================================================================//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Check for nextflow core params and unexpected params
def json = new File(getSchemaPath(workflow, schema_filename=schema_filename)).text
def Map schemaParams = (Map) new JsonSlurper().parseText(json).get('definitions')
Expand Down Expand Up @@ -135,7 +135,7 @@ class NfcoreSchema {
}
}

//=====================================================================//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Validate parameters against the schema
InputStream input_stream = new File(getSchemaPath(workflow, schema_filename=schema_filename)).newInputStream()
JSONObject raw_schema = new JSONObject(new JSONTokener(input_stream))
Expand Down
8 changes: 4 additions & 4 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"repos": {
"nf-core/modules": {
"cellranger/count": {
"git_sha": "e2ba70ed9a1d2f09aa77b0744ea50b447c35f696"
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"cellranger/mkgtf": {
"git_sha": "e2ba70ed9a1d2f09aa77b0744ea50b447c35f696"
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"cellranger/mkref": {
"git_sha": "e2ba70ed9a1d2f09aa77b0744ea50b447c35f696"
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"custom/dumpsoftwareversions": {
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
Expand Down Expand Up @@ -41,4 +41,4 @@
}
}
}
}
}
6 changes: 5 additions & 1 deletion modules/local/kallistobustools_count.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ process KALLISTOBUSTOOLS_COUNT {
'quay.io/biocontainers/kb-python:0.25.1--py_0' }"

input:
//
// Input reads are expected to come as: [ meta, [ pair1_read1, pair1_read2, pair2_read1, pair2_read2 ] ]
// Input array for a sample is created in the same order reads appear in samplesheet as pairs from replicates are appended to array.
//
tuple val(meta), path(reads)
path index
path t2g
Expand Down Expand Up @@ -38,7 +42,7 @@ process KALLISTOBUSTOOLS_COUNT {
-x $technology \\
$args \\
-o ${prefix}_kallistobustools_count \\
${reads[0]} ${reads[1]}
${reads.join( " " )}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
Loading