Description Usage Details Value Author(s) References See Also Examples
View source: R/Autoplotprotein.R
Download the site of the protein, including the name
1 |
Download the site of the protein, including the distribution of the locus of the marker space
The location of the marker line
Xiaoyu Zhang
https://cran.r-project.org/doc/manuals/R-exts.html
codehelp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function ()
{
library(XML)
library(plyr)
protein = read.table("Protein.txt", sep = "\t", stringsAsFactors = F)
name = protein[2]
url_p = "http://www.uniprot.org/uniprot/"
url_s = "#showFeatures"
url_w = paste(url_p, name, url_s, sep = "")
url = url_w
doc <- htmlParse(url)
position_s = xpathSApply (doc, "//table[@id= 'sitesAnno_section']
/tr/td/ a[@class = 'position tooltipped']",
xmlValue)
name_s = xpathSApply (doc, "//table[@id= 'sitesAnno_section']/tr/td/span[@property='text']",
xmlValue)
s_s <- c()
for (i in 1:length(position_s)) {
s_s[i] <- gsub(pattern = "//D", replacement = "x", position_s[i])
}
s_s <- strsplit(s_s, "xxx")
d1_s <- laply(s_s, function(x) x[1])
d2_s <- laply(s_s, function(x) x[2])
r1_site = d1_s
r2_site = name_s
dfrm_site = data.frame(r1_site, r2_site)
write.table(dfrm_site, file = "Site.txt", sep = "/t", quote = FALSE,
row.names = F, col.names = F)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.