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
408 stars 118 forks source link

rsem-generate-data-matrix question #50

Closed agelber closed 7 years ago

agelber commented 7 years ago

Hello Dewey Lab,

I was wondering if there is a simple way to have rsem-generate-data-matrix grab the column corresponding to TPMs or FPKM from the .results file rather than the expected counts? I have no experience with Perl and I was hoping this would be a quick change to the code that someone here could help me with.

Best, Alon

bli25wisc commented 7 years ago

@agelber You just need to change "my $offsite = 4;" to "my $offsite = 5;" for grabbing TPMs; to "my $offsite = 6;" for grabbing FPKMs. If you run RSEM in allele-specific mode, you change "if ($ARGV[0] =~ /alleles.results$/) { $offsite = 5; }" into "if ($ARGV[0] =~ /alleles.results$/) { $offsite = 6; } and "if ($ARGV[0] =~ /alleles.results$/) { $offsite = 7; }" for TPMs and FPKMs respectively.

Hope it helps, Bo

agelber commented 7 years ago

Hi Bo,

Thanks! I wrote a short (and probably inefficient) R script to create the matrix directly into R, with prompts to choose which metric to use. I've put it on github at https://github.com/agelber/Engle_lab_alon/blob/master/RSEM_gen_mat.R. If you ever want to use it, provide a link to it or modify it in any way please feel free!

Best, Alon

JianGuoZhou3 commented 4 years ago

Hi Bo,

Thanks! I wrote a short (and probably inefficient) R script to create the matrix directly into R, with prompts to choose which metric to use. I've put it on github at https://github.com/agelber/Engle_lab_alon/blob/master/RSEM_gen_mat.R. If you ever want to use it, provide a link to it or modify it in any way please feel free!

Best, Alon

Hi Alon, thank you for your shared code, but I get some errors.

getwd() setwd("/home/rstudio/raw/trim_out/rsem_out/gene/")

getwd() [1] "/home/rstudio/raw/trim_out/rsem_out/gene" my_matrix <- RSEM_gen_mat1() Enter RSEM file type : isoforms or genes? genes Enter directory path (from working directory) containing only your .genes.results files: /home/rstudio/raw/trim_out/rsem_out/gene What metric would you like? ( enter: expected_count, TPM, or FPKM): TPM Error in txtProgressBar(1, size, style = 3) : must have 'max' > 'min'