Skip to content

Commit

Permalink
Merge pull request #33 from Chris1221/devel
Browse files Browse the repository at this point in the history
Bug checks and fixes
  • Loading branch information
Chris1221 authored Oct 16, 2016
2 parents b8495e8 + 7756093 commit fa1b7c2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
Binary file added R/.goldi.R.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated by Rcpp::compileAttributes
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Match terms
Expand Down
10 changes: 6 additions & 4 deletions R/goldi.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @keywords Text Mining, Gene Ontology, Databases
#'
#' @author Christopher B. Cole <[email protected]>
#' @author Christopher B. Cole <chris.c.1221@@gmail.com>
#'
#' @references See ArXiv prepubliation.
#'
Expand Down Expand Up @@ -151,7 +151,7 @@ Note that any interactively created lists may be saved and inputed.

lims <- as.list(lims)

flog.warn("Trying to coerce limits to list format.")
flog.debug("Trying to coerce limits to list format.")
flog.info("Printing your lims to log file. You can use this to recreate your list later:")

flog.info("%s", capture.output(dput(lims)))
Expand Down Expand Up @@ -460,12 +460,12 @@ Note that any interactively created lists may be saved and inputed.

# Clean this up after, it's really messy right now

out %>% as.data.frame %>% data.matrix -> input_pdf_tdm
suppressWarnings( out %>% as.data.frame %>% data.matrix ) -> input_pdf_tdm
colnames(input_pdf_tdm) <- NULL
row.names(input_pdf_tdm) <- NULL

input_term_tdm <- as.matrix(TDM.go.df)
input_term_tdm %<>% as.data.frame %>% data.matrix
input_term_tdm %<>% as.data.frame %>% data.matrix %>% suppressWarnings()
colnames(input_term_tdm) <- NULL
row.names(input_term_tdm) <- NULL

Expand Down Expand Up @@ -511,6 +511,8 @@ Note that any interactively created lists may be saved and inputed.

flog.info("Everything was successful. Ending logging now. Have a nice day.")

colnames(terms) <- c("Identified Terms", "Context")

if(!object){

flog.info("Returning as List, either for internal use or for testing.")
Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Test environments
* Local OS X Install, R 3.3.1
* Linux Ubuntu 12.04 LTS Server Edition 64 bit (through Travis-CI), R 3.3.1
* Windows through Appveyor, R R.3.3.1
* Local OS X Install, R 3.3.1 + R Devel
* Linux Ubuntu 12.04 LTS Server Edition 64 bit (through Travis-CI), R 3.3.1 + R Devel
* Windows through Appveyor, R 3.3.1 + R Devel

## R CMD check results
There were no ERRORs or WARNINGs.
Expand Down
10 changes: 5 additions & 5 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by Rcpp::compileAttributes
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <RcppArmadillo.h>
Expand All @@ -10,16 +10,16 @@ using namespace Rcpp;
Rcpp::CharacterMatrix match(arma::uvec term_vector, arma::mat pdf_tdm, arma::mat term_tdm, arma::vec thresholds, arma::uvec pdf_index, std::vector<std::string> terms, std::vector<std::string> sentences);
RcppExport SEXP goldi_match(SEXP term_vectorSEXP, SEXP pdf_tdmSEXP, SEXP term_tdmSEXP, SEXP thresholdsSEXP, SEXP pdf_indexSEXP, SEXP termsSEXP, SEXP sentencesSEXP) {
BEGIN_RCPP
Rcpp::RObject __result;
Rcpp::RNGScope __rngScope;
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< arma::uvec >::type term_vector(term_vectorSEXP);
Rcpp::traits::input_parameter< arma::mat >::type pdf_tdm(pdf_tdmSEXP);
Rcpp::traits::input_parameter< arma::mat >::type term_tdm(term_tdmSEXP);
Rcpp::traits::input_parameter< arma::vec >::type thresholds(thresholdsSEXP);
Rcpp::traits::input_parameter< arma::uvec >::type pdf_index(pdf_indexSEXP);
Rcpp::traits::input_parameter< std::vector<std::string> >::type terms(termsSEXP);
Rcpp::traits::input_parameter< std::vector<std::string> >::type sentences(sentencesSEXP);
__result = Rcpp::wrap(match(term_vector, pdf_tdm, term_tdm, thresholds, pdf_index, terms, sentences));
return __result;
rcpp_result_gen = Rcpp::wrap(match(term_vector, pdf_tdm, term_tdm, thresholds, pdf_index, terms, sentences));
return rcpp_result_gen;
END_RCPP
}
6 changes: 4 additions & 2 deletions tests/testthat/test-goldi.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ log = "/dev/null"
ouput = "/dev/null"

os <- .Platform$OS.type
out <- structure(c("ribosomal_chaperone_activity", "Ribosomal chaperone activity"), .Dim = 1:2)

#out <- structure(c("ribosomal_chaperone_activity", "Ribosomal chaperone activity"), .Dim = 1:2)

out <- structure(c("ribosomal_chaperone_activity", "Ribosomal chaperone activity"
), .Dim = 1:2, .Dimnames = list(NULL, c("Identified Terms", "Context"
)))
test_that("testing main function", {
if(os != "unix") skip("Tests are not currently performed on windows.")

Expand Down

0 comments on commit fa1b7c2

Please sign in to comment.