{"id":454,"date":"2022-04-20T09:17:34","date_gmt":"2022-04-20T01:17:34","guid":{"rendered":"https:\/\/linguopeng.top\/?p=454"},"modified":"2022-04-20T14:31:22","modified_gmt":"2022-04-20T06:31:22","slug":"r-server","status":"publish","type":"post","link":"https:\/\/linguopeng.top\/?p=454","title":{"rendered":"R-server"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#\u53c2\u8003https:\/\/www.jieandze1314.com\/post\/cnposts\/141\/\n#\u53c2\u8003https:\/\/www.jieandze1314.com\/post\/cnposts\/245\/\n# \u539f\u672c\u67094\u4e2aR\u5305\u8def\u5f84\uff0c\u73b0\u5728\u518d\u6dfb\u52a0\u4e00\u4e2a\nmyPaths &lt;- .libPaths()  \nnew &lt;- c('~\/r-2nd-pkgs')\nmyPaths &lt;- c(myPaths, new) \n.libPaths(myPaths) \n.libPaths()\n\n# \u63a5\u4e0b\u6765\u8c03\u6574\u4f4d\u7f6e\uff0c\u7b2c\u4e00\u4e2a\u662f\u9ed8\u8ba4\u5b89\u88c5\u8def\u5f84\uff08\u4f4d\u7f6e\u968f\u610f\u8c03\u6574\uff09\nmyPaths &lt;- .libPaths()  \nmyPaths &lt;- c(myPaths&#91;5], myPaths&#91;2],myPaths&#91;1],myPaths&#91;3],myPaths&#91;4])  \n.libPaths(myPaths) \n.libPaths()\n\n# \u63a5\u4e0b\u6765\u5c31\u80fd\u5728\u65b0\u7684\u8def\u5f84\u4e0b\u5b89\u88c5\u5176\u4ed6\u7248\u672c\u4e86\uff0c\u4f8b\u5982\u5b89\u88c5seurat 2.3.4\uff0c\u5b83\u8fd8\u9700\u8981\u5176\u4ed6\u4f9d\u8d56\u5305\npkgs = c( 'mixtools', 'lars', 'dtw', 'doSNOW', 'hdf5r','fpc','foreach' ) \nBiocManager::install(pkgs,ask = F,update = F)\npackageurl &lt;- \"https:\/\/cran.r-project.org\/src\/contrib\/Archive\/Seurat\/Seurat_2.3.4.tar.gz\"\ninstall.packages(packageurl, repos=NULL, type=\"source\")\n\n# \u6700\u540e\u5378\u8f7d\u4e4b\u524d\u7684\u7248\u672c\uff0c\u52a0\u8f7d\u65b0\u5efa\u7248\u672c\ndetach(\"package:Seurat\", unload=TRUE)\nlibrary(Seurat, lib.loc=\"~\/r-2nd-pkgs\") \npackageVersion('Seurat')\n\n\n# \u914d\u7f6e\u4e00\u4e2aR 4.0\nconda create -n R4 -y\nsource activate R4\nconda install r-base -y\n# \u7136\u540e\u7528conda\u7ee7\u7eed\u5b89\u88c5seurat\n conda install -c bioconda r-seurat -y\n\n\u5c06conda\u7684\u5b89\u88c5\u8def\u5f84\u8bbe\u7f6e\u6210Server\u9ed8\u8ba4\u5b89\u88c5\u7684\u8def\u5f84\u3002\nmyPaths &lt;- .libPaths()  \nnew &lt;- c('\/home\/miniconda3\/envs\/R4\/lib\/Rlibrary\/')\nmyPaths &lt;- c(myPaths, new) \n.libPaths(myPaths) \n.libPaths()\n\u8fd9\u6837\u5728console\u4e2d\u4fee\u6539\uff0c\u53ea\u80fd\u6301\u7eed\u4e00\u6b21\uff0c\u7b49\u4f60\u4e0b\u6b21\u91cd\u65b0\u6253\u5f00Rstudio\u65f6\u5c31\u5931\u6548\u4e86\u3002\u4e3a\u4e86\u4ee5\u540e\u7684\u65b9\u4fbf\uff0c\u53ef\u4ee5\u5728.Rprofile\u4e2d\u914d\u7f6e\u597d\nfile.edit('~\/.Rprofile')\n# \u7136\u540e\u6dfb\u52a0\u4e0b\u9762\u7684\u5185\u5bb9\noptions(\"repos\" = c(CRAN=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/CRAN\/\")) \noptions(BioC_mirror=\"https:\/\/mirrors.ustc.edu.cn\/bioc\/\")\n\nR_LIBS=\"\/home\/miniconda3\/envs\/R4\/lib\/R\/library\/\"\n\u4e4b\u540e\uff0c\u6bcf\u6b21\u91cd\u542f\u5c31\u4f1a\u9ed8\u8ba4\u5207\u6362\u5230\u8fd9\u4e2a\u8def\u5f84\u8fdb\u884c\u5b89\u88c5\u4e86\n\n\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-454","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454"}],"version-history":[{"count":4,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":459,"href":"https:\/\/linguopeng.top\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions\/459"}],"wp:attachment":[{"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linguopeng.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}