Home > Community > Error in as.vector(x) : no method for coercing this S4 class to a vector
Upvote

19

Downvote
+ Rstudio
+ Bioinformatics
+ Rna-seq
Posted by
Maria

Error in as.vector(x) : no method for coercing this S4 class to a vector

Chief Thunder  Follow

You can't cbind a bunch of obscure object types.

If you want merged count tables you should do this:

mdat <- do.call(cbind,lapply(dat,assay))

Where row.names are Ensembl gene IDs and col.names are the SRR accessions.

Then run your table writing command.

-

If you want the coordinates of your genes then do this to make a bed with the genomic locations:

library(rtracklayer)export.bed(rowRanges(dat[[1]]),'gene_coords.bed')

More

Upvote

VOTE

Downvote