Re: [R] Regular expressions, genbank

2014-02-06 Thread arun
HI, May be this helps: lines1 <- readLines(textConnection('text to be ignored... CDS 687..3158 /gene="AXL2" /note="plasma membrane glycoprotein" other text to be ignored... CDS complement(3300..4037)

Re: [R] Regular expressions, genbank

2014-02-06 Thread arun
You could also try: library(gsubfn) strapply(gsub("\\d+<|>\\d+","",vec1),"([0-9]+)",as.numeric,simplify=c) A.K. On Thursday, February 6, 2014 1:55 PM, arun wrote: Hi, One way would be: vec1 <- c("CDS 3300..4037",  "CDS complement(3300..4037)", "CDS 3300

Re: [R] Regular expressions, genbank

2014-02-06 Thread arun
Hi, One way would be: vec1 <- c("CDS 3300..4037",  "CDS complement(3300..4037)", "CDS 3300<..4037", "CDS join(21467..26641,27577..28890)",  "CDS complement(join(30708..31700,31931..31984))",  "CDS 3300<..>4037") library(s