Closed gabrielodom closed 5 years ago
@lxw391, gene symbols or IDs are the units of a pathway. What are the units of a region, CpGs? What are the units of a gene?
We will add the argument setType = c("pathway", "gene", "region")
to the read_gmt()
and CreatePathwayCollection()
functions.
We can replace the internal pathways
object with an object called sets_ls
.
I get this error for write_gmt: `
out_CloseByRegions Object with Class(es) 'pathwayCollection', 'list' [package 'pathwayPCA'] with 2 elements: $ regions:List of 1966 $ TERMS : chr [1:1966] "chr10:100993553-100993597" ... write_gmt(out_CloseByRegions, file = fileName, setType = "regions") Error in write_gmt(out_CloseByRegions, file = fileName, setType = "regions") : Number of sets should match number of TERMS. `
I think the problem is in this part of the code:
sets_ls <- pathwayCollection[setType]
nPaths <- length(sets_ls)
if(nPaths != length(TERMS_char)){ stop("Number of sets should match number of TERMS.") }
It seems nPaths will always be 1
Can you send me the data and script? Also, nPaths
should never be 1. It should be 1966.
This is using the example for write_gmt function: `
toy_pathwayCollection Object with Class(es) 'pathwayCollection', 'list' [package 'pathwayPCA'] with 3 elements: $ pathways :List of 3 $ TERMS : chr [1:3] "C-or-f_paths" ... $ description: chr [1:3] "these are" ... write_gmt(toy_pathwayCollection, file = "example_pathway.gmt") Error in write_gmt(toy_pathwayCollection, file = "example_pathway.gmt") : Number of sets should match number of TERMS.`
Thank you. Please try it now.
@lizhongliu1996, please add this check to the testing script for write_gmt()
. Please close this issue when you are finished.
Bug fixes, added unit test and pass the test based on @lissettegomez , close issue
To support coMethDMR and rnaEditr, the read/write functions for .gmt files need to be more flexible. Instead of hard-coding "pathwayXX" as the names of the first list element, we need to give the option to have "pathway", "gene", or "region".
This is per @lxw391's request.