Skip to content

Error in makeFunctionalPrediction() – "no rows to aggregate" #5

@msuchet

Description

@msuchet

Hi ! ’m running Tax4Fun2 (v1.1.5) on Ubuntu via WSL2. The runRefBlast() step completed successfully, but when I call makeFunctionalPrediction(), I get the following error:

Error in aggregate.data.frame(x = otu_table_reduced[, -1], by = list(otu_table_reduced[,  :
  no rows to aggregate

Context and setup

  • R on Ubuntu 22.04 (via WSL2 on Windows 11)
  • Tax4Fun2 version: 1.1.5 (downloaded from Zenodo: https://zenodo.org/records/10035668)
  • Reference data: Tax4Fun2_ReferenceData_v2 (properly extracted and readable)
  • Database mode: "Ref99NR"

Path & script used :

fasta_file <- "rep-seqs_filtered.fasta"
temp_folder <- "~/Tax4fun_test_ubuntu/Tax4Fun2_temp_results"
ref_path <- "~/Tax4fun_test_ubuntu/Tax4Fun2_ReferenceData_v2"
if (!dir.exists(temp_folder)) dir.create(temp_folder)
res_tax4fun <- runRefBlast(path_to_otus = fasta_file,
                           path_to_reference_data = ref_path,
                           path_to_temp_folder = temp_folder,
                           database_mode = "Ref99NR",
                           use_force = TRUE,
                           num_threads = 4)
list.files(temp_folder)
# "logfile1.txt"  "ref_blast.txt" -> output here = ok

blast_res <- read.table(file.path(temp_folder, "ref_blast.txt"), sep = "\t", header = FALSE)
head(read.table("Tax4Fun2_temp_results/ref_blast.txt", nrows = 5)$V1)
# "Cluster_1" "Cluster_2" "Cluster_3" "Cluster_6" "Cluster_8" -> corresponding to my ASVs identifications

res_functional <- makeFunctionalPrediction(
  path_to_otu_table = "/home/msuchet/Tax4fun_test_ubuntu/otu_table_tax4fun2_corrected.txt",
  path_to_reference_data = ref_path,
  path_to_temp_folder = temp_folder,
  database_mode = "Ref99NR",
  normalize_by_copy_number = TRUE,
  min_identity_to_reference = 0.95,  
  normalize_pathways = FALSE)         
#Using minimum idenity cutoff of 95% to nearest neighbor
#Error in aggregate.data.frame(x = otu_table_reduced[, -1], by = list(otu_table_reduced[,  : no rows to aggregate

I verified that:

  • The OTU table and reference blast results exist and are readable.
  • OTU names match between my table and the ref_blast.txt output.
  • The min identity threshold isn't the problem.
  • The same error occurred previously on Windows, so it might not be system-dependent.
otu <- read.table("otu_table_tax4fun2_corrected.txt", header = TRUE, row.names = 1)
blast_res <- read.table(file.path(temp_folder, "ref_blast.txt"), sep = "\t", header = FALSE)
table(rownames(otu) %in% blast_res$V1)
# TRUE: 662
setdiff(rownames(otu), blast_res$V1)
# character(0)
table(blast_res$V3 >= 95) # TRUE = 438 -> 438 ASV with % identity >95%

So the question is, what could cause the error "no rows to aggregate" when I try to use makeFunctionalPrediction()? How to fix it ?
Any help or clarification would be greatly appreciated. I can share detaisl or files if needed.

Best

Marine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions