Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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: 2 checks, the latest on 31 October 2026: the link answers
- 31 October 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.1186/s12974-023-02727-8
- Myeloid deficiency of the intrinsic clock protein BMAL1 accelerates cognitive aging by disrupting microglial synaptic pruning.Journal: Journal of neuroinflammationIn common: mouse, cellular / molecular, 6 references
- [2] doi:10.1002/iub.2903 [code]
- Microglia synchronizes with the circadian rhythm of the glymphatic system and modulates glymphatic system function.Journal: IUBMB lifeIn common: nlme, ggplot2, mouse, cellular / molecular, 3 references
- [3] doi:10.1186/s12964-025-02420-8
- BMAL1 modulation alleviates inflammatory responses in monocytes by targeting the Fis1-mediated mitochondrial unfolded protein response in high-altitude hypoxia.Journal: Cell communication and signaling : CCSIn common: mouse, cellular / molecular, 4 references
- [4] 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
- [5] doi:10.1038/s41598-021-04079-w
- Cortical diurnal rhythms remain intact with microglial depletion.Journal: Scientific reportsIn common: mouse, cellular / molecular, 3 references
- [6] doi:10.1038/s41593-023-01548-5 [code]
- Microglia regulate sleep through calcium-dependent modulation of norepinephrine transmission.Journal: Nature neuroscienceIn common: mouse, cellular / molecular, 3 references
- [7] doi:10.1111/acel.70396
- Broad Epigenetic Shifts in the Aging Drosophila Retina Contribute to Its Altered Diurnal Rhythmic Transcriptome.Journal: Aging cellIn common: cellular / molecular, 3 references
- [8] doi:10.1038/s41398-023-02614-z [code]
- Melatonin alleviates depression-like behaviors and cognitive dysfunction in mice by regulating the circadian rhythm of AQP4 polarization.Journal: Translational psychiatryIn common: nlme, ggplot2, mouse, cellular / molecular, 1 reference
- [9] doi:10.1016/j.isci.2025.113605 [code]
- PROTECT: Protein circadian time prediction using unsupervised learning.Journal: iScienceIn common: nlme, ggplot2, cellular / molecular, 1 reference
- [10] doi:10.1084/jem.20200895 [code]
- Gut microbiota-driven brain Aβ amyloidosis in mice requires microglia.Journal: The Journal of experimental medicineIn common: nlme, ggplot2, mouse, cellular / molecular, 1 reference
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:f0015cc2edbcbbd4…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1016/j.bbih.2026.101264)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1016/j.bbih.2026.101264.svg
:target: https://openscicode.org/badge/doi/10.1016/j.bbih.2026.101264
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.bbih.2026.101264"><img src="https://openscicode.org/badge/doi/10.1016/j.bbih.2026.101264.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
