Re: [R] Deleting subsequences from a string sequence

2014-01-24 Thread arun
HI, I am sorry.  I didn't test it properly. Check if this works. (But, you already got Hervé's solution). For ##2 eyaSpl2 <- rep("#",sum(length(eyaSpl),length(CDS1[,1]))) ##as in previous code indx <- CDS1[,1]+rep(seq(0,length(CDS1[,1]),by=2),each=2)[-c(1,40)] eyaSpl2[-indx] <- eyaSpl ###testing

Re: [R] Deleting subsequences from a string sequence

2014-01-23 Thread Hervé Pagès
Hi, This is easy to do with the Biostrings package (from Bioconductor). Let's say you've managed to load the string from your eya4_lagan_HM_cp.txt file: my_seq <- "123456789012345678901234567890" What you call "pairs of positions" are "ranges". Let's say you've managed to the ranges from you

Re: [R] Deleting subsequences from a string sequence

2014-01-23 Thread arun
Hi, Try:  CDS1 <- read.table("CDS coordinates.txt",header=FALSE) CDS2 <- split(CDS1[,1],as.numeric(as.character(gl(nrow(CDS1),2,length=nrow(CDS1) eya4 <- readChar("eya4_lagan_HM_cp.txt",file.info("eya4_lagan_HM_cp.txt")$size)  eyaSpl<- head(strsplit(eya4,"")[[1]],-1) length(eyaSpl) #[1] 311522