Question: how to give name of genes instead of unique ID created by "lcpm" ?
0
gravatar for Björn
19 months ago by
Björn40
Björn40 wrote:

after converting raw counts to cpm from data file using command

lcpm<-cpm(y, log=T)

head(lcpm)

gives first row with unique numeric ID which denotes gene names from data file. How to export name of genes into *.csv file but with name of genes ?

write.csv(highly_variable_lcpm, row.names=y2$genes, file = "highly_variable_lcpm_genes.csv")

I get error message as below

Error in write.table(highly_variable_lcpm, row.names = y2$genes, file = "highly_variable_lcpm_genes.csv", : invalid 'row.names' specification

ADD COMMENTlink written 19 months ago by Björn40

Could you give us the result of head(y2, 5) and head(highly_variable_lcpm, 5) please

ADD REPLYlink modified 19 months ago • written 19 months ago by Bastien Hervé4.5k
head(y2, 5)

Error: Two subscripts required

head(highly_variable_lcpm, 5)

LCPM

The numbers that is present here are in fact numbers given by lcpm for genes!

ADD REPLYlink modified 19 months ago by genomax75k • written 19 months ago by Björn40

I link you this to insert an image to a Biostars post : How to add images to a Biostars post

I got that your highly_variable_lcpm indexes are your genes.

What do you have in y2 ? Is it the correlation between highly_variable_lcpm index and gene names ?

Could you give the result of typeof(y2)

ADD REPLYlink written 19 months ago by Bastien Hervé4.5k

y is DGElist created after

y2<-DGEList(data, genes = genes,group = diagroup, remove.zeros = T)

I followed following weblink for my rnaseq analysis reference
You find first heatmap for "Top 500 most variable genes across samples". I just need a csv file with list of those 500 genes. I get numbers which comes from lcpm. data is matrix with gene names as row and sample name as column. genes is a table with sample name and other patient data such as diagroup. Hope this helps Thanks for sharing how to add images in biostars. I will follow it in my next posts.

ADD REPLYlink modified 19 months ago • written 19 months ago by Björn40

If you just want the lcpm's numbers for genes

write.csv(highly_variable_lcpm, row.names=TRUE, file = "highly_variable_lcpm_genes.csv")

If you have gene names in your y2 and you want to export them too. You need to join y2 and highly_variable_lcpm.

Then make your gene names column as rownames() and export with the command above.

ADD REPLYlink modified 19 months ago • written 19 months ago by Bastien Hervé4.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2340 users visited in the last hour