library(parallel) cl <- makeCluster(detectCores()) clusterEvalQ(cl, library('phyloseq')) physeq <- readRDS('physeq_file.rds')

parLapply(cl, 1:ncol(physeq@otu_table), function(i){ physeq@otu_table[,i] <- sapply(physeq@otu_table[,i], function(x) ifelse(x<=sum(physeq@otu_table[,i])*0.0005, 0, x)) })

stopCluster(cl)

writeRDS(physeq, 'physeq_file_updated.rds')

并行处理 R 脚本以过滤 phyloseq 数据

原文地址: https://www.cveoy.top/t/topic/oUqW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录