Entering edit mode
6.7 years ago
Björn
▴
110
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
Could you give us the result of
head(y2, 5)
andhead(highly_variable_lcpm, 5)
pleaseError: Two subscripts required
The numbers that is present here are in fact numbers given by lcpm for genes!
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 betweenhighly_variable_lcpm
index and gene names ?Could you give the result of
typeof(y2)
y is DGElist created after
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.
If you just want the lcpm's numbers for genes
If you have gene names in your
y2
and you want to export them too. You need to joiny2
andhighly_variable_lcpm
.Then make your gene names column as
rownames()
and export with the command above.