Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 179 lines · 6.7 KB · other
- #' @title circa_single
- #' @name circa_single
- #'
- #' @description \code{circa_single} performs an analysis on a single rhythmic dataset. It estimates the mesor, amplitude and phase of the data provided.
- #'
- #' @param x data.frame. This is the data.frame which contains the rhythmic data in a tidy format.
- #' @param col_time The name of the column within the data.frame, x, which contains time in hours at which the data were collected.
- #' @param col_outcome The name of the column within the data.frame, x, which contains outcome measure of interest.
- #' @param period The period of the rhythm. For circadian rhythms, leave this as the default value, 24.
- #' @param alpha_threshold The level of alpha for which the presence of rhythmicity is considered. Default is 0.05.
- #' @param timeout_n The upper limit for the model fitting attempts. Default is 10,000.
- #' @param return_figure Whether or not to return a ggplot graph of the rhythm and cosine model.
- #' @param control \code{list}. Used to control the parameterization of the model.
- #' @param weights An optional numeric vector of (fixed) weights. When present, the objective function is weighted least squares.
- #' @param suppress_all Logical. Set to \code{TRUE} to avoid seeing errors or messages during model fitting procedure. Default is \code{FALSE}.
- #'
- #' @return list
- #' @export
- #'
- #' @examples
- #' df <- make_data()
- #' df <- df[df$group == "g1", ]
- #' out <- circa_single(x = df, col_time = "time", col_outcome = "measure")
- #' out
- #'
- #' # with sample weights (arbitrary weights for demonstration)
- #' sw <- runif(n = nrow(df))
- #' out2 <- circa_single(
- #' x = df,
- #' col_time = "time",
- #' col_outcome = "measure",
- #' weights = sw,
- #' suppress_all = TRUE
- #' )
- #' out2
- #'
- circa_single <- function(x,
- col_time,
- col_outcome,
- period = 24,
- alpha_threshold = 0.05,
- timeout_n = 10000,
- return_figure = TRUE,
- control = list(),
- weights = NULL,
- suppress_all = FALSE) {
- controlVals <- circa_single_control()
- controlVals[names(control)] <- control
- if (controlVals$period_param) {
- controlVals$main_params <- c(controlVals$main_params, "tau")
- }
- if ("tau" %in% controlVals$main_params) {
- controlVals$period_param <- TRUE
- }
- x <- x[c(col_time, col_outcome)]
- colnames(x) <- c("time", "measure")
- if (!class(x$time) %in% c("numeric", "integer")) {
- stop(paste("The time variable which you gave was a '",
- class(x$time), "' \nThis function expects time to be given as hours and be of class 'integer' or 'numeric'.",
- "\nPlease convert the time variable in your dataframe to be of one of these classes",
- sep = ""
- ))
- }
- if (!class(x$measure) %in% c("numeric", "integer")) {
- stop(paste("The measure variable which you gave was a '",
- class(x$measure), "' \nThis function expects measure to be number and be of class 'integer' or 'numeric'.",
- "\nPlease convert the measure variable in your dataframe to be of one of these classes",
- sep = ""
- ))
- }
- if (!class(period) %in% c("numeric", "integer") & !controlVals$period_param) {
- stop(paste0(
- "The period argument must be a number representing the period of the rhythm in hours\n",
- "If you would like the period to be estimated as part of the model, use:\ncontrol=list(period_param=TRUE)"
- ))
- }
- if (controlVals$period_param & !is.na(period)) {
- message(paste0("control$period_param is TRUE\n'period=", period, "' is being ignored.\nSet 'period=NA' to avoid this message"))
- }
- x$time_r <- x$time * 2 * pi
- if (!controlVals$period_param) {
- x$period <- period
- } else {
- if (is.null(controlVals$period_min) | is.null(controlVals$period_min)) {
- message(paste0(
- "If you want the model to estimate the period using a parameter,",
- "you may get faster convergence if you provide an approximate range using 'period_min' and 'period_max' in control()",
- "\nCurrently assuming period is between: period_min=", controlVals$period_min,
- "and period_max=", controlVals$period_max
- ))
- }
- }
- if (!is.null(weights)) {
- check_weights(x, weights)
- x$weights <- weights
- } else {
- x$weights <- rep(1, nrow(x))
- }
- success <- FALSE
- n <- 0
- form <- create_formula(main_params = controlVals$main_params, decay_params = controlVals$decay_params)$formula
- while (!success) {
- fit.nls <- try(
- {
- stats::nls(
- formula = form,
- data = x,
- start = start_list(outcome = x$measure, controlVals = controlVals),
- weights = weights
- )
- },
- silent = suppress_all
- )
- if (inherits(fit.nls, "try-error")) {
- n <- n + 1
- } else {
- nls_coefs <- extract_model_coefs(fit.nls)
- V <- nls_coefs[, "estimate"]
- success <- assess_model_estimates(param_estimates = V, controlVals = controlVals)
- n <- n + 1
- }
- if (n >= timeout_n) {
- stop("Failed to converge data prior to timeout. \nYou may try to increase the allowed attempts before timeout by increasing the value of the 'timeout_n' argument or setting a new seed before this function.\nIf you have repeated difficulties, please contact me (via github) or Oliver Rawashdeh (contact details in manuscript).")
- }
- }
- data_rhythmic <- nls_coefs["alpha", "p_value"] < alpha_threshold
- if (!controlVals$period_param) {
- V["tau"] <- period
- }
- eq_expression <- create_formula(main_params = controlVals$main_params, decay_params = controlVals$decay_params)$f_equation
- eval(parse(text = eq_expression))
- if (return_figure) {
- p <- ggplot2::ggplot(x, ggplot2::aes(time, measure)) +
- ggplot2::geom_point() +
- ggplot2::xlim(
- min(floor(x$time / period) * period),
- max(ceiling(x$time / period) * period)
- )
- if (data_rhythmic) {
- fig_out <- p +
- ggplot2::stat_function(fun = eq, linewidth = 1) +
- ggplot2::labs(subtitle = "Data is rhythmic", x = "time (hours)")
- } else {
- fig_out <- p +
- ggplot2::labs(subtitle = "Data is arrhythmic", x = "time (hours)")
- }
- }
- results_summary <-
- circa_summary(model = fit.nls, period = period, control = controlVals)
- if (return_figure) {
- return(list(fit = fit.nls, summary = results_summary, plot = fig_out))
- } else {
- return(list(fit = fit.nls, summary = results_summary))
- }
- }
- circa_single_control <- function(period_param = F, period_min = 20, period_max = 28,
- main_params = c("k", "alpha", "phi"), decay_params = c()) {
- list(
- period_param = period_param, period_min = period_min, period_max = period_max,
- main_params = main_params, decay_params = decay_params
- )
- }
circa_single.R at commit 5df1144, under other · at the source
Overview
- Division of Trauma Surgery, Emergency Surgery & Surgical Critical, Tongji Trauma Center, Tongji Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430030, China
- Division of Endocrinology, Tongji Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430030, China
- Department of Rheumatology and Immunology, Tongji Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430030, China
- Department of Neurology, The First Affiliated Hospital of Shihezi University, Shihezi, Xinjiang, 832008, China
- Department of Emergency, Union Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430022, China
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above.
RWParsons/circacompare
5df1144f5b5127893438ec0fc42e72cc3ac75ec1, 9 January 2024Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
15 files
- R/
circa_single.R , R, 179 lines - R/
circa_single_mixed.R , R, 229 lines - R/
circacompare.R , R, 237 lines - R/
circacompare_mixed.R , R, 306 lines - R/
make_data.R , R, 57 lines - R/
utils.R , R, 472 lines - tests/
testthat.R , R, 4 lines - tests/
testthat/ , R, 141 linestest-circa_single.R - tests/
testthat/ , R, 114 linestest-circa_single_mixed. R - tests/
testthat/ , R, 97 linestest-circacompare.R - tests/
testthat/ , R, 127 linestest-circacompare_mixed. R - vignettes/
circacompare.Rmd , R, 308 lines - LICENSE, License, 2 lines
- LICENSE.md, License, 21 lines
- README.md, Text, 68 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 12 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it says that the data are available on request
Read it in the paper: doi.org/10.1016/j.bbih.2026.101264.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Authors: added Xinghua Liu (0000-0001-8285-8534); removed Xinghua Liu
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 7 authors, 6 keywords, 1 funder, 24 references.
Cite
This paper
Gong, S., Chen, Y., Su, L., Yao, E., Li, Z., Liu, X., & Li, S. (2026). Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency. Brain, behavior, & immunity - health, 54, 101264. https://
BibTeX
@article{gong2026microgl
author = {Gong, Song and Chen, Yuxue and Su, Lihan and Yao, Ensheng and Li, Zhanfei and Liu, Xinghua and Li, Shi},
title = {{Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency}},
journal = {Brain, behavior, \& immunity - health},
year = {2026},
month = may,
volume = {54},
pages = {101264},
publisher = {Elsevier},
issn = {2666-3546},
doi = {10.1016/
url = {https://
pmid = {42210978},
pmcid = {PMC13214300}
}
RIS
TY - JOUR
AU - Gong, Song
AU - Chen, Yuxue
AU - Su, Lihan
AU - Yao, Ensheng
AU - Li, Zhanfei
AU - Liu, Xinghua
AU - Li, Shi
TI - Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency
T2 - Brain, behavior, & immunity - health
J2 - Brain Behav Immun Health
PY - 2026
DA - 2026/
VL - 54
SP - 101264
SN - 2666-3546
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency",
"container-title": "Brain, behavior, & immunity - health",
"author": [
{
"family": "Gong",
"given": "Song"
},
{
"family": "Chen",
"given": "Yuxue"
},
{
"family": "Su",
"given": "Lihan"
},
{
"family": "Yao",
"given": "Ensheng"
},
{
"family": "Li",
"given": "Zhanfei"
},
{
"family": "Liu",
"given": "Xinghua"
},
{
"family": "Li",
"given": "Shi"
}
],
"container-title-short":
"volume": "54",
"page": "101264",
"DOI": "10.1016/
"PMID": "42210978",
"PMCID": "PMC13214300",
"ISSN": "2666-3546",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
20
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1126/sciadv.adz6517 [code]
- Corticosterone-linked microglial activity underpins sexually dimorphic neuroplasticity after ketamine anesthesia.Journal: Science advancesIn common: ggplot2, mouse, cellular / molecular, 3 references
- [2] doi:10.1186/s12974-026-03841-z
- Loss of astrocytic Bmal1 promotes blood-brain barrier disruption and synaptic dysfunction during systemic inflammation.Journal: Journal of neuroinflammationIn common: mouse, cellular / molecular, 2 references
- [3] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: nlme, ggplot2, mouse, cellular / molecular
- [4] doi:10.1093/brain/awag080 [code]
- Early glymphatic failure in AppNL-F knock-in mice is linked to parenchymal border macrophages loss.Journal: Brain : a journal of neurologyIn common: nlme, ggplot2, mouse, cellular / molecular
- [5] doi:10.1261/rna.080954.126 [code]
- Neuronal subtype-specific ribosomal protein mRNA expression.Journal: RNA (New York, N.Y.)In common: nlme, ggplot2, mouse, cellular / molecular
- [6] doi:10.1016/j.celrep.2026.117298 [code]
- Midbrain endocannabinoids actuate dopamine-based action selection.Journal: Cell reportsIn common: nlme, ggplot2, mouse, cellular / molecular
- [7] doi:10.1186/s12974-026-03739-w [code]
- Sex specific effects of adoptive Tregs transfer on the brain and periphery in maternal immune activation offspring rescuing immune dysregulation.Journal: Journal of neuroinflammationIn common: nlme, ggplot2, mouse, cellular / molecular
- [8] doi:10.1093/hmg/ddag024 [code]
- A microbiome quantitative trait locus in SLC39A8 modulates disease severity in synucleinopathy-induced models of Parkinson's disease.Journal: Human molecular geneticsIn common: nlme, ggplot2, mouse, cellular / molecular
- [9] doi:10.1073/pnas.2527236123
- Cellular circadian period and its deviation associate with Alzheimer's pathology and brain aging in cognitively impaired older adults.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: cellular / molecular, 2 references
- [10] doi:10.1038/s41467-026-76132-z [code]
- ATP13A4 gates extracellular polyamine levels to control excitatory synaptogenesis.Journal: Nature communicationsIn common: nlme, ggplot2, mouse
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 12 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:d97264e421ea315f…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
