https://github.com/bioconductor/biocbaseutils
Science Score: 36.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
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Basic Info
- Host: GitHub
- Owner: Bioconductor
- Language: R
- Default Branch: devel
- Homepage: https://bioconductor.org/packages/BiocBaseUtils
- Size: 54.7 KB
Statistics
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
BiocBaseUtils
The BiocBaseUtils package provides a suite of helper functions
designed to help developers. Currently, it covers three topics often
encountered during the development process.
- Assertions - Type checks for logical, character, and numeric inputs
- Slot replacement - Replacing the value of object slots
-
showmethod - Limiting the output of internal components of a class
Installation
Install the package directly from Bioconductor:
r
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("BiocBaseUtils")
Load Package
r
library(BiocBaseUtils)
Assertions
We provide a number of functions that helps the developer establish the
type of class of a particular object. These include integer,
numeric, character, and logical; types often used in R /
Bioconductor.
Logical
``` r isTRUEorFALSE(TRUE)
> [1] TRUE
isTRUEorFALSE(FALSE)
> [1] TRUE
isTRUEorFALSE(NA, na.ok = TRUE)
> [1] TRUE
```
Character
``` r isScalarCharacter(LETTERS)
> [1] FALSE
isScalarCharacter("L")
> [1] TRUE
isCharacter(LETTERS)
> [1] TRUE
isCharacter(NAcharacter, na.ok = TRUE)
> [1] TRUE
isZeroOneCharacter("")
> [1] FALSE
isZeroOneCharacter("", zchar = TRUE)
> [1] TRUE
```
Numeric
``` r isScalarInteger(1L)
> [1] TRUE
isScalarInteger(1)
> [1] FALSE
isScalarNumber(1)
> [1] TRUE
isScalarNumber(1:2)
> [1] FALSE
```
Slot replacement
This function is often used in packages that establish formal S4
classes. When updating the value of a slot, one often uses the
setSlots function.
``` r setClass("A", representation = representation(slot1 = "numeric")) aclass <- new("A", slot1 = 1:10) aclass
> An object of class "A"
> Slot "slot1":
> [1] 1 2 3 4 5 6 7 8 9 10
```
Now we use the setSlots function to update the values in the object.
``` r aclass <- setSlots(aclass, slot1 = 11:20) aclass
> An object of class "A"
> Slot "slot1":
> [1] 11 12 13 14 15 16 17 18 19 20
```
Note that setSlots provides the same functionality as
BiocGenerics:::replaceSlots but is more consistent with Bioconductor
the setter and getter language.
show method
The selectSome function allows the developer to display a limited
amount of information from a developed class. Note that the use of the
@ here is due to the minimal implementation in the examples provided.
The developer should always provide an interface to access the internal
components of the class via an ‘accessor’ function.
``` r setMethod("show", signature = "A", function(object) { s1info <- getElement(object, "slot1") cat("A sequence:", selectSome(s1info)) }) aclass
> A sequence: 11 12 ... 19 20
```
Contributing
BiocBaseUtils is a work in progress and we welcome contributions.
There are quite a few often-used utility functions that are yet to be
included in the package. We would like to keep the dependencies in this
package minimal; therefore, contributions should mostly use base R.
Session Info
``` r sessionInfo()
> R version 4.2.1 (2022-06-23)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 20.04.4 LTS
>
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
>
> locale:
> [1] LCCTYPE=C.UTF-8 LCNUMERIC=C LC_TIME=C.UTF-8
> [4] LCCOLLATE=C.UTF-8 LCMONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
> [7] LCPAPER=C.UTF-8 LCNAME=C LC_ADDRESS=C
> [10] LCTELEPHONE=C LCMEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices datasets utils methods base
>
> other attached packages:
> [1] BiocBaseUtils_0.99.10
>
> loaded via a namespace (and not attached):
> [1] compiler4.2.1 magrittr2.0.3 fastmap1.1.0 htmltools0.5.3
> [5] tools4.2.1 yaml2.3.5 codetools0.2-18 stringi1.7.8
> [9] rmarkdown2.15 knitr1.39 stringr1.4.0 xfun0.32
> [13] digest0.6.29 rlang1.0.4 renv0.15.5 evaluate0.16
```
Please report minimally reproducible bugs at our github issue page.
Owner
- Name: Bioconductor
- Login: Bioconductor
- Kind: organization
- Website: https://bioconductor.org
- Repositories: 156
- Profile: https://github.com/Bioconductor
Software for the analysis and comprehension of high-throughput genomic data
GitHub Events
Total
- Member event: 1
- Push event: 2
- Create event: 2
Last Year
- Member event: 1
- Push event: 2
- Create event: 2
Committers
Last synced: over 2 years ago
Top Committers
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 2
- Total pull requests: 0
- Average time to close issues: 1 day
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 4.5
- 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
- LiNk-NY (1)
- hpages (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- R >= 4.2.0 depends
- methods * imports
- utils * imports
- BiocStyle * suggests
- knitr * suggests
- rmarkdown * suggests
- tinytest * suggests
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-renv v1 composite