Closed:Gene-level TPM from salmon
0
0
Entering edit mode
3.8 years ago
rykerklie7 ▴ 30

I tried this to convert transcript ids from salmon to gene ids

 library(EnsDb.Hsapiens.v86)
 library(dplyr)
 salmon_output = read.delim("quant.sf")
 tx2gene = transcripts(EnsDb.Hsapiens.v86,  columns=c("tx_id", "gene_name", "gene_id"), return.type="DataFrame")
  gene_tpms <- salmon_output %>%
  inner_join(tx2gene, by=c("Name"="tx_id")) %>%
  group_by(gene_id, gene_name) %>%
  summerise(TPM=sum(TPM))

This always generates the error

   Error in UseMethod("tbl_vars") :  no applicable method for 'tbl_vars' applied to an object of class "c('DataFrame', DataTable', 'SimpleList', 'DataTable_OR_NULL', 'List', 'Vector', 'list_OR_List', 'Annotated')"

I understand that it has got something to do with the structure of the data but unable to fix it

R ensembldb salmon • 129 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2750 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6