为了从 qiime2 工件中提取频率表并将其写入 tsv 输出,您必须:
rel_freq_table <- read_qza("05.TaxonomyClassification/rel_freq/1_rel_freq_table.qza")
rel_freq_table <- data.frame(rel_freq_table$data)
rel_freq_table <- setDT(rel_freq_table, keep.rownames = TRUE )
colnames(rel_freq_table)[1]<- c( "Feature.ID" )
write.table(rel_freq_table, file = "1_rel_freq_table.tsv", row.names = FALSE, dec = ",")
现在,我有七个 qiime2 工件
rel_freqs <- c("05.TaxonomyClassification/rel_freq/1_rel_freq_table.qza","05.TaxonomyClassification/rel_freq/2_rel_freq_table.qza",
"05.TaxonomyClassification/rel_freq/3_rel_freq_table.qza","05.TaxonomyClassification/rel_freq/4_rel_freq_table.qza",
"05.TaxonomyClassification/rel_freq/5_rel_freq_table.qza","05.TaxonomyClassification/rel_freq/6_rel_freq_table.qza",
"05.TaxonomyClassification/rel_freq/7_rel_freq_table.qza")
我想自动化这个过程,所以我只需要运行一次命令。我试过循环和 lapply 但没有运气,有人知道吗?