r4projects is an R package for organizing bioinformatics projects and handling common research-support tasks around publication tracking, profile scraping, package metadata lookup, and lightweight visualization.
The package is designed for day-to-day academic workflows rather than for a single analysis pipeline. It combines project scaffolding utilities with helper functions that pull information from Google Scholar, PubMed, GitHub, GitLab, and Gitee.
Install the released source from GitHub:
remotes::install_github("jaspershen-lab/r4projects")Load the package:
library(r4projects)r4projects currently covers five practical areas.
The package can create a standard directory layout for an R-based bioinformatics project.
create_project_organization()
get_project_wd()
openwd()
ignore_large_files()Typical folders created by create_project_organization() include:
1_code2_data3_data_analysis4_manuscript5_summary
This is useful when you want a repeatable project structure for exploratory analysis, manuscript preparation, and summary reporting.
The package can cache and parse Google Scholar pages to retrieve profile and publication information.
profile <- request_profile(user_id = "3TK9yz8AAAAJ")
citations <- request_citation(user_id = "3TK9yz8AAAAJ")
pubs <- request_publications(user_id = "3TK9yz8AAAAJ")
paper <- request_publication_info(
user_id = "3TK9yz8AAAAJ",
pub_id = "0EnyYjriUFMC"
)Related functions:
craw_or_load_page()craw_or_load_publication()request_profile()request_citation()draw_citation_history()request_coauthors()request_publications()request_publication_info()
The package includes helpers for linking Google Scholar entries to PubMed and extracting PubMed metadata.
pmid <- convert_gs_pub_id2pmid(
gs_user_id = "3TK9yz8AAAAJ",
gs_pub_id = "0EnyYjriUFMC"
)
pubmed_info <- request_pubmed_publication_info(pmid = pmid)These functions are useful when you want to recover author affiliations, identifiers, abstracts, or other structured paper metadata.
The package can collect simple GitHub profile information and package metadata from repository hosting platforms.
gh_profile <- require_github_profile("jaspershen")
gh_activity <- require_github_contribution_activity("jaspershen")
pkg_info <- require_package_info("jaspershen/laggedcor", from = "github")There is also a convenience installer for packages hosted on GitHub, GitLab, or Gitee:
install_fastgit("jaspershen/laggedcor", from = "github")The package includes plotting helpers and functions used in personal or lab website workflows.
draw_citation_history(user_id = "3TK9yz8AAAAJ")
generate_collaborator_map(gs_user_id = "3TK9yz8AAAAJ")Additional helpers include:
color_palette()theme_shenlab()update_packages_tidymass_org()
A minimal workflow for a new analysis project might look like this:
library(r4projects)
create_project_organization()
setwd(get_project_wd())
pubs <- request_publications(user_id = "3TK9yz8AAAAJ")
plot <- draw_citation_history(user_id = "3TK9yz8AAAAJ")Main exported functions in the package:
color_palette()convert_gs_pub_id2pmid()craw_or_load_page()craw_or_load_publication()create_project_organization()draw_citation_history()fuzzy_match()generate_collaborator_map()get_os()get_project_wd()ignore_large_files()install_fastgit()openwd()r4projects_logo()r4projects_packages()request_citation()request_coauthors()request_profile()request_publication_info()request_publications()request_pubmed_publication_info()require_github_contribution_activity()require_github_profile()require_package_info()show_progresser()theme_shenlab()update_packages_tidymass_org()
- Several functions rely on live web pages and may break if upstream page structures change.
- Google Scholar scraping should be used conservatively because aggressive requests may be throttled.
- Some functions are tailored to the author's existing workflow and may be most useful as lightweight utilities rather than general APIs.
The pkgdown site for the package is intended to be published at:
https://jaspershen-lab.github.io/r4projects/
To rebuild the site locally:
pkgdown::build_site()Xiaotao Shen
Email: xiaotao.shen@outlook.com