Skip to content

Commit

Permalink
fix for obo files
Browse files Browse the repository at this point in the history
  • Loading branch information
oganm committed Apr 28, 2021
1 parent d045dbf commit 5486b78
Show file tree
Hide file tree
Showing 48 changed files with 605,631 additions and 972,268 deletions.
11 changes: 6 additions & 5 deletions R/ermineR.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ermineR = function(annotation = NULL,
geneReplicates = match.arg(geneReplicates)
stats = match.arg(stats)
# set ermineJ home so users won't have to
ermineJHome = system.file("ermineJ-3.1.2",package = 'ermineR')
ermineJHome = system.file("ermineJ-3.2",package = 'ermineR')
Sys.setenv(ERMINEJ_HOME = ermineJHome)

# find that java home at all costs
Expand Down Expand Up @@ -95,21 +95,22 @@ ermineR = function(annotation = NULL,

# get gene set descriptions -------------
if(is.null(geneSetDescription) | nullAnnot){
geneSetDescription = system.file('go-minimal.xml',package = 'ermineR')
geneSetDescription = system.file('go-minimal.obo',package = 'ermineR')
} else if(geneSetDescription == 'Latest_GO'){
temp = tempfile(fileext = '.xml')
temp = tempfile()
goToday(temp)
geneSetDescription = temp
}else if(!file.exists(geneSetDescription)){
message('Attempting to download gene set description from link')
temp = tempfile(fileext = 'xml.gz')
temp = tempfile()
download.file(url = geneSetDescription,destfile = temp,quiet= TRUE)
geneSetDescription = temp
} # and else, geneSetDescription is a local file

assertthat::is.string(geneSetDescription) # geneSetDescription is mandatory
arguments$geneSetDescription = paste('--classFile',shQuote(geneSetDescription))


# get scores and score columns-------------
if(test %in% c('ORA','GSR','ROC')){
# get hitlist if provided instead of scores
Expand Down Expand Up @@ -335,7 +336,7 @@ ermineR = function(annotation = NULL,
# warning('Something went wrong and I have no idea what. Returning response')
# return(response)
# }

if(return){
out = readErmineJOutput(output)
out$details$call = call
Expand Down
9 changes: 5 additions & 4 deletions R/ontology.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
#'
#' Downloads latest gene ontology term information (not gene annotations)
#'
#' @param path File path. Without gz extension
#' @param path File path
#' @param overwrite If TRUE, overwrites existing file
#'
#' @export
goToday = function(path,overwrite = FALSE){
if(exists(path) & !overwrite){
stop('File exists, not downloading')
}
utils::download.file('http://archive.geneontology.org/latest-termdb/go_daily-termdb.rdf-xml.gz',
destfile = paste0(path,'.gz'),quiet= TRUE)
R.utils::gunzip(paste0(path,'.gz'),overwrite = overwrite)
utils::download.file('http://purl.obolibrary.org/obo/go.obo',
destfile = paste0(path),quiet= TRUE)
}

#' getGoDates
Expand All @@ -26,6 +25,8 @@ getGoDates = function(){
files =
RCurl::getURL('ftp://ftp.geneontology.org/pub/go/godatabase/archive/termdb/',dirlistonly = TRUE,ftp.use.epsv=TRUE)

files = RCurl::getURL('http://release.geneontology.org/')

# dates = files %>% strsplit('a href') %>% {.[[1]]} %>% {.[grepl(x = .,pattern = '[0-9]+?-[0-9]+?-[0-9]+(?=/)',perl = TRUE)]} %>%
# stringr::str_extract( '[0-9]+?-[0-9]+?-[0-9]+(?=/)')
files %<>% strsplit('\n') %>% {.[[1]]} %>% {.[grepl(pattern = '[0-9]+?-[0-9]+?-[0-9]+', .)]}
Expand Down
Binary file removed inst/ermineJ-3.1.2/lib/baseCode.jar
Binary file not shown.
Binary file removed inst/ermineJ-3.1.2/lib/commons-beanutils.jar
Binary file not shown.
Binary file removed inst/ermineJ-3.1.2/lib/ermineJ.jar
Binary file not shown.
Binary file removed inst/ermineJ-3.1.2/lib/gemma-gsec.jar
Binary file not shown.
File renamed without changes.
240 changes: 120 additions & 120 deletions inst/ermineJ-3.1.2/bin/ermineJ.bat → inst/ermineJ-3.2/bin/ermineJ.bat
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,120 +1,120 @@
@echo off
@REM enable echoing my setting ERMINEJ_BATCH_ECHO to 'on'
@if "%ERMINEJ_BATCH_ECHO%" == "on" echo %ERMINEJ_BATCH_ECHO%

echo Starting ErmineJ ...

@REM Execute a user defined script before this one
if exist "%HOME%\ermineJrc_pre.bat" call "%HOME%\ermineJrc_pre.bat"

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%" goto chkMHome

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:chkMHome
if not "%ERMINEJ_HOME%" == "" goto valMHome

echo.
echo ERROR: ERMINEJ_HOME not found in your environment.
echo Please set the ERMINEJ_HOME variable in your environment to match the
echo location of the ermineJ installation
echo.
goto end

:valMHome
if exist "%ERMINEJ_HOME%\bin\ermineJ.bat" goto init

echo.
echo ERROR: ERMINEJ_HOME is set to an invalid directory or does not contain the bin\ermineJ.bat script
echo ERMINEJ_HOME = %ERMINEJ_HOME%
echo Please set the ERMINEJ_HOME variable in your environment to match the
echo location of the ermineJ installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set ERMINEJ_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set ERMINEJ_CMD_LINE_ARGS=%$
goto endInit

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%ERMINEJ_OPTS%"=="" SET ERMINEJ_OPTS="-Xmx3g"
SET ERMINEJ_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

if exist %ERMINEJ_JAVA_EXE% goto run
echo.
echo ERROR: ERMINEJ_JAVA_EXE is set to an invalid path.
echo ERMINEJ_JAVA_EXE = %ERMINEJ_JAVA_EXE%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of the java installation
echo.
goto end

:run
SET ERMINEJ_CLASSPATH="%ERMINEJ_HOME%\lib\forehead.jar"
SET ERMINEJ_MAIN_CLASS="com.werken.forehead.Forehead"
SET ERMINEJ_ENDORSED="%JAVA_HOME%\lib\endorsed;%ERMINEJ_HOME%\lib"
if not "%ERMINEJ_HOME_LOCAL%" == "" goto StartMHL

@REM Start ERMINEJ without ERMINEJ_HOME_LOCAL override
%ERMINEJ_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
@REM %ERMINEJ_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
goto :end

@REM Start ERMINEJ with ERMINEJ_HOME_LOCAL override
:StartMHL
%ERMINEJ_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-DermineJ.home.local=%ERMINEJ_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
@REM %ERMINEJ_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-DermineJ.home.local=%ERMINEJ_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set ERMINEJ_JAVA_EXE=
set ERMINEJ_CLASSPATH=
set ERMINEJ_MAIN_CLASS=
set ERMINEJ_CMD_LINE_ARGS=
goto postExec

:endNT
@endlocal

:postExec
@REM if exist "%HOME%\ermineJrc_post.bat" call "%HOME%\ermineJrc_post.bat"
@REM pause the batch file if ERMINEJ_BATCH_PAUSE is set to 'on'
@REM if "%ERMINEJ_BATCH_PAUSE%" == "on" pause

@echo off
@REM enable echoing my setting ERMINEJ_BATCH_ECHO to 'on'
@if "%ERMINEJ_BATCH_ECHO%" == "on" echo %ERMINEJ_BATCH_ECHO%

echo Starting ErmineJ ...

@REM Execute a user defined script before this one
if exist "%HOME%\ermineJrc_pre.bat" call "%HOME%\ermineJrc_pre.bat"

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%" goto chkMHome

echo.
echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:chkMHome
if not "%ERMINEJ_HOME%" == "" goto valMHome

echo.
echo ERROR: ERMINEJ_HOME not found in your environment.
echo Please set the ERMINEJ_HOME variable in your environment to match the
echo location of the ermineJ installation
echo.
goto end

:valMHome
if exist "%ERMINEJ_HOME%\bin\ermineJ.bat" goto init

echo.
echo ERROR: ERMINEJ_HOME is set to an invalid directory or does not contain the bin\ermineJ.bat script
echo ERMINEJ_HOME = %ERMINEJ_HOME%
echo Please set the ERMINEJ_HOME variable in your environment to match the
echo location of the ermineJ installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set ERMINEJ_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set ERMINEJ_CMD_LINE_ARGS=%$
goto endInit

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%ERMINEJ_OPTS%"=="" SET ERMINEJ_OPTS="-Xmx3g"
SET ERMINEJ_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

if exist %ERMINEJ_JAVA_EXE% goto run
echo.
echo ERROR: ERMINEJ_JAVA_EXE is set to an invalid path.
echo ERMINEJ_JAVA_EXE = %ERMINEJ_JAVA_EXE%
echo Please set the JAVA_HOME variable in your environment to match the
echo location of the java installation
echo.
goto end

:run
SET ERMINEJ_CLASSPATH="%ERMINEJ_HOME%\lib\forehead.jar"
SET ERMINEJ_MAIN_CLASS="com.werken.forehead.Forehead"
SET ERMINEJ_ENDORSED="%JAVA_HOME%\lib\endorsed;%ERMINEJ_HOME%\lib"
if not "%ERMINEJ_HOME_LOCAL%" == "" goto StartMHL

@REM Start ERMINEJ without ERMINEJ_HOME_LOCAL override
%ERMINEJ_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
@REM %ERMINEJ_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
goto :end

@REM Start ERMINEJ with ERMINEJ_HOME_LOCAL override
:StartMHL
%ERMINEJ_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-DermineJ.home.local=%ERMINEJ_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%
@REM %ERMINEJ_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-DermineJ.home=%ERMINEJ_HOME%" "-DermineJ.home.local=%ERMINEJ_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%ERMINEJ_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%ERMINEJ_ENDORSED% %ERMINEJ_OPTS% -classpath %ERMINEJ_CLASSPATH% %ERMINEJ_MAIN_CLASS% %ERMINEJ_CMD_LINE_ARGS%

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set ERMINEJ_JAVA_EXE=
set ERMINEJ_CLASSPATH=
set ERMINEJ_MAIN_CLASS=
set ERMINEJ_CMD_LINE_ARGS=
goto postExec

:endNT
@endlocal

:postExec
@REM if exist "%HOME%\ermineJrc_post.bat" call "%HOME%\ermineJrc_post.bat"
@REM pause the batch file if ERMINEJ_BATCH_PAUSE is set to 'on'
@REM if "%ERMINEJ_BATCH_PAUSE%" == "on" pause

File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added inst/ermineJ-3.2/lib/baseCode.jar
Binary file not shown.
File renamed without changes.
Binary file added inst/ermineJ-3.2/lib/commons-beanutils.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added inst/ermineJ-3.2/lib/ermineJ.jar
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file added inst/ermineJ-3.2/lib/gemma-gsec.jar
Binary file not shown.
Binary file added inst/ermineJ-3.2/lib/javax.activation-api.jar
Binary file not shown.
Binary file added inst/ermineJ-3.2/lib/jaxb-api.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
65 changes: 65 additions & 0 deletions inst/go-minimal.obo
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
format-version: 1.2
data-version: releases/2021-02-01
subsetdef: chebi_ph7_3 "Rhea list of ChEBI terms representing the major species at pH 7.3."
subsetdef: gocheck_do_not_annotate "Term not to be used for direct annotation"
subsetdef: gocheck_do_not_manually_annotate "Term not to be used for direct manual annotation"
subsetdef: goslim_agr "AGR slim"
subsetdef: goslim_aspergillus "Aspergillus GO slim"
subsetdef: goslim_candida "Candida GO slim"
subsetdef: goslim_chembl "ChEMBL protein targets summary"
subsetdef: goslim_drosophila "Drosophila GO slim"
subsetdef: goslim_flybase_ribbon "FlyBase Drosophila GO ribbon slim"
subsetdef: goslim_generic "Generic GO slim"
subsetdef: goslim_metagenomics "Metagenomics GO slim"
subsetdef: goslim_mouse "Mouse GO slim"
subsetdef: goslim_pir "PIR GO slim"
subsetdef: goslim_plant "Plant GO slim"
subsetdef: goslim_pombe "Fission yeast GO slim"
subsetdef: goslim_synapse "synapse GO slim"
subsetdef: goslim_yeast "Yeast GO slim"
synonymtypedef: syngo_official_label "label approved by the SynGO project"
synonymtypedef: systematic_synonym "Systematic synonym" EXACT
default-namespace: gene_ontology
ontology: go
property_value: http://purl.org/dc/elements/1.1/description "The Gene Ontology (GO) provides a framework and set of concepts for describing the functions of gene products from all organisms." xsd:string
property_value: http://purl.org/dc/elements/1.1/title "Gene Ontology" xsd:string
property_value: http://purl.org/dc/terms/license http://creativecommons.org/licenses/by/4.0/
property_value: owl:versionInfo "2021-02-01" xsd:string

[Term]
id: GO:0003674
name: molecular_function
namespace: molecular_function
alt_id: GO:0005554
def: "A molecular process that can be carried out by the action of a single macromolecular machine, usually via direct physical interactions with other molecular entities. Function in this sense denotes an action, or activity, that a gene product (or a complex) performs. These actions are described from two distinct but related perspectives: (1) biochemical activity, and (2) role as a component in a larger system/process." [GOC:pdt]
comment: Note that, in addition to forming the root of the molecular function ontology, this term is recommended for use for the annotation of gene products whose molecular function is unknown. When this term is used for annotation, it indicates that no information was available about the molecular function of the gene product annotated as of the date the annotation was made; the evidence code 'no data' (ND), is used to indicate this. Despite its name, this is not a type of 'function' in the sense typically defined by upper ontologies such as Basic Formal Ontology (BFO). It is instead a BFO:process carried out by a single gene product or complex.
subset: goslim_aspergillus
subset: goslim_candida
subset: goslim_chembl
subset: goslim_generic
subset: goslim_metagenomics
subset: goslim_pir
subset: goslim_plant
subset: goslim_yeast
synonym: "molecular function" EXACT []

[Term]
id: GO:1
name: one
namespace: molecular_function
def: "The maintenance of the structure and integrity of the mitochondrial genome; includes replication and segregation of the mitochondrial chromosome." [GOC:ai, GOC:vw]

[Term]
id: GO:2
name: two
namespace: molecular_function

[Term]
id: GO:11
name: eleven
namespace: molecular_function

[Term]
id: GO:31
name: thirtyone
namespace: molecular_function
Loading

0 comments on commit 5486b78

Please sign in to comment.