deweylab / RSEM

RSEM: accurate quantification of gene and isoform expression from RNA-Seq data
http://deweylab.biostat.wisc.edu/rsem/
GNU General Public License v3.0
409 stars 118 forks source link

Error in rsem-tbam2gbam #169

Open RenchaoChen opened 3 years ago

RenchaoChen commented 3 years ago

Hi,

I would like to use RSEM to quantify some nuclei RNA-seq data.

STAR version=2.7.9a RSEM version=1.3.3

The code I used are:

generate rsem reference

use GRCm38_102 genome and gtf downloaded from Ensembl

rsem-prepare-reference --gtf Mus_musculus.GRCm38.102.gtf \ --star \ -p 8 \ /nfs4/renchao/data/index/rsem/Mus_musculus.GRCm38_102/Mus_musculus.GRCm38.dna.primary_assembly.fa \ /nfs4/renchao/data/index/rsem/Mus_musculus.GRCm38_102/GRCm38_102

map and qunatify 781 sample

rsem-calculate-expression -p 8 --paired-end \ --star \ --estimate-rspd \ --append-names \ --time \ --output-genome-bam \ /nfs4/renchao/data/fastq/rna-seq/foxp2/781_RNAseq_S1_R1_001.fastq /nfs4/renchao/data/fastq/rna-seq/foxp2/781_RNAseq_S1_R2_001.fastq \ /nfs4/renchao/data/index/rsem/Mus_musculus.GRCm38_102/GRCm38_102 /nfs4/renchao/output/rna-seq/foxp2/781

The code ran well until rsem-tbam2gbam, and I got the following error information:

rsem-tbam2gbam /nfs4/renchao/data/index/rsem/Mus_musculus.GRCm38_102/GRCm38_102 781_test.transcript.bam 781_test.genome.bam Start converting: Detected partial alignments for read NB552319:36:HFJKYBGXG:1:11101:10673:1039, which RSEM currently does not support! "rsem-tbam2gbam /nfs4/renchao/data/index/rsem/Mus_musculus.GRCm38_102/GRCm38_102 781_test.transcript.bam 781_test.genome.bam" failed! Plase check if you provide correct parameters/options for the pipeline!

Seems there are reads not compatible with rsem-tbam2gbam function, but I do not know why this happened and what should I do to solve the problem. Thanks!

BadSeby commented 3 years ago

Hi I have a similar issue: RSEM Version 1.3.3 STAR Version 2.7.9a

I run this command

Reference generation

../1b_download_rsem/RSEM-1.3.3/rsem-prepare-reference --gtf ../1a1_download_ensembl/Homo_sapiens.GRCh38.104.gtf --star --star-path ../1c_star/STAR-2.7.9a/bin/Linux_x86_64_static -p 4 ../1a1_download_ensembl/Homo_sapiens.GRCh38.dna.primary_assembly.fa ref/release104/human_ensembl

With this output (seems corrected) Log.out.txt

then I run quantification

/preprocessing/pipeRNA/RSEM/Update/1b_download_rsem/RSEM-1.3.3/rsem-calculate-expression --sort-bam-by-coordinate --sort-bam-memory-per-thread 32G --output-genome-bam
--star --star-path /preprocessing/pipeRNA/RSEM/Update/1c_star/STAR-2.7.9a/bin/Linux_x86_64_static --star-gzipped-read-file -p 12 --keep-intermediate-files /preprocessing/VRK1/Samples/0_fastq/1A_S4_L001_R1_001.fastq.gz /preprocessing/pipeRNA/RSEM/Update/2_prepare_reference/ref/release104/human_ensembl /preprocessing/VRK1/Samples/1_rsem/1A_S4

In log file I obtain this error rsem-tbam2gbam /preprocessing/pipeRNA/RSEM/Update/2_prepare_reference/ref/release104/human_ensembl /preprocessing/VRK1/Samples/1_rsem/1A_S4.transcript.bam /preprocessing/VRK1/Samples/1_rsem/1A_S4.genome.bam rsem-tbam2gbam: BamConverter.h:131: void BamConverter::process(): Assertion `cqname != qname' failed. rsem_calculate_expression.txt

I try the rsem-validator with transcript file Update/1b_download_rsem/RSEM-1.3.3/rsem-sam-validator /preprocessing/VRK1/Samples/1_rsem/1A_S4.transcript.bam ............................................................................................................................................................................................................................................................................................ The input file is valid!

And also convert-sam-for rsem Update/1b_download_rsem/RSEM-1.3.3/convert-sam-for-rsem /preprocessing/VRK1/Samples/1_rsem/1A_S4.transcript.bam /preprocessing/VRK1/Samples/1_rsem/output_trans.bam samtools sort -n -@ 1 -m 1G -o /preprocessing/VRK1/Samples/1_rsem/output_trans.bam.tmp.bam /preprocessing/VRK1/Samples/1_rsem/1A_S4.transcript.bam [bam_sort_core] merging from 87 files...

rsem-scan-for-paired-end-reads 1 /preprocessing/VRK1/Samples/1_rsem/output_trans.bam.tmp.bam /preprocessing/VRK1/Samples/1_rsem/output_trans.bam.bam ...................................... Finished!

Conversion is completed. /preprocessing/VRK1/Samples/1_rsem/output_trans.bam.bam will be checked by 'rsem-sam-validator'. rsem-sam-validator /preprocessing/VRK1/Samples/1_rsem/output_trans.bam.bam ............................................................................................................................................................................................................................................................................................ The input file is valid!

But then when I run rsem-tbam2gbam Obtain the same error rsem-tbam2gbam: BamConverter.h:131: void BamConverter::process(): Assertion `cqname != qname' failed.

Any ideas why?

Thanks.

as-nobu commented 3 years ago

I also have the same issue with BadSeby.

With the same environment (RSEM 1.3.3 and STAR 2.7.9a), rsem-tbam2gbam returns an error: BamConverter.h:131: void BamConverter::process(): Assertion `cqname != qname' failed.

However, with my old environment (RSEM 1.3.1 and STAR 2.7.1a), rsem-tbam2gbam finished successfully with the same fastq.

I also tested RSEM 1.3.1 and STAR 2.7.9a, resulting in an error stated above.

Anyway, I want to know what happens and how to solve it.

Thanks.

BadSeby commented 3 years ago

Hi, thanks as-nobu. I will try with this configuration.

dmgatti commented 2 years ago

Same problem: RSEM 1.3.1 and STAR 2.7.9.

Genome index and transcript BAM were generated by RSEM.

rsem-tbam2gbam /annotation/GRCm39/rsem_index/rsem_index /projects/results/rsem/SAMN12212513.transcript.bam /projects/results/rsem/SAMN12212513.genome.bam Start converting: rsem-tbam2gbam: BamConverter.h:131: void BamConverter::process(): Assertion `cqname != qname' failed. Aborted

dmgatti commented 2 years ago

As a follow up, RSEM 1.3.1 and STAR 2.7.1a throws the same error as STAR 2.7.9.
Does anyone know what 'cqname' and 'qname' are in the code? That might help with figuring out a workaround or fix.

dmgatti commented 2 years ago

I may have found a work-around/cause. When aligning with STAR 2.7.9a, I previously used the "--outSAMunmapped Within" option. By removing this option, I was able to get rsem-tbam2gbam to work. So unmapped reads in the BAM file may be related to the problem.