search for: myseq

Displaying 12 results from an estimated 12 matches for "myseq".

Did you mean: myset
2005 Jul 22
1
sequence()
Hi Function sequence() repeatedly concatenates its output, and this is slow. It is possible to improve on the performance of sequence by defining myseq <- function(x){unlist(sapply(x,function(i){1:i}))} The following session compares the performance of myseq(), and sequence(), at least on my G5: > identical(sequence(1:50),myseq(1:50)) [1] TRUE > system.time(ignore <- sequence(1:800)) [1] 1.16 0.88 2.07 0.00 0.00 > system.time...
2005 Jul 22
1
sequence()
Hi Function sequence() repeatedly concatenates its output, and this is slow. It is possible to improve on the performance of sequence by defining myseq <- function(x){unlist(sapply(x,function(i){1:i}))} The following session compares the performance of myseq(), and sequence(), at least on my G5: > identical(sequence(1:50),myseq(1:50)) [1] TRUE > system.time(ignore <- sequence(1:800)) [1] 1.16 0.88 2.07 0.00 0.00 > system.time...
2006 Nov 15
3
how to get empty sequence for certain bounds
Hi, I have encountered this problem quite a few times and thought I would ask. Let's say that I have two endpoints, a and b, which are integers. If a <= b, I would like to get a:b, but if a > b, then numeric(0), for example: myseq(3,5) => 3:5 myseq(3,3) => 3 myseq(3,2) => numeric(0) The operator : just gives decreasing sequences in the latter case, and I could not coax seq into doing this either (of course the documentation is correct, it never claims that I could). Should I just write my own function, or is there...
2003 Sep 08
2
Re: clustering polypeptide sequences
...000000 b0002 0.035122 0.065854 b0003 0.024193 0.070968 b0004 -0.096729 0.084112 b0005 -0.973469 0.091837 b0006 -0.402713 0.108527 b0007 0.680672 0.123950 b0008 -0.209779 0.072555 b0009 -0.013334 0.046154 b0010 0.952128 0.143617 suppose you have these data into a data frame called myseqs [see the R documentation in how to upload these data, you can try > myseqs <- edit(read.table()) ] # you need to load the necessary libraries library(mva) # basic clustering library(cluster) # more clustering algorithms # then you need to calculate the 'distances' betw...
2005 Nov 17
1
Predicting and Plotting "hypothetical" values of factors
...class "factor" but class "numeric" was supplied # In addition: Warning message: # variable 'myfac' is not a factor in: model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels) # Isn't there an easier way than this? c1 <- coef(mymod1) myseq <- seq(0,1, length.out=10) newdf <- data.frame(1, myseq) linearPredictor <- as.matrix(newdf) %*% c1 p2 <- 1/ (1 + exp(-linearPredictor)) # But there is a big disaster if you just try the obvious thing # of plotting with # lines(myseq,p2) # The line does not show up where you hope in...
2010 Jun 23
5
Plotrix Trick
...em is that I would like to write in every cell the value of the corresponding entry of the original matrix, not is logarithm. Does anyone know how to get this done? Or the other way around: leave the data as is, but use a color log scale. Many thanks Lorenzo library(plotrix) set.seed(1234) myseq <- abs(rnorm(25)) myseq[20] <- 100 #introduce outlier! A <- matrix(myseq, ncol=5,nrow=5) #nasty looking figure pdf("test_color_scale.pdf") oldpar<-par( mar = c(4.5,5, 2, 1) + 0.1, cex.axis=1.4,cex.lab=1.6,cex.main=1.6) color2D.matplot(A,main="Title",c(0.2,1),c...
2008 Dec 09
2
motif search
Hi, I am very new to R and wanted to know if there is a package that, given very long nucleotide sequences, searches and identifies short (7-10nt) motifs.. I would like to look for enrichment of certain motifs in genomic sequences. I tried using MEME (not an R package, I know), but the online version only allows sequences up to MAX 60000 nucleotides, and that's too short for my needs..
2008 Jan 07
3
Seeking a more efficient way to find partition maxima
Hi. Suppose I have a vector that I partition into disjoint, contiguous subvectors. For example, let v = c(1,4,2,6,7,5), partition it into three subvectors, v1 = v[1:3], v2 = v[4], v3 = v[5:6]. I want to find the maximum element of each subvector. In this example, max(v1) is 4, max(v2) is 6, max(v3) is 7. If I knew that the successive subvector maxima would never decrease, as in the example,
2007 Nov 26
1
visualizing nucleotide sequence properties
Hi there, I am looking for R-packages that can help me visualize properties on nucleotide sequences. I want to display sequences in the 1-100K base range as lines and plot features above and below those lines. Any ideas would be welcome. Thanks, Bernd [[alternative HTML version deleted]]
2005 Dec 10
2
append
Dear R users: > append(1:5, 0:1, after=2) [1] 1 2 0 1 3 4 5 If I want to repeat the appended value every 2 like the following: [1] 1 2 0 1 3 4 0 1 5 How should I modify? Thank you for any help.
2004 Feb 22
3
Simulation help
I am a new R user. As a test, I want to write a simple code that does the following simulation: 1. Randomly generate a number from a distribution, say, Poisson. Let's say that number is 3. 2. Randomly generate 3 numbers from another distribution, say, Normal. 3. Compute the sum of the numbers generated in step 2 and read it into a vector, V. 4. Repeat steps 1 through 3 for 100,000 times. 5.
2006 Mar 21
7
Nuube Sequence problem
In my database the id for a field is 810. RoR thinks that it is 809. My log file (below) shows that just before the insert it grabs the next sequence value. I dont think it should do that. This causes problems further down the line when trying to access the Person object. Development Log file : "SQL (0.016000) select people_seq.nextval id from dual Person Create (0.015000) INSERT