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 bam/cram support #157

Merged
merged 8 commits into from
Jan 8, 2025
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- [#116](https://github.com/nf-core/rnavar/pull/116) - Added `unzip` from nf-core modules for working with unzipped fasta and gtf files
- [#157](https://github.com/nf-core/rnavar/pull/157) - Added support for `bam` and `cram` input files

### Changed

Expand Down
34 changes: 33 additions & 1 deletion assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,40 @@
"errorMessage": "Strandedness must be provided and be one of 'forward', 'reverse' or 'unstranded'",
"enum": ["forward", "reverse", "unstranded"],
"meta": ["strandedness"]
},
"bam": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.bam$",
"errorMessage": "BAM file should end with `.bam`, should not contains spaces and should exist."
},
"bai": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.bai$",
"errorMessage": "BAI file should end with `.bai`, should not contains spaces and should exist."
},
"cram": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.cram$",
"errorMessage": "CRAM file should end with `.cram`, should not contains spaces and should exist."
},
"crai": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.crai$",
"errorMessage": "CRAI file should end with `.crai`, should not contains spaces and should exist."
}
},
"required": ["sample", "fastq_1", "strandedness"]
"oneOf": [
{ "required": ["sample", "fastq_1", "strandedness"] },
{ "required": ["sample", "bam"] },
{ "required": ["sample", "cram"] }
]
}
}
1 change: 1 addition & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ process {

withName: '.*:SPLITNCIGAR:GATK4_SPLITNCIGARREADS' {
ext.args = '--create-output-bam-index false'
ext.prefix = { "${meta.id}.splitncigarreads" }
}

withName: '.*:SPLITNCIGAR:SAMTOOLS_INDEX' {
Expand Down
9 changes: 9 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,17 @@ TREATMENT_REP3,AEG588A6_S6_L004_R1_001.fastq.gz,,reverse
| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). |
| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
| `bam` | Full path to BAM file created with STAR and duplicate marked. File has to have the extension ".bam". |
| `bai` | Full path to index file of the BAM file. File has to have the extension ".bai". |
| `cram` | Full path to CRAM file created with STAR and duplicate marked. File has to have the extension ".cram". |
| `crai` | Full path to index file of the CRAM file. File has to have the extension ".crai". |
| `strandedness` | Sample strand-specificity. Must be one of `unstranded`, `forward` or `reverse`. |

:::note
Only one file type per sample is allowed. Supplying FASTQ files and a BAM/CRAM file for the same sample will cause an error in the pipeline.
The pipeline also has no support for multiple BAM/CRAM file per sample.
:::

An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline.

## PIPELINE PARAMETERS AND DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ workflow NFCORE_RNAVAR {
ch_gtf = PREPARE_GENOME.out.gtf
ch_dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect()
: PREPARE_GENOME.out.dict
ch_fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai)
ch_fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).map{ it -> [ [id:'fasta_fai'], it ] }.collect()
: PREPARE_GENOME.out.fasta_fai
ch_exon_bed = params.exon_bed ? Channel.fromPath(params.exon_bed).map{ it -> [ [id:'exon_bed'], it ] }.collect()
: PREPARE_GENOME.out.exon_bed
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@
"git_sha": "1943aa60f7490c3d6740e8872e6e69122ccc8087",
"installed_by": ["bam_markduplicates_picard"]
},
"samtools/convert": {
"branch": "master",
"git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208",
"installed_by": ["modules"]
},
"samtools/faidx": {
"branch": "master",
"git_sha": "f153f1f10e1083c49935565844cccb7453021682",
Expand Down
8 changes: 8 additions & 0 deletions modules/nf-core/samtools/convert/environment.yml

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

60 changes: 60 additions & 0 deletions modules/nf-core/samtools/convert/main.nf

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

103 changes: 103 additions & 0 deletions modules/nf-core/samtools/convert/meta.yml

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

107 changes: 107 additions & 0 deletions modules/nf-core/samtools/convert/tests/main.nf.test

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

Loading
Loading