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

Extra arguments from STAR-RSEM #1513

Open
cutleraging opened this issue Mar 13, 2025 · 3 comments
Open

Extra arguments from STAR-RSEM #1513

cutleraging opened this issue Mar 13, 2025 · 3 comments

Comments

@cutleraging
Copy link

Description of feature

Hello,

Thanks for a great pipeline. I would like to request a feature to be able to include extra arguments for RSEM in the pipeline. For example, I would like to include the --calc-ci option so that I can have credibility intervals for the counts in the RSEM output

Ronnie

@pinin4fjords
Copy link
Member

While this is not an explicit option to the pipeline, you can supply custom configuration to achieve the same ends. You should preserve the existing args and add your own, e.g.:

 withName: '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION' {
     ext.args   = [
        '--star',
        '--star-output-genome-bam',
        '--star-gzipped-read-file',
        '--estimate-rspd',
        '--seed 1',
        '--calc-ci'
   ].join(' ').trim()
}

@cutleraging
Copy link
Author

cutleraging commented Mar 24, 2025

Thanks for this! So here is my customized config file based on your response...

if (!params.skip_alignment && params.aligner == 'star_rsem') {
    process {
        withName: '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION' {
            ext.args   = [
                '--star',
                '--star-output-genome-bam',
                '--star-gzipped-read-file',
                '--estimate-rspd',
                '--seed 1',
                '--calc-ci'
            ].join(' ').trim()
            publishDir = [
                [
                    path: { "${params.outdir}/${params.aligner}" },
                    mode: params.publish_dir_mode,
                    pattern: "*.{stat,results}"
                ],
                [
                    path: { params.save_align_intermeds ? "${params.outdir}/${params.aligner}" : params.outdir },
                    mode: params.publish_dir_mode,
                    pattern: "*.bam",
                    saveAs: { params.save_align_intermeds ? it : null }
                ],
                [
                    path: { "${params.outdir}/${params.aligner}/log" },
                    mode: params.publish_dir_mode,
                    pattern: "*.log"
                ]
            ]
        }

        withName: '.*:QUANTIFY_RSEM:RSEM_MERGE_COUNTS' {
            publishDir = [
                path: { "${params.outdir}/${params.aligner}" },
                mode: params.publish_dir_mode,
                saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
            ]
        }
    }
}

Here is my command...

#!/bin/bash
#SBATCH --job-name=rnaseq        # Job name
#SBATCH --mail-type=END,FAIL         # Mail events (NONE, BEGIN, END, FAIL, ALL)
#SBATCH [email protected]    # Where to send mail.  Set this to your email address
#SBATCH --partition=unlimited               # Batch partition: test, quick, ht, normal, unlimited
#SBATCH --time=UNLIMITED          # Wall time limit (days-hrs:min:sec)
#SBATCH --output=rnaseq%j.log    # Path to the standard output and error files relative to the working 
#SBATCH --mem=256GB
#SBATCH --cpus-per-task=24

source /gs/gsfs0/hpc01/rhel8/apps/conda3/etc/profile.d/conda.sh
conda activate nextflow

input=samplesheet.csv
outdir=/gs/gsfs0/users/rcutler/vijg-lab/2024-Ronnie/Jackson-Rogow/virus_stem-loop_alignment_unique
fasta=/gs/gsfs0/users/rcutler/vijg-lab/2024-Ronnie/references/mouse/GRCm39.primary_assembly.genome_virus_stem-loop.fa
gtf=/gs/gsfs0/users/rcutler/vijg-lab/2024-Ronnie/references/mouse/gencode.vM34.basic.annotation_virus_stem-loop.gtf

# update
nextflow self-update
nextflow pull nf-core/rnaseq

nextflow run nf-core/rnaseq \
-profile singularity \
-r 3.14.0 \
--input $input \
--outdir $outdir \
--fasta $fasta \
--gtf $gtf \
--gencode \
--save_reference \
--aligner star_rsem \
--save_unaligned \
--max_cpus 24 \
--max_memory 256.GB \
--rseqc_modules read_distribution,read_duplication \
-c rsem.config

But I am getting this error. It seems that I am not providing the file correctly...

Downloading nextflow dependencies. It may require a few seconds, please wait .. 
�[KDownloading nextflow dependencies. It may require a few seconds, please wait .. 
�[K
      N E X T F L O W
      version 24.10.5 build 5935
      created 04-03-2025 17:55 UTC (12:55 EDT)
      cite doi:10.1038/nbt.3820
      http://nextflow.io


Nextflow installation completed. Please note:
- the executable file `nextflow` has been created in the folder: /gs/gsfs0/users/rcutler/.conda/envs/nextflow/bin

Checking nf-core/rnaseq ...
 done - revision: b89fac3265 [3.14.0]

 N E X T F L O W   ~  version 24.10.5

ERROR ~ Unknown config attribute `params.skip_alignment` -- check config file: /gs/gsfs0/shared-lab/vijg-lab/2024-Ronnie/Jackson-Rogow/virus_stem-loop_alignment_unique/rsem.config

 -- Check '.nextflow.log' file for details

So, how do you provide a custom config file?

@pinin4fjords
Copy link
Member

You don't need duplicate everything there. Just supply:

process {
    withName: '.*:QUANTIFY_RSEM:RSEM_CALCULATEEXPRESSION' {
         ext.args   = [
            '--star',
            '--star-output-genome-bam',
            '--star-gzipped-read-file',
            '--estimate-rspd',
            '--seed 1',
            '--calc-ci'
       ].join(' ').trim()
}

That will override the ext.args, which is what you want, you don't need to re-state the publishing settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants