ANCOMBC 安装以及使用

在尝试使用Miniconda安装R包如ANCOMBC时,遇到了依赖库缺失的问题,包括gmp、CVXR等。通过尝试使用apt-get安装相关库,创建软链接,以及conda安装特定包等方式,最终成功解决了依赖问题并完成了ANCOMBC的安装。ANCOMBC是一个用于微生物组差异分析的工具,需要特定的数据输入格式,如phyloseq或SummarizedExperiment对象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装以及安装中遇到的问题。

- use conda install, failed 

conda install -c bioconda bioconductor-ancombc
 

- install other packages, also failed 

Tools for microbiome marker identification

* removing ‘/home/xx/miniconda3/envs/mice_project_r/lib/R/library/mia’
ERROR: dependencies ‘mia’, ‘CVXR’ are not available for package ‘ANCOMBC’
* removing ‘/home/xx/miniconda3/envs/mice_project_r/lib/R/library/ANCOMBC’
ERROR: dependency ‘ANCOMBC’ is not available for package ‘microbiomeMarker’
* removing ‘/home/xx/miniconda3/envs/mice_project_r/lib/R/library/microbiomeMarker’

- install with biomanager, also failed

configure: error: Header file gmp.h not found; maybe use --with-gmp-include=INCLUDE_PATH
ERROR: configuration failed for package ‘gmp’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/gmp’
ERROR: dependency ‘systemfonts’ is not available for package ‘textshaping’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/textshaping’
ERROR: dependency ‘gmp’ is not available for package ‘Rmpfr’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/Rmpfr’
ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/ragg’
ERROR: dependencies ‘gmp’, ‘Rmpfr’ are not available for package ‘CVXR’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/CVXR’
ERROR: dependencies ‘Cairo’, ‘ragg’ are not available for package ‘ggrastr’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/ggrastr’
ERROR: dependency ‘ggrastr’ is not available for package ‘scater’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/scater’
ERROR: dependency ‘scater’ is not available for package ‘mia’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/mia’
ERROR: dependencies ‘mia’, ‘CVXR’ are not available for package ‘ANCOMBC’
* removing ‘/home/lu/miniconda3/envs/mice_project_r/lib/R/library/ANCOMBC’

c - Where to find "gmp.h"? - Stack Overflow

apt-get install  libgmp3-dev
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

仍然报相同的错误 

sudo apt-get install -y libgmp-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgmp-dev is already the newest version (2:6.1.2+dfsg-2ubuntu0.1).
libgmp-dev set to manually installed.
The following packages were automatically installed and are no longer required:
  bridge-utils linux-hwe-5.4-headers-5.4.0-100 linux-hwe-5.4-headers-5.4.0-104 linux-hwe-5.4-headers-5.4.0-105 linux-hwe-5.4-headers-5.4.0-107 linux-hwe-5.4-headers-5.4.0-109
  linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-117 linux-hwe-5.4-headers-5.4.0-120 linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-122
  linux-hwe-5.4-headers-5.4.0-124 linux-hwe-5.4-headers-5.4.0-125 linux-hwe-5.4-headers-5.4.0-126 linux-hwe-5.4-headers-5.4.0-128 linux-hwe-5.4-headers-5.4.0-132 ubuntu-fan
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
 

still failed

curl更新 

sudo apt-get install libcurl4-openssl-dev

install curl and readr on R - Stack Overflow

https://github.com/ContinuumIO/anaconda-issues/issues/663

export CFLAGS="-I$PREFIX/include"

configure: error: Unable to locate gmp.h when enable gmp · Issue #11 · yeszao/dnmp · GitHub

这个也是建立软连接的。

apt-get install libzmq3-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev build-essential libcurl4-openssl-dev libxml2-dev libssl-dev libfontconfig1-dev

https://github.com/r-lib/pkgdown/issues/1427

Warning messages:
1: In install.packages(...) :
  installation of package ‘Cairo’ had non-zero exit status
2: In install.packages(...) :
  installation of package ‘gmp’ had non-zero exit status
3: In install.packages(...) :
  installation of package ‘Rmpfr’ had non-zero exit status
4: In install.packages(...) :
  installation of package ‘ragg’ had non-zero exit status
5: In install.packages(...) :
  installation of package ‘CVXR’ had non-zero exit status
6: In install.packages(...) :
  installation of package ‘ggrastr’ had non-zero exit status
7: In install.packages(...) :
  installation of package ‘scater’ had non-zero exit status
8: In install.packages(...) :
  installation of package ‘mia’ had non-zero exit status
9: In install.packages(...) :
  installation of package ‘ANCOMBC’ had non-zero exit status

从头安装 

carioR Cairo installation without apt-get, sudo - Stack Overflow

apt-get install libcairo2-dev

r - ERROR: configuration failed for package ‘ragg’ - Stack Overflow
 

conda install -c conda-forge pkg-config

Gmp :: Anaconda.org

conda install -c anaconda gmp


R Rmpfr :: Anaconda.org

conda install -c conda-forge r-rmpfr

** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ANCOMBC)

The downloaded source packages are in
    ‘/tmp/RtmpyMh7rB/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Old packages: 'curl'
Update all/some/none? [a/s/n]: n
 

安装成功。 

- 使用记录(basic level)

ancom的输入文件类型。

the input data. A phyloseqSummarizedExperiment, or TreeSummarizedExperiment object, which consists of a feature table (microbial count table), a sample metadata, a taxonomy table (optional), and a phylogenetic tree (optional). The row names of the metadata must match the sample names of the feature table, and the row names of the taxonomy table must match the taxon (feature) names of the feature table. See ?phyloseq::phyloseq?

ancombc: Analysis of Compositions of Microbiomes with Bias Correction... in FrederickHuangLin/ANCOMBC: Microbiome differential abudance and correlation analyses with bias correction

Chapter 11 Differential abundance | Orchestrating Microbiome Analysis

ANCOM-BC Tutorial

out = ancombc(data = tse, assay_name = "counts", 
              tax_level = "Family", phyloseq = NULL, 
              formula = "age + region + bmi", 
              p_adj_method = "holm", prv_cut = 0.10, lib_cut = 1000, 
              group = "bmi", struc_zero = TRUE, neg_lb = TRUE, tol = 1e-5, 
              max_iter = 100, conserve = TRUE, alpha = 0.05, global = TRUE,
              n_cl = 1, verbose = TRUE)

res = out$res
res_global = out$res_global
summary_ancom <- tibble(taxon = res$lfc$taxon, lfc = res$lfc[,3]) %>% 
    full_join(., tibble(taxon = res$p_val$taxon, pvalue = res$p_val[,3]), by = "taxon") %>% 
    full_join(., tibble(taxon = res$q_val$taxon, qvalue = res$q_val[,3]), by = "taxon") %>% 
    filter(pvalue <= 0.05)

这个出来的结果就有taxon名字以及pvalue和fdr矫正的qvalue

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值