All Projects → ropensci → Osfr

ropensci / Osfr

Licence: other
R interface to the Open Science Framework (OSF)

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Osfr

Itkexamples
Cookbook examples for the Insight Toolkit documented with Sphinx
Stars: ✭ 38 (-67.52%)
Mutual labels:  reproducible-research, open-science
openscience
Empirical Software Engineering journal (EMSE) open science and reproducible research initiative
Stars: ✭ 28 (-76.07%)
Mutual labels:  reproducible-research, open-science
Fma
FMA: A Dataset For Music Analysis
Stars: ✭ 1,391 (+1088.89%)
Mutual labels:  reproducible-research, open-science
Otb
Github mirror of https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb
Stars: ✭ 265 (+126.5%)
Mutual labels:  reproducible-research, open-science
Itkwidgets
Interactive Jupyter widgets to visualize images, point sets, and meshes in 2D and 3D
Stars: ✭ 338 (+188.89%)
Mutual labels:  reproducible-research, open-science
Awesome Open Science Software
awesome open list of pointers about open science for software and computational science
Stars: ✭ 87 (-25.64%)
Mutual labels:  reproducible-research, open-science
ITKSphinxExamples
Cookbook examples for the Insight Toolkit documented with Sphinx
Stars: ✭ 48 (-58.97%)
Mutual labels:  reproducible-research, open-science
Itk
Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
Stars: ✭ 801 (+584.62%)
Mutual labels:  reproducible-research, open-science
Openml R
R package to interface with OpenML
Stars: ✭ 81 (-30.77%)
Mutual labels:  reproducible-research, open-science
Porcupine
Express parametrable, composable and portable data pipelines
Stars: ✭ 70 (-40.17%)
Mutual labels:  reproducible-research
Drake
An R-focused pipeline toolkit for reproducibility and high-performance computing
Stars: ✭ 1,301 (+1011.97%)
Mutual labels:  reproducible-research
Nozzle
Nozzle is a report generation toolkit for data analysis pipelines implemented in R.
Stars: ✭ 59 (-49.57%)
Mutual labels:  reproducible-research
Sartools
Statistical Analysis of RNA-Seq Tools
Stars: ✭ 80 (-31.62%)
Mutual labels:  reproducible-research
Dcmjs
dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).
Stars: ✭ 92 (-21.37%)
Mutual labels:  open-science
Module 5 Open Research Software And Open Source
Module 5: Open Research Software and Open Source
Stars: ✭ 62 (-47.01%)
Mutual labels:  open-science
Open Science Resources
A publicly-editable collection of open science resources, including tools, datasets, meta-resources, etc.
Stars: ✭ 58 (-50.43%)
Mutual labels:  open-science
Drake Examples
Example workflows for the drake R package
Stars: ✭ 57 (-51.28%)
Mutual labels:  reproducible-research
Everware
Everware is about re-useable science, it allows people to jump right in to your research code.
Stars: ✭ 112 (-4.27%)
Mutual labels:  reproducible-research
Nextflow
A DSL for data-driven computational pipelines
Stars: ✭ 1,337 (+1042.74%)
Mutual labels:  reproducible-research
Helm Charts
Kubernetes Helm Charts for the Center for Open Science
Stars: ✭ 88 (-24.79%)
Mutual labels:  open-science

osfr

CRAN status Build Status AppVeyor build status Coverage status DOI

Overview

osfr provides a suite of functions for interacting with the Open Science Framework (OSF).

What is OSF?

OSF is a free and open source project management repository designed to support researchers across their entire project lifecycle. The service includes unlimited cloud storage and file version history, providing a centralized location for all your research materials that can be kept private, shared with select collaborators, or made publicly available with citable DOIs.

Installation

You can install the current release of osfr from CRAN (recommended):

install.packages("osfr")

Or the development version from GitHub with the remotes package:

# install.packages("remotes")
remotes::install_github("ropensci/osfr")

Usage Examples

Note: You need to setup an OSF personal access token (PAT) to use osfr to manage projects or upload files.

Accessing Open Research Materials

Many researchers use OSF to archive and share their work. You can use osfr to explore publicly accessible projects and download the associated files—all you need to get started is the project’s URL or GUID (global unique identifier).

Every user, project, component, and file on OSF is assigned a GUID that is embedded in the corresponding entity’s URL. For example, you can access the main OSF project for the Cancer Reproducibility Project at https://osf.io/e81xl/. The GUID for this project is e81xl.

We can then use osfr to retrieve this project and load it into R by providing the GUID:

library(osfr)

cr_project <- osf_retrieve_node("e81xl")
cr_project
#> # A tibble: 1 x 3
#>   name                                    id    meta            
#>   <chr>                                   <chr> <list>          
#> 1 Reproducibility Project: Cancer Biology e81xl <named list [3]>

This returns an osf_tbl object with a single row representing the retrieved project. Let’s list the files that have been uploaded to this project.

osf_ls_files(cr_project)
#> # A tibble: 4 x 3
#>   name                                     id                     meta          
#>   <chr>                                    <chr>                  <list>        
#> 1 Adjustment of 50 studies to 37 studies.… 565602398c5e4a3877d72… <named list […
#> 2 papers_and_keywords.xlsx                 553e671b8c5e4a219919e… <named list […
#> 3 Full_dataset_of_papers_formatted.xls     553e671b8c5e4a219919e… <named list […
#> 4 METHOD_to_select_papers.txt              553e671b8c5e4a219919e… <named list […

This returns another osf_tbl with 1 row for each of the files and directories in the project. We can examine any of these files directly on OSF with osf_open(), which opens the corresponding file’s view in your default browser.

This project contains 2 components: Replication Studies and Data collection and publishing guidelines. We can list these components with osfr using osf_ls_nodes().

osf_ls_nodes(cr_project)
#> # A tibble: 2 x 3
#>   name                                      id    meta            
#>   <chr>                                     <chr> <list>          
#> 1 Replication Studies                       p7ayb <named list [3]>
#> 2 Data collection and publishing guidelines a5imq <named list [3]>

osfr is compatible with the pipe operator and dplyr, providing a powerful set of tools for working with osf_tbls. Here, we’re listing the sub-components nested within the Replication Studies component, filtering for a specific study (Study 19) and then listing the files uploaded to that study’s component.

library(dplyr)

cr_project %>%
  osf_ls_nodes() %>%
  filter(name == "Replication Studies") %>%
  osf_ls_nodes(pattern = "Study 19") %>%
  osf_ls_files()
#> # A tibble: 6 x 3
#>   name                                    id                     meta           
#>   <chr>                                   <chr>                  <list>         
#> 1 Replication_Study_19.docx               57c9e8ed594d9001e7a24… <named list [3…
#> 2 Replication_Study_19.Rmd                578e2b23594d9001f4816… <named list [3…
#> 3 Replication_Study_19_track_changes.docx 581a27b76c613b0223322… <named list [3…
#> 4 Replication_Study_19_track_changes_2.d… 58714d46594d9001f801f… <named list [3…
#> 5 Response_letter_Replication_Study_19.d… 58755747b83f6901ff066… <named list [3…
#> 6 Study_19_Correction_Letter.docx         5a56569125719b000ff28… <named list [3…

We could continue this pattern of exploration and even download local copies of project files using osf_download(). Or, if you come across a publication that directly references a file’s OSF URL, you could quickly download it to your project directory by providing the URL or simply the GUID:

osf_retrieve_file("https://osf.io/btgx3/") %>%
  osf_download()
#> # A tibble: 1 x 4
#>   name                id                    local_path            meta          
#>   <chr>               <chr>                 <chr>                 <list>        
#> 1 Study_19_Figure_1.… 5751d71d9ad5a1020793… ./Study_19_Figure_1.… <named list […

Managing Projects

You can use osfr to create projects, add sub-components or directories, and upload files. See Getting Started to learn more about building projects with osfr, but here is a quick example in which we:

  1. Create a new project called Motor Trend Car Road Tests
  2. Create a sub-component called Car Data
  3. Create a directory named rawdata
  4. Upload a file (mtcars.csv) to the new directory
  5. Open the uploaded file on OSF
# create an external data file
write.csv(mtcars, "mtcars.csv")

osf_create_project(title = "Motor Trend Car Road Tests") %>%
  osf_create_component("Car Data") %>%
  osf_mkdir("rawdata") %>%
  osf_upload("mtcars.csv") %>%
  osf_open()

Screenshot of the uploaded file on OSF

Details on osf_tbls

There are 3 main types of OSF entities that osfr can work with:

  1. nodes: both projects and components (i.e., sub-projects) are referred to as nodes
  2. files: this includes both files and folders stored on OSF
  3. users: individuals with OSF accounts

osfr represents these entities within osf_tbls—specialized data frames built on the tibble class that provide useful information about the entities like their name and unique id for users, and API data in the meta column that’s necessary for osfr’s internal functions. Otherwise, they’re just data.frames and can be manipulated using standard functions from base R or dplyr.

Acknowledgments

OSF is developed by the Center for Open Science in Charlottesville, VA.

The original version of osfr was developed by Chris Chartgerink and further developed by Brian Richards and Ryan Hafen. The current version was developed by Aaron Wolen and is heavily inspired by Jennifer Bryan and Lucy D’Agostino McGowan’s excellent googledrive package. Seriously, we borrowed a lot of great ideas from them. Other important resources include http testing by Scott Chamberlain and R Packages by Hadley Wickham. Development was also greatly facilitated by OSF’s excellent API documentation.

Big thanks to Rusty Speidel for designing our logo and Tim Errington for his feedback during development.

Contributing

Check out the Contributing Guidelines to get started with osfr development and note that by contributing to this project, you agree to abide by the terms outlined in the Contributor Code of Conduct.

ropensci_footer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].