[R] caculate correlation
Elham -
ed_isfahani at yahoo.com
Mon Jan 30 23:17:47 CET 2017
this script automatically recognizes what is control among cod and lnc. Note that this script contains a piece of text that is "grep(".C",cod$name)". This text select - among all column names - those that contain ".C". in my files, I named C1, C2, C3, etc all columns that correspond to controls. In the same manner, I get controls among the lnc, with the text: "grep(".C",lnc$name)"
I`m so sorry,maybe I do not understand you again.
On Tuesday, January 31, 2017 1:27 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
Hi Elham,
This is about the same as your first message. What I meant was, what
do these two expressions return? Is whatever is returned suitable
input for the "cor" function?
coding.rpkm[grep("23.C",coding.rpkm$name),-1]
ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1]
Jim
On Tue, Jan 31, 2017 at 8:45 AM, Elham - <ed_isfahani at yahoo.com> wrote:
> I have 9 experiments control/treatment that I analysed coding and lncoding,
> after that I normalize expression value.as you know we have different known
> number of coding and non -coding genes,so for calculating correlation first
> I transposed data ,(rows become columns)so row is control&treatment and
> columns are gene names.(so I have 2 matrix with same row and different
> column).This information is enough?
>
>
>
>
> On Tuesday, January 31, 2017 1:06 AM, Jim Lemon <drjimlemon at gmail.com>
> wrote:
>
>
> Hi Elham,
> Without knowing much about what coding.rpkm and ncoding.rkpm look
> like, it is difficult to say. Have you tried to subset these matrices
> as you do in the "cor" function and see what is returned?
>
> Jim
>
> On Tue, Jan 31, 2017 at 6:40 AM, Elham - via R-help
> <r-help at r-project.org> wrote:
>> for calculating correlation between coding and noncoding,first I
>> transposed data ,(rows become columns) so row is control&treatment and
>> columns are gene names.(so I have 2 matrix with same row and different
>> column),I use these function for calculating correlation but all of spearman
>> correlation are NA,why?
>>
>>
>>
>> control.corr=cor(coding.rpkm[grep("23.C",coding.rpkm$name),-1],ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1],method=
>> "spearman")
>>
>>
>>
>>
>>
>>
>>
>> tumor.corr=cor(coding.rpkm [grep("27.T", coding.rpkm $name),-1],
>> ncoding.rpkm [grep("27.T", ncoding.rpkm $name),-1],method = "spearman")
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list