当前位置:   article > 正文

macOS devtools安装github包失败解决

macOS devtools安装github包失败解决

我在安装R包STUtility包时,一直处于失败的状态
https://ludvigla.github.io/STUtility_web_site/Installation.html

devtools::install_github("jbergenstrahle/STUtility")
  • 1

最终总是显示
在这里插入图片描述解决办法:
首先错误中提供的网址是可以下载的
在这里插入图片描述下载后,本地安装即可

install.packages("~/Desktop/问题/jbergenstrahle-STUtility-1.1-2-gf120348.tar.gz", repos = NULL, type = "source")

  • 1
  • 2

这里会提示安装以下的依赖包

install.packages("zeallot")
install.packages("imager")
install.packages("Morpho")
install.packages("Rvcg")
install.packages("spatstat")
install.packages("imagerExtra")
install.packages("shinyjs")
install.packages("ggiraph")
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

再次安装就可以成功了

install.packages("~/Desktop/问题/jbergenstrahle-STUtility-1.1-2-gf120348.tar.gz", repos = NULL, type = "source")
  • 1

测试demo

library(STutility)
library(SeuratData)
library(Seurat)
library(tidyverse)
df <- data.frame(samples  =c("/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_1/filtered_feature_bc_matrix.h5",
                             '/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_2/filtered_feature_bc_matrix.h5'),
                 spotfiles = c("/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_1/spatial/tissue_positions_list.csv",
                               '/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_2/spatial/tissue_positions_list.csv'),
                 imgs  = c("/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_1/spatial/tissue_hires_image.png",
                           '/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_2/spatial/tissue_hires_image.png'),
                 json = c("/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_1/spatial/scalefactors_json.json",
                          '/Volumes/MACPAN/空间转录组数据集/BreastCancer/V1_Breast_Cancer_Block_A_Section_2/spatial/scalefactors_json.json'))
df

?InputFromTable # 依然会过滤一些
se <- InputFromTable(infotable = df, 
                     min.gene.count = 100, 
                     min.gene.spots = 5,
                     min.spot.count = 500,
                     platform =  "Visium")


library(foreach)
library(parallel)
plt <- function(i){
  print(ggplot() +
          geom_histogram(data = se[[]], aes(get(i)), fill = "red", alpha = 0.7, color = "gray", bins = 50) +
          Seurat::DarkTheme() +
          ggtitle(paste0("Total", i , "  per spots")))
  
}

pl = list()
pl1 <- foreach::foreach(i = c('nFeature_RNA','nCount_RNA'),.packages = c("Seurat","ggplot2"))  %dopar% plt(i)

gene_attr <- data.frame(nUMI = Matrix::rowSums(se@assays$RNA@counts), 
                        nSpots = Matrix::rowSums(se@assays$RNA@counts > 0))

plt2 <- function(i){
  print(ggplot() +
          geom_histogram(data = gene_attr, aes(get(i)), fill = "red", alpha = 0.7, color = "gray", bins = 50) +
          Seurat::DarkTheme() +
          ggtitle(paste0("Total", i , "  per gene")))
  
}

pl2 <- foreach::foreach(i = c('nUMI','nSpots'),.packages = c("Seurat","ggplot2"))  %dopar% plt2(i)


print(cowplot::plot_grid(plotlist = c(pl1,pl2)))

  • 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
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51

结果如下
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/573928
推荐阅读
相关标签
  

闽ICP备14008679号