Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A minor issue with gset_import_table #52

Closed
LilithMary opened this issue Jul 5, 2021 · 2 comments
Closed

A minor issue with gset_import_table #52

LilithMary opened this issue Jul 5, 2021 · 2 comments

Comments

@LilithMary
Copy link

Hi,

In applying gset_import_table I received the error that object 'set' is not found.

I had a closer look at the function definition here and I think there is a typo here:

#' Import gene set for a text table
#
#' @param fn file name to read from
#' @param desc tetual description of the gset, if null the desc will be the file name
#' @export
gset_import_table = function(fn, desc=NULL)
{
	sets = read.table(fn, h=T, sep="\t")
	if(is.null(desc)) {
		desc = fn
	}
	if("gene" %in% colnames(sets) & "set" %in% colnames(sets)) {
		gs = sets$set
		names(gs) = set$gene #### <<<< Here set$gene should be sets$gene
		return(tgGeneSets(gs, desc))
	} else {
		stop("cannot initialize gset from ", fn, " file must be a tab delim table with a header including the fields gene and set\n")
	}
}

As indicated in the code above I think in line names(gs) = set$gene, set$gene should be sets$gene.
I added this slightly amended function definition to my code and the problem was resolved. Is this the correct fix for the problem?

@akhiadber
Copy link
Collaborator

You are correct, will change with the next push

@LilithMary
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants