I am looking to parse through a dataset and match it up with a tree I have already made in R. I am trying to simplify the tip labels to be matched up with my phylogenetic tree.
For instance from the "gi|399148998|gb|JN638572|" and simplifying that down to just "JN638572" (the accession number); and I need to do this 61 times (61 samples). Each of the accession numbers start at the same position as well.
## thanks for the data serban
set.seed(1)
mydat <- replicate(61, paste0(paste0(sample(letters,2), collapse=""),"|",
round(runif(1,1e8,1e9-1)),"|",
paste0(sample(letters,2), collapse=""),"|",
paste0(sample(LETTERS,2), collapse=""),
round(runif(1,1e6,1e7-1)),"|"))
head(mydat)
# [1] "gj|615568026|xf|XZ6947179|" "qb|285377117|er|JT5479293|" "sy|442031661|ux|FQ2129996|"
# [4] "gj|112051300|jv|IM6396092|" "me|844635986|rt|CS4701469|" "vq|804639485|on|UA5295070|"