Skip to content

calculate correlations

3 messages · Michael Dewey, Elham -

#
Hi All,I have 11 human RNA-seq data (control/treatment),The effect of various drugs on various cancers,I want to calculate the genes-lncRna correlations for all tumors considered together for network,I did?differential expression analysis and?prepared?normalized values (rpkm)?of coding and lncoding in two separate file and import them to R, then transpose them and now I want to calculate corr by this function:
control.corr=cor(cod[grep(".C",cod$name),-1],lnc[grep(".C",lnc$name),-1],method = "spearman")

if I understand true,I should write?the numbers of columns whose related to control,then I counted all of control`s column and?wrote 23 .now my question is,how does R understand?what column is control and what is treatment?
#
If I understand this correctly you are choosing all the rows from each 
of cod and lnc which contain .c (ie any character followed by a C) and 
deleting the first column from each of cod and lnc. You then correlate 
them so that you get the correlation between corresponding columns of 
each. Since you do not tell us how you know which column is which it is 
hard to answer the question of how R will know.
On 07/12/2016 11:26, Elham - via R-help wrote:

  
    
  
#
hello Michael,I specified each column like this screenshot:(A.C1 means experiment A and first control,A.T3 means experiment A and third treatment .... ?) I have two transposed file,one for coding and one for lncoding.
On Wednesday, December 7, 2016 6:11 PM, Michael Dewey <lists at dewey.myzen.co.uk> wrote:
If I understand this correctly you are choosing all the rows from each 
of cod and lnc which contain .c (ie any character followed by a C) and 
deleting the first column from each of cod and lnc. You then correlate 
them so that you get the correlation between corresponding columns of 
each. Since you do not tell us how you know which column is which it is 
hard to answer the question of how R will know.
On 07/12/2016 11:26, Elham - via R-help wrote: