Giter Club home page Giter Club logo

logrx's Introduction

pharmaverse website

pharmaverse.org

This website is maintained and governed by the pharmaverse Technology and Templates Working Group. Further details of this WG are available here, and all WG members are shown on our homepage. The WG lead is considered the product owner for the website and has final say on any decisions related to the website.

For any questions or enhancements for the site, please make issues at this repo.

Hosted sites:

This website is available at 2 locations:

Development / git flow

When you push to develop OR make a pull request onto develop a github action will run which will render the site, and deploy it to the test server. But the test server is different depending on which route you took.

The code on develop is hosted to: http://openpharma.s3-website.us-east-2.amazonaws.com/develop/

The intended workflows expects that develop is the UAT branch where you check things pre-prod. While the 'build from PR` allows you to work on something very experimental and check results, before pushing it do develop.

This git flow is predicated on it being unlikely to have more than one person actively working on the site at any one time.

You cannot work directly on main branch. The only way to push in is via a PR. And it will be denied if you have not come through develop. Any PR requires approval from one other Technology and Templates WG member.

Data flows

'Scraped' data

Passive data is collected via openpharma.github.io, a sister org that is completely un-opinionated and has
a wider remit spanning discovery to access. This site contains no curated data beyond names - and is instead focused on collecting and sharing data on open source health and related metadata (e.g. CRAN status and riskmetric scores).
Information on the data collected is here: https://openpharma.github.io/#data.

Data is stored in a pharmaverse AWS account.

Package info

Curated package info is stored in the folder data/. pharmaverse packages are in the folder data/packages. Non-pharma packages that get a special mention are in data/nonpharma. Each package is a unique .yaml file.

The general structure is:

name: admiral
repo: pharmaverse/admiral
repo_source: github.com
docs: https://pharmaverse.github.io/admiral/cran-release/
hex: https://github.com/insightsengineering/hex-stickers/raw/main/PNG/admiral.png
task: ADaM
details: (ADaM In R Asset Library) - Modular framework to generate ADaM via R functions relying on community contributions
splash: include # this controls what is shown on the main page. Plan is to deprecate and put all hex's up

It should be self explanatory. Please use the categories in the site for task:.

People

Info on people is in data/people. The yaml should be something like below, with the filename being the github handle.

name: James Black
pharmaverse_roles: tech
company: Roche
company_logo: roche.png
# Following is more a nice to have for profile pages [and optional]
linkedin: https://www.linkedin.com/in/epijim/
site: https://epijim.uk
title: People and Product Family Leader for Insights Engineering, Scientific Computing Environment Product Owner
bio: James is currently leading our pan-study codebase for insights

General content of the site

Site content is in content. It's normal markdown files. See markdown-guide.md.

Calling package info in the site

To call a package, we have two shortcuts. pharmaverse means it's 'pharmaverse' - e.g. in the folder data/packages. otherpackages is for non-pharmaverse packages, in data/nonpharma.

{{< pharmaverse pkg="rtables" >}}

{{< otherpackages pkg="gt" >}}

Council meeting minutes

From 2023 onwards, our monthly council meeting minutes will be published in static/council meeting minutes. Other static files such as images are stored in static also.

logrx's People

Contributors

bms63 avatar dgrassellyb avatar elimillera avatar kodesiba avatar nicholas-masel avatar nmasel avatar parmsam-pfizer avatar thomasp-b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

logrx's Issues

Bug: Update Docs Template to reflect what we use

What happened?

This template uses admiral categories. We should update it so it has our categories (TBD)?

  • References
  • Use Cases
  • Advanced Guides
  • New Topics

Session Information

No response

Reproducible Example

No response

Feature for consideration: Integrate with the `targets` library

This is a "feature for consideration" rather than going as far as being a "feature request" because I don't know if it would align with the goals of the project.

Much of my code takes a while to run (between minutes and hours), so I use the targets package (https://github.com/ropensci/targets) in almost all of my work. I could imagine combining the efforts in timber and targets to capture the outputs and the session info, and to speed up repeated re-analysis that is often required via targets.

Would something like this be a fit?

Capturing the sessionInfo() within targets is discussed in ropensci/targets#676.

Issue with session info

In one of the latest automatic runs of CMD check it looks like there's a failure in the call to sessioninfo::session_info(info = c("platform", "packages", "external")). Looking at it we might want to actually change this call to be sessioninfo::session_info(info = "all")) to include python as well as that could very well be used in programming. Putting this out there to get thoughts on this. @nicholas-masel wondering what your thoughts are to go about this as this was your update initially

Add stdout logging support

I see run_safetly_n_quietly() is logging warnings and errors, but could this capture stdout as well? If the concern is length or that this is not wanted, could it be an option to opt in and out of, or written last.

Replace `sapply()` with `map_chr()`

https://github.com/atorus-research/logrx/blob/7061f18888009757d319104c201ae2d571219765/R/axecute.R#L26

Just an observation - the use of sapply() is discourage within functions: http://adv-r.had.co.nz/Functionals.html:

sapply() is great for interactive use because it saves typing, but if you use it inside your functions you’ll get weird errors if you supply the wrong type of input.

Since logrx already has a dependency on purrr, you might as well use purrr::map_chr() here. But additionally, I'd suggest throwing in match.call() here to enforce that only the values for to_report = c("messages", "output", "result") can ONLY be one of those three values:

test_function <- function(param = c('one', 'two', 'three')) {
  param <- match.arg(param, several.ok=TRUE)
  param
}

> test_function('one')
[1] "one"
> test_function(c('one', 'two'))
[1] "one" "two"
> test_function('bad')
Error in match.arg(param, several.ok = TRUE) : 
  'arg' should be one ofone”, “two”, “three> test_function(1)
Error in match.arg(param, several.ok = TRUE) : 
  'arg' must be NULL or a character vector

Documentation: Best Practices Template

Optimizing your R Script to get the best log file from timber

  • Results only captures the last result - print statements are way to get more
  • Attach all libraries at the top of your scripts - this ensures all packages and functions are captured correctly
  • Use message() to print out custom messages to the log.

Add ability to save the log as an object

For checking utilities saving the log as an object to an output would be far more useful than just the text log, adding this option would help scripting around the checking of a log object after the program is run

Missing timber metadata in log file

I just installed the latest version of {timber} from the main branch using renv::install("atorus-research/timber"). The log file that got created during my initial testing is missing the timber metadata. In addition the formatting of the Warnings and errors (shouldn't it be Errors?) looks off...

--------------------------------------------------------------------------------
-                               timber Metadata                                -
--------------------------------------------------------------------------------
This log was generated using timber 
timber package version: 
timber license: 
timber build: 
timber link to repository: https://github.com/atorus-research/timber
--------------------------------------------------------------------------------
-                               User Information                               -
--------------------------------------------------------------------------------
User: neitmant
--------------------------------------------------------------------------------
-                             Session Information                              -
--------------------------------------------------------------------------------
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils    
[6] methods   base     

other attached packages:
[1] patchwork_1.1.1 ggplot2_3.3.2   stringr_1.4.0  
[4] dplyr_1.0.2     rice_2.0       

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5        pillar_1.4.6      compiler_4.0.3   
 [4] forcats_0.5.0     tools_4.0.3       getPass_0.2-2    
 [7] digest_0.6.27     jsonlite_1.7.1    memoise_1.1.0    
[10] lifecycle_0.2.0   tibble_3.0.4      gtable_0.3.0     
[13] pkgconfig_2.0.3   rlang_0.4.8       cli_2.1.0        
[16] rstudioapi_0.11   curl_4.3          haven_2.3.1      
[19] withr_2.3.0       httr_1.4.2        generics_0.1.0   
[22] vctrs_0.3.4       hms_0.5.3         grid_4.0.3       
[25] tidyselect_1.1.0  glue_1.4.2        R6_2.5.0         
[28] fansi_0.4.1       timber_0.0.0.9001 farver_2.0.3     
[31] purrr_0.3.4       readr_1.4.0       magrittr_1.5     
[34] scales_1.1.1      ellipsis_0.3.1    assertthat_0.2.1 
[37] colorspace_1.4-1  renv_0.13.2       labeling_0.4.2   
[40] stringi_1.5.3     munsell_0.5.0     crayon_1.3.4     
--------------------------------------------------------------------------------
-                               Masked Functions                               -
--------------------------------------------------------------------------------
function `title` from {package:graphics} by .GlobalEnv
function `table` from {package:base} by .GlobalEnv
function `enexpr` from {package:dplyr} by package:ggplot2
function `enexprs` from {package:dplyr} by package:ggplot2
function `enquo` from {package:dplyr} by package:ggplot2
function `enquos` from {package:dplyr} by package:ggplot2
function `ensym` from {package:dplyr} by package:ggplot2
function `ensyms` from {package:dplyr} by package:ggplot2
function `expr` from {package:dplyr} by package:ggplot2
function `quo` from {package:dplyr} by package:ggplot2
function `quo_name` from {package:dplyr} by package:ggplot2
function `quos` from {package:dplyr} by package:ggplot2
function `sym` from {package:dplyr} by package:ggplot2
function `syms` from {package:dplyr} by package:ggplot2
function `vars` from {package:dplyr} by package:ggplot2
function `Position` from {package:base} by package:ggplot2
function `%>%` from {package:dplyr} by package:stringr
function `filter` from {package:stats} by package:dplyr
function `lag` from {package:stats} by package:dplyr
function `intersect` from {package:base} by package:dplyr
function `setdiff` from {package:base} by package:dplyr
function `setequal` from {package:base} by package:dplyr
function `union` from {package:base} by package:dplyr
function `plot` from {package:base} by package:graphics
function `install.packages` from {package:utils} by renv:shims
function `remove.packages` from {package:utils} by renv:shims
function `update.packages` from {package:utils} by renv:shims
function `body<-` from {package:base} by package:methods
function `kronecker` from {package:base} by package:methods
--------------------------------------------------------------------------------
-                         Program Run Time Information                         -
--------------------------------------------------------------------------------
Start time: 2021-11-23 11:06:58 CET
End time: 2021-11-23 11:07:00 CET
Run time: 2 seconds
--------------------------------------------------------------------------------
-                             Errors and Warnings                              -
--------------------------------------------------------------------------------
errors:
	NULL
Warnings:
	
--------------------------------------------------------------------------------
-                               Log Output File                                -
--------------------------------------------------------------------------------
Log name: g_eortc_ql.log
Log path: /home/bceuser/neitmant/arrow

Feature Request: News.md file for Changelog

Feature Idea

Create a news.md file so it is displayed on packagdown site.

Relevant Input

news.md file

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

Documentation: Add Rscript examples

Please select a category the issue is focused on?

Other

Let us know where something needs a refresh or put your idea here!

  • Rscript -e
  • Rscript -e with redirect of everything and appends redirect to the bottom of the timber log

timberAddin() styles.css error

styles.css gets moved up a level, out of inst/ when installed, so the addin throws an error.

image

> timber:::timberAddin()
Warning in file(con, "r") :
  cannot open file 'inst/styles.css': No such file or directory
Error in file(con, "r") : cannot open the connection

Feature Request: utils-approved

Feature Idea

Add a utils-approved function to build and save the approved package and function tibble

Relevant Input

Named list of packages and functions.

Relevant Output

approved.rds which is a tibble with two columns (library, function) and one row per approved function.

Reproducible Example/Pseudo Code

No response

Program name missing in log file

One crucial thing I am missing in the log file is the name of the script being run, So far it seems the log only contains the name of the log file at the bottom but that does not necessarily have the same name as the script being axecuted.

Licenses of packages

In the vein of the approved packages - list out the approved licenses for packages that can be used and then have those appear in the log with section of unapproved packages using unapproved licenses.

Documentation: CRAN Instructions on README

Please select a category the issue is focused on?

User Guides

Let us know where something needs a refresh or put your idea here!

Now that we are on CRAN we need the common readme phrase of how to install form CRAN :).

Documentation: Guide for batch run file with template code

Please select a category the issue is focused on?

Other

Let us know where something needs a refresh or put your idea here!

Explanation of running multiple files in a batch.R file with template code a user could grab and drop into a file.

capture message, warnings, and (possibly?) errors in {timber} log

R's messaging facility allows users to generate their own, in program at different levels:

  • Informative notes using message()
  • Warnings using warning()
  • And forcefully stopping the program using stop(), which reads as an Error

It's not uncommon in clinical programming to use notes or warnings to program defensive data checks. For example, to check that the right number of classes of a variable exist, or that a particular dataset is empty/not empty. Ideally, this information can be kept in the {timber} log so that the logs could be parsed to easily identify if problems like these exist - especially if data are rerun routinely on live databases.

Neccessary Feature : please include last run/ran code in the log file

Hi All,

I am surprised that its not implemented yet. Its a must have component in clinical industry for audit purposes. Can you guys please update the package to include run/session ran code in the log file? For example, if I run the below code, then, the log file should contain the below code.

Code:
iris %>% pivot_longer(c(Sepal.Length, Petal.Length))

Perhaps , it can be achieved with base package sink() function.

Thanks.
Shiva.

Documentation: Logging with Rmd File

Please select a category the issue is focused on?

User Guides

Let us know where something needs a refresh or put your idea here!

Guide on working with Rmd files

Interactive session logging

First of all thank you for developing timber which seems to be the most promising tool for our purposes.
However, I miss one crucial functionality that would allow to create a log based on user input provided in an interactive session, instead of a pre-existing .R file.
I think such a feature would make the package a complete product. Do you plan to add such an option to the timber?

Thanks!
Bartek

Bug: Rival Package Name

What happened?

There is already a timber package on CRAN :(

Session Information

No response

Reproducible Example

No response

Session info not showing attached packages in a fresh R session

I noticed that when I restart my R session and use timber::axecute() to run a program the packages attached inside the script are not listed in the session info. When I run timber::axecute() a second time they show up as expected. Is sessionInfo() called before the script is sourced? That wouldn't make much sense to me...

First run after restarting R session

--------------------------------------------------------------------------------
-                               timber Metadata                                -
--------------------------------------------------------------------------------
This log was generated using timber 
timber package version: 
timber license: 
timber build: 
timber link to repository: https://github.com/atorus-research/timber
--------------------------------------------------------------------------------
-                               User Information                               -
--------------------------------------------------------------------------------
User: neitmant
--------------------------------------------------------------------------------
-                             Session Information                              -
--------------------------------------------------------------------------------
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3    magrittr_1.5      tools_4.0.3       stringi_1.5.3    
[5] timber_0.0.0.9001 stringr_1.4.0     rlang_0.4.8       renv_0.13.2      
[9] purrr_0.3.4      
--------------------------------------------------------------------------------
-                               Masked Functions                               -
--------------------------------------------------------------------------------
function `plot` from {package:base} by package:graphics
function `install.packages` from {package:utils} by renv:shims
function `remove.packages` from {package:utils} by renv:shims
function `update.packages` from {package:utils} by renv:shims
function `body<-` from {package:base} by package:methods
function `kronecker` from {package:base} by package:methods
--------------------------------------------------------------------------------
-                         Program Run Time Information                         -
--------------------------------------------------------------------------------
Start time: 2021-11-23 17:58:10 CET
End time: 2021-11-23 17:58:21 CET
Run time: 11 seconds
--------------------------------------------------------------------------------
-                             Errors and Warnings                              -
--------------------------------------------------------------------------------
errors:
	NULL
Warnings:
	
--------------------------------------------------------------------------------
-                               Log Output File                                -
--------------------------------------------------------------------------------
Log name: g_eortc_ql.log
Log path: /home/bceuser/neitmant/arrow

Second run in the same session

--------------------------------------------------------------------------------
-                               timber Metadata                                -
--------------------------------------------------------------------------------
This log was generated using timber 
timber package version: 
timber license: 
timber build: 
timber link to repository: https://github.com/atorus-research/timber
--------------------------------------------------------------------------------
-                               User Information                               -
--------------------------------------------------------------------------------
User: neitmant
--------------------------------------------------------------------------------
-                             Session Information                              -
--------------------------------------------------------------------------------
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] patchwork_1.1.1 ggplot2_3.3.2   stringr_1.4.0   dplyr_1.0.2    
[5] rice_2.0       

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5         RColorBrewer_1.1-2 pillar_1.4.6       compiler_4.0.3    
 [5] forcats_0.5.0      tools_4.0.3        getPass_0.2-2      digest_0.6.27     
 [9] jsonlite_1.7.1     memoise_1.1.0      lifecycle_0.2.0    tibble_3.0.4      
[13] gtable_0.3.0       pkgconfig_2.0.3    rlang_0.4.8        rstudioapi_0.11   
[17] curl_4.3           haven_2.3.1        withr_2.3.0        httr_1.4.2        
[21] generics_0.1.0     vctrs_0.3.4        hms_0.5.3          grid_4.0.3        
[25] tidyselect_1.1.0   glue_1.4.2         R6_2.5.0           farver_2.0.3      
[29] purrr_0.3.4        readr_1.4.0        timber_0.0.0.9001  magrittr_1.5      
[33] scales_1.1.1       ellipsis_0.3.1     assertthat_0.2.1   colorspace_1.4-1  
[37] renv_0.13.2        stringi_1.5.3      munsell_0.5.0      crayon_1.3.4      
--------------------------------------------------------------------------------
-                               Masked Functions                               -
--------------------------------------------------------------------------------
function `enexpr` from {package:dplyr} by package:ggplot2
function `enexprs` from {package:dplyr} by package:ggplot2
function `enquo` from {package:dplyr} by package:ggplot2
function `enquos` from {package:dplyr} by package:ggplot2
function `ensym` from {package:dplyr} by package:ggplot2
function `ensyms` from {package:dplyr} by package:ggplot2
function `expr` from {package:dplyr} by package:ggplot2
function `quo` from {package:dplyr} by package:ggplot2
function `quo_name` from {package:dplyr} by package:ggplot2
function `quos` from {package:dplyr} by package:ggplot2
function `sym` from {package:dplyr} by package:ggplot2
function `syms` from {package:dplyr} by package:ggplot2
function `vars` from {package:dplyr} by package:ggplot2
function `Position` from {package:base} by package:ggplot2
function `%>%` from {package:dplyr} by package:stringr
function `filter` from {package:stats} by package:dplyr
function `lag` from {package:stats} by package:dplyr
function `intersect` from {package:base} by package:dplyr
function `setdiff` from {package:base} by package:dplyr
function `setequal` from {package:base} by package:dplyr
function `union` from {package:base} by package:dplyr
function `plot` from {package:base} by package:graphics
function `install.packages` from {package:utils} by renv:shims
function `remove.packages` from {package:utils} by renv:shims
function `update.packages` from {package:utils} by renv:shims
function `body<-` from {package:base} by package:methods
function `kronecker` from {package:base} by package:methods
--------------------------------------------------------------------------------
-                         Program Run Time Information                         -
--------------------------------------------------------------------------------
Start time: 2021-11-23 17:58:25 CET
End time: 2021-11-23 17:58:28 CET
Run time: 3 seconds
--------------------------------------------------------------------------------
-                             Errors and Warnings                              -
--------------------------------------------------------------------------------
errors:
	NULL
Warnings:
	
--------------------------------------------------------------------------------
-                               Log Output File                                -
--------------------------------------------------------------------------------
Log name: g_eortc_ql.log
Log path: /home/bceuser/neitmant/arrow

Bug: gif too big

What happened?

gif was too big for CRAN submission, moving to be hosted on external repo and referenced

Session Information

No response

Reproducible Example

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.