Re: [R] caculate correlation

2017-01-31 Thread Jim Lemon
Hi Elham, It looks to me as though you are looking for matches in the name field and then asking for all columns except the first (-1). If you only have two columns in "coding.rpkm", and "name" is the first column, you will get whatever is in the second column that has a match in the "name" column.

Re: [R] caculate correlation

2017-01-31 Thread Elham -
Hi Dear Jim, I did it, both return a vector of name of the genes with different length,as I said before I have list of coding and noncoding so the length are not same. where is number?! and at the end of print there is this error : <0 rows> (or 0-length row.names) On Tuesday, January 31,

Re: [R] caculate correlation

2017-01-31 Thread Jim Lemon
Hi Elham, On Tue, Jan 31, 2017 at 7:28 PM, Elham - wrote: > Hi Dear Jim, > > I did it, both return a vector of name of the genes with different length,as > I said before I have list of coding and noncoding so the length are not > same. > > where is number?! > Not in the values you are extracting

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
Hi Elham, What I meant is to simply copy these two expressions into the R command line: coding.rpkm[grep("23.C",coding.rpkm$name),-1] ncoding.rpkm[grep("23.C",ncoding.rpkm$name),-1] and see what comes out. If both return a vector of numbers of the same length with no NA values, my guess was wron

Re: [R] caculate correlation

2017-01-30 Thread Elham - via R-help
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.

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
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

Re: [R] caculate correlation

2017-01-30 Thread Elham - via R-help
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

Re: [R] caculate correlation

2017-01-30 Thread Jim Lemon
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 wrote: > for calculating correlation

[R] caculate correlation

2017-01-30 Thread Elham - via R-help
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