Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

I am attempting to perform a gene ontology analysis in R and I got this error:

Error in get_ontology(x, name = paste("Cluster", names(df.list[i]), "Pathways_for_kmeans_cluster",  : 

  unused argument (name = paste("Cluster", names(df.list[i]), "Pathways_for_kmeans_cluster", j, sep = "_"))

This is what I executed:

numclus <- sort(unique(df.list[[i]]$kmeans.cluster))

subdirname <- paste("D:/Master jaar 1/RP1/RP1 projects/Aged macrophage characterisation/Single cell sequencing/nieuwe stuff", "/top100_genes_from_", names(df.list[i]), "_pathways_from_kmeans_clusters", sep = " ")

dir.create(subdirname, showWarnings = FALSE)

install.packages("ontologyPlot")

for (j in numclus){

   x <- data.frame(gene = rownames(df.list[[i]][which(df.list[[i]]$kmeans.cluster == j),]), avg_logFC = 0)}

   if(nrow(x)>10){

     get_ontology(x, name = paste("Cluster", names(df.list[i]), "Pathways_for_kmeans_cluster", j, sep = "_"), return.data = F, outdir = subdirname, full_GSEA = F)

   }

 }

1 Answer

0 votes
by (108k points)

From the error, you can say that the get_ontology doesn't have an argument called name. The get_ontology has arguments like file, propogate_relationships, and extract_tags. Not name. All the data you need is in the online package documentation. After loading the package with the library(), type ?get_ontology, you will get to know what are the different arguments yo have to write in get_ontology.

If you are interested in R certification then do check out the R programming certification

Browse Categories

...