search for: jiangzhengyu

Displaying 5 results from an estimated 5 matches for "jiangzhengyu".

2013 Jan 03
4
Index out SNP position
Dear R experts, I have 2 matix: A& B. I am trying to index B against A - (1) find out B rows that fall between the col 1 and 2 of A& put them into a new vector SNP.I made code as below, but I cannot think of a right way to do it. Could anyone help me with the code? Thanks,Jiang---- A <-
2013 Jan 04
0
FW: Index out SNP position
...each time you process a line from B. > Ax <- t(apply(A, 1, function(x) c(min(x), max(x)))) > indx <- sapply(1:nrow(B), function(i) any(B[i]>Ax[,1] & B[i]<Ax[,2])) > SNP <- B[indx] > SNP [1] 36003918 35838399 35838589 -------------------- David C > From: JiangZhengyu [mailto:zhyjiang2006 at hotmail.com] > Sent: Friday, January 04, 2013 9:03 AM > To: dcarlson at tamu.edu > Subject: RE: [R] Index out SNP position > > Hi David, > > Given B <- matrix(c(36003918,35838399,35838589,36262559),ncol = 1) > > 36262559 and 36003918 do?not f...
2012 Sep 26
3
replace string values with numbers
Hi everyone, I have a data frame Gene with SNPs eg. P1 P2 P3 CG CG GG -- -- AC -- AC CC AC -- AC I tried to replace all the GG with a value 3. Gene[Gene=="GG"]<-3 It always give me: Warning in `[<-.factor`(`*tmp*`, thisvar, value = 3) : invalid factor level, NAs generated Does any know if there is anything wrong with my code? Thanks, Zhengyu
2013 Feb 21
3
Ask for help: find corresponding elements between matrix
Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/ column position) in seq, or all the numbers in mat that =-1 in seq. - Replace all the numbers with NA if it's not 1/-1 in seq. There are some "NA"s in seq. seq=matrix(c(1,-1,0,1,1,-1,0,0,-1,1,1,NA),3,4)
2012 Oct 02
5
smoothScatter plot
Hi, I want to make a plot similar to sm1 (attached). The code I tried is: dcols <- densCols(x,y) smoothScatter(x,y, col = dcols, pch=20,xlab="A",ylab="B") abline(h=0, col="red") But it turned out to be s1 (attached) with big dots. I was wondering if anything wrong with my code. Thanks,Zhengyu -------------- next part -------------- A non-text