bidsr

R package to parse BIDS files

https://github.com/dipterix/bidsr

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

R package to parse BIDS files

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Roadmap

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
library(data.table)
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```


# bidsr


[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/dipterix/bidsr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dipterix/bidsr/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/bidsr)](https://CRAN.R-project.org/package=bidsr)


Brain Imaging Data Structure (`BIDS`) is a standard for organizing neuroimaging and behavioral data (see https://bids.neuroimaging.io/index.html). 
Package `bidsr` aims at providing comprehensive tools to query and manipulate `BIDS` data files. 
This package is experimental, please check out the [Road-map](https://github.com/dipterix/bidsr/blob/main/Roadmap.md).

## Installation

You can install the development version of `bidsr` like so:

``` r
# install.packages("pak")
pak::pak("dipterix/bidsr")
```


## Example

This example demonstrates high-level tools to query a `BIDS` project. 
The code requires executing a built-in command to download [`BIDS` example data-sets](https://github.com/bids-standard/bids-examples). 
Please copy-paste-run the following R commands:

```{r, results='hide'}
library(bidsr)
example_root <- download_bids_examples()
```

Let's inspect the project `ieeg_motorMiller2007` from the official `BIDS` example repository:

```{r}
## Path to `ieeg_motorMiller2007`
project_path <- file.path(example_root, "ieeg_motorMiller2007")

## BIDS project instance
project <- bids_project(path = project_path)

## The top-level `dataset_description.json` and `participants.tsv` 
## can be parsed via
description <- project$get_bids_dataset_description()
participants <- project$get_bids_participants()


## To obtain the values, use `$` operator (same as `.` in `Python`):
description$BIDSVersion

## Given a project path or instance, a `BIDS` subject can be instantiated via 
## the following two ways. 

# Method 1
subject <- bids_subject(project = project, subject_code = "sub-bp")

# Method 2
subject <- bids_subject(project = project_path, subject_code = "bp")

## The official `BIDS` and its extensions support various of data types, 
## such as `anat`, `func`, `meg`, `eeg`, `ieeg`, etc. 
## use `query_modality` method to query the files
ieeg_table <- query_bids(subject, "ieeg")
print(ieeg_table)


## The first column contains a list of file instances. Here's an 
## example to read the `ACPC` electrode coordinates:
subset_result <- subset(ieeg_table, space == "ACPC" & suffix == "electrodes")
print(subset_result)

# Get parsed 'BIDS' file object
path_parsed <- subset_result$parsed[[1]]
print(path_parsed)

electrode_path <- file.path(project, path_parsed)
as_bids_tabular(electrode_path)


## `BIDS` entity

## Object `path_parsed` is a file entity class, with the entities parsed
class(path_parsed)

path_parsed$get_bids_entity("space")

## List all available entities
path_parsed$entities

## If supported by schema, the `BIDS` entity rules for the 
## file can be queried via
path_parsed$get_bids_entity_rules()
```



```{r, echo=FALSE, results='hide'}
cache_root <- tools::R_user_dir(package = "bidsr", which = "cache")
if(file.exists(cache_root)) {
  unlink(cache_root, recursive = TRUE)
}
```

Owner

  • Name: Dipterix Wang
  • Login: dipterix
  • Kind: user
  • Company: Perelman School of Medicine, University of Pennsylvania

When you are eating pineapple, pineapple is eating you as well.

GitHub Events

Total
  • Watch event: 1
  • Push event: 39
  • Create event: 3
Last Year
  • Watch event: 1
  • Push event: 39
  • Create event: 3

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 203 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: bidsr

A Brain Imaging Data Structure ('BIDS') Parser

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 203 Last month
Rankings
Dependent packages count: 26.9%
Forks count: 29.0%
Dependent repos count: 33.1%
Stargazers count: 37.2%
Average: 42.6%
Downloads: 86.9%
Maintainers (1)
Last synced: 10 months ago