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

How to use bambu in parellel on HPC clusters? #428

Open
dudududu12138 opened this issue May 23, 2024 · 1 comment
Open

How to use bambu in parellel on HPC clusters? #428

dudududu12138 opened this issue May 23, 2024 · 1 comment

Comments

@dudududu12138
Copy link

Hi, I used bambu on one sample. The alignment result(.bam) of this sample is about 34G. And I run bambu on HPC cluster. I set the cpu number to 20. Then run it. But it took 6 hours to finish the job. And the cpu efficiency is only 5%. That is , only 1 cpu was used by bambu. I am so confused. Can you help me? Thanks!
Below is my R code:

#! /usr/bin/env Rscript
library(bambu)
args<- commandArgs(trailingOnly=TRUE)
rawreads<-args[1]
ref_anno<-args[2]
ref<-args[3]
core<-args[4]
output=args[5]

bambuAnnotations <- prepareAnnotations(ref_anno)
se<-bambu(reads=rawreads, annotations=bambuAnnotations, genome=ref, ncore=core, trackReads=TRUE)
writeBambuOutput(se,path=output)

Below is my slurm code (submit my R script to the HPC cluster):

#!/bin/bash
#SBATCH -J bambu
#SBATCH --partition=cpu
#SBATCH -n 20
#SBATCH --output=%j.out
#SBATCH --error=%j.err

module load miniconda3
source activate R_422

ref=~/reference/GRCh38.p13.genome.fa
anno=~/reference/gencode.v44.chr_patch_hapl_scaff.annotation.gtf
reads=my.bam
output=../bambu/
core=20

./bambu.R $reads $anno $ref $core $output  
@andredsim
Copy link
Collaborator

Hi,
Sorry I didn't see this issue earlier. It shouldn't take 6 hours to run a 34G bam file.
Could you check the class() of core as I think it might be being read in as a character and not an integer which might be interpreted as 1 core and not 20. Adding as.interger(core) should help I hope.
Kind Regards,
Andre Sim

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

No branches or pull requests

2 participants