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

Fastp sc #331

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa",
"git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3",
"installed_by": ["subworkflows"]
},
"utils_nfvalidation_plugin": {
Expand Down
23 changes: 23 additions & 0 deletions modules/local/rename_fastq_cellranger.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Import generic module functions
process RENAME_FASTQ_CELLRANGER {
tag "$meta.id"
label 'process_low'

conda "conda-forge::python=3.8.0 conda-forge::biopython=1.74"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-adc9bb9edc31eb38b3c24786a83b7dfa530e2bea:47d6d7765d7537847ced7dac873190d164146022-0' :
'biocontainers/mulled-v2-adc9bb9edc31eb38b3c24786a83b7dfa530e2bea:47d6d7765d7537847ced7dac873190d164146022-0' }"

input:
tuple val(meta), path(R1), path(R2)
tuple val(meta_2), path(orig_r1), path(orig_r2)

output:
tuple val(meta), path('*R1_001.fastq.gz'), path('*R2_001.fastq.gz') , emit: reads

script:
"""
mv ${R1} fastp_${orig_r1}
mv ${R2} fastp_${orig_r2}
"""
}
29 changes: 28 additions & 1 deletion subworkflows/local/sc_raw_input.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ include { UNZIP_CELLRANGERDB } from '
include { RENAME_FILE as RENAME_FILE_TSV } from '../../modules/local/rename_file'
include { CHANGEO_CONVERTDB_FASTA as CHANGEO_CONVERTDB_FASTA_FROM_AIRR } from '../../modules/local/changeo/changeo_convertdb_fasta'
include { FASTQ_INPUT_CHECK } from '../../subworkflows/local/fastq_input_check'
include { FASTP } from '../../modules/nf-core/fastp/main'
include { RENAME_FASTQ_CELLRANGER } from '../../modules/local/rename_fastq_cellranger'



workflow SC_RAW_INPUT {
Expand Down Expand Up @@ -51,9 +54,30 @@ workflow SC_RAW_INPUT {
error "The single-cell 10X genomics library generation method requires you to provide a reference file."
}

// Fastp
save_merged = false
FASTP (
ch_reads,
[],
[],
save_merged
)
ch_versions = ch_versions.mix(FASTP.out.versions)

ch_rename_fastp = FASTP.out.reads.map{ meta,reads -> [meta, reads[0], reads[1]] }
ch_rename_original = ch_reads.map{ meta,reads -> [meta, reads[0], reads[1]] }

// rename fastq files to follow cellranger standards again
RENAME_FASTQ_CELLRANGER(
ch_rename_fastp,
ch_rename_original
)

ch_reads_fastp = RENAME_FASTQ_CELLRANGER.out.reads.map{ meta, read1, read2 -> [meta, [read1, read2]] }

// run cellranger vdj
CELLRANGER_VDJ (
ch_reads,
ch_reads_fastp,
ch_sc_reference.collect()
)
ch_versions = ch_versions.mix(CELLRANGER_VDJ.out.versions)
Expand Down Expand Up @@ -89,6 +113,9 @@ workflow SC_RAW_INPUT {

emit:
versions = ch_versions
// fastp
fastp_reads_json = FASTP.out.json.collect{ meta,json -> json }
fastp_reads_html = FASTP.out.html.collect{ meta,html -> html }
// complete cellranger output
outs = ch_cellranger_out
// cellranger output in airr format
Expand Down
8 changes: 7 additions & 1 deletion subworkflows/nf-core/utils_nfcore_pipeline/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions workflows/airrflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ workflow AIRRFLOW {
ch_presto_assemblepairs_logs = Channel.empty()
ch_presto_collapseseq_logs = Channel.empty()
ch_presto_splitseq_logs = Channel.empty()
ch_fastp_html = Channel.empty()
ch_fastp_json = Channel.empty()
ch_fastp_html = SC_RAW_INPUT.out.fastp_reads_html
ch_fastp_json = SC_RAW_INPUT.out.fastp_reads_json
ch_fastqc_postassembly_mqc = Channel.empty()
} else {
// Perform sequence assembly if input type is fastq from bulk sequencing data
Expand Down
Loading