OSCR

Microglia depletion alleviates the disruptions in circadian rhythms and anxiety caused by bmal1 deficiency.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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

  1. #' @title circa_single
  2. #' @name circa_single
  3. #'
  4. #' @description \code{circa_single} performs an analysis on a single rhythmic dataset. It estimates the mesor, amplitude and phase of the data provided.
  5. #'
  6. #' @param x data.frame. This is the data.frame which contains the rhythmic data in a tidy format.
  7. #' @param col_time The name of the column within the data.frame, x, which contains time in hours at which the data were collected.
  8. #' @param col_outcome The name of the column within the data.frame, x, which contains outcome measure of interest.
  9. #' @param period The period of the rhythm. For circadian rhythms, leave this as the default value, 24.
  10. #' @param alpha_threshold The level of alpha for which the presence of rhythmicity is considered. Default is 0.05.
  11. #' @param timeout_n The upper limit for the model fitting attempts. Default is 10,000.
  12. #' @param return_figure Whether or not to return a ggplot graph of the rhythm and cosine model.
  13. #' @param control \code{list}. Used to control the parameterization of the model.
  14. #' @param weights An optional numeric vector of (fixed) weights. When present, the objective function is weighted least squares.
  15. #' @param suppress_all Logical. Set to \code{TRUE} to avoid seeing errors or messages during model fitting procedure. Default is \code{FALSE}.
  16. #'
  17. #' @return list
  18. #' @export
  19. #'
  20. #' @examples
  21. #' df <- make_data()
  22. #' df <- df[df$group == "g1", ]
  23. #' out <- circa_single(x = df, col_time = "time", col_outcome = "measure")
  24. #' out
  25. #'
  26. #' # with sample weights (arbitrary weights for demonstration)
  27. #' sw <- runif(n = nrow(df))
  28. #' out2 <- circa_single(
  29. #' x = df,
  30. #' col_time = "time",
  31. #' col_outcome = "measure",
  32. #' weights = sw,
  33. #' suppress_all = TRUE
  34. #' )
  35. #' out2
  36. #'
  37. circa_single <- function(x,
  38. col_time,
  39. col_outcome,
  40. period = 24,
  41. alpha_threshold = 0.05,
  42. timeout_n = 10000,
  43. return_figure = TRUE,
  44. control = list(),
  45. weights = NULL,
  46. suppress_all = FALSE) {
  47. controlVals <- circa_single_control()
  48. controlVals[names(control)] <- control
  49. if (controlVals$period_param) {
  50. controlVals$main_params <- c(controlVals$main_params, "tau")
  51. }
  52. if ("tau" %in% controlVals$main_params) {
  53. controlVals$period_param <- TRUE
  54. }
  55. x <- x[c(col_time, col_outcome)]
  56. colnames(x) <- c("time", "measure")
  57. if (!class(x$time) %in% c("numeric", "integer")) {
  58. stop(paste("The time variable which you gave was a '",
  59. class(x$time), "' \nThis function expects time to be given as hours and be of class 'integer' or 'numeric'.",
  60. "\nPlease convert the time variable in your dataframe to be of one of these classes",
  61. sep = ""
  62. ))
  63. }
  64. if (!class(x$measure) %in% c("numeric", "integer")) {
  65. stop(paste("The measure variable which you gave was a '",
  66. class(x$measure), "' \nThis function expects measure to be number and be of class 'integer' or 'numeric'.",
  67. "\nPlease convert the measure variable in your dataframe to be of one of these classes",
  68. sep = ""
  69. ))
  70. }
  71. if (!class(period) %in% c("numeric", "integer") & !controlVals$period_param) {
  72. stop(paste0(
  73. "The period argument must be a number representing the period of the rhythm in hours\n",
  74. "If you would like the period to be estimated as part of the model, use:\ncontrol=list(period_param=TRUE)"
  75. ))
  76. }
  77. if (controlVals$period_param & !is.na(period)) {
  78. message(paste0("control$period_param is TRUE\n'period=", period, "' is being ignored.\nSet 'period=NA' to avoid this message"))
  79. }
  80. x$time_r <- x$time * 2 * pi
  81. if (!controlVals$period_param) {
  82. x$period <- period
  83. } else {
  84. if (is.null(controlVals$period_min) | is.null(controlVals$period_min)) {
  85. message(paste0(
  86. "If you want the model to estimate the period using a parameter,",
  87. "you may get faster convergence if you provide an approximate range using 'period_min' and 'period_max' in control()",
  88. "\nCurrently assuming period is between: period_min=", controlVals$period_min,
  89. "and period_max=", controlVals$period_max
  90. ))
  91. }
  92. }
  93. if (!is.null(weights)) {
  94. check_weights(x, weights)
  95. x$weights <- weights
  96. } else {
  97. x$weights <- rep(1, nrow(x))
  98. }
  99. success <- FALSE
  100. n <- 0
  101. form <- create_formula(main_params = controlVals$main_params, decay_params = controlVals$decay_params)$formula
  102. while (!success) {
  103. fit.nls <- try(
  104. {
  105. stats::nls(
  106. formula = form,
  107. data = x,
  108. start = start_list(outcome = x$measure, controlVals = controlVals),
  109. weights = weights
  110. )
  111. },
  112. silent = suppress_all
  113. )
  114. if (inherits(fit.nls, "try-error")) {
  115. n <- n + 1
  116. } else {
  117. nls_coefs <- extract_model_coefs(fit.nls)
  118. V <- nls_coefs[, "estimate"]
  119. success <- assess_model_estimates(param_estimates = V, controlVals = controlVals)
  120. n <- n + 1
  121. }
  122. if (n >= timeout_n) {
  123. 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).")
  124. }
  125. }
  126. data_rhythmic <- nls_coefs["alpha", "p_value"] < alpha_threshold
  127. if (!controlVals$period_param) {
  128. V["tau"] <- period
  129. }
  130. eq_expression <- create_formula(main_params = controlVals$main_params, decay_params = controlVals$decay_params)$f_equation
  131. eval(parse(text = eq_expression))
  132. if (return_figure) {
  133. p <- ggplot2::ggplot(x, ggplot2::aes(time, measure)) +
  134. ggplot2::geom_point() +
  135. ggplot2::xlim(
  136. min(floor(x$time / period) * period),
  137. max(ceiling(x$time / period) * period)
  138. )
  139. if (data_rhythmic) {
  140. fig_out <- p +
  141. ggplot2::stat_function(fun = eq, linewidth = 1) +
  142. ggplot2::labs(subtitle = "Data is rhythmic", x = "time (hours)")
  143. } else {
  144. fig_out <- p +
  145. ggplot2::labs(subtitle = "Data is arrhythmic", x = "time (hours)")
  146. }
  147. }
  148. results_summary <-
  149. circa_summary(model = fit.nls, period = period, control = controlVals)
  150. if (return_figure) {
  151. return(list(fit = fit.nls, summary = results_summary, plot = fig_out))
  152. } else {
  153. return(list(fit = fit.nls, summary = results_summary))
  154. }
  155. }
  156. circa_single_control <- function(period_param = F, period_min = 20, period_max = 28,
  157. main_params = c("k", "alpha", "phi"), decay_params = c()) {
  158. list(
  159. period_param = period_param, period_min = period_min, period_max = period_max,
  160. main_params = main_params, decay_params = decay_params
  161. )
  162. }

circa_single.R at commit 5df1144, under other · at the source

Overview

Authors: Song Gong1,2, Yuxue Chen3, Lihan Su4, Ensheng Yao4, Zhanfei Li1, Xinghua Liu1, Shi Li5
ORCID iDs: Xinghua Liu
  1. 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
  2. Division of Endocrinology, Tongji Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430030, China
  3. Department of Rheumatology and Immunology, Tongji Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430030, China
  4. Department of Neurology, The First Affiliated Hospital of Shihezi University, Shihezi, Xinjiang, 832008, China
  5. Department of Emergency, Union Hospital, Tongji Medical College, Huazhong University of Science and Technology, Wuhan, 430022, China
Journal: Brain, behavior, & immunity - health, volume 54, article 101264
Dates: received 19 January 2026; accepted 19 May 2026; published online 20 May 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.bbih.2026.101264 · PMID 42210978 · PMCID PMC13214300 · OpenAlex W7161780088
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), cellular / molecular (subfield)
Methods: Statistics
Keywords: Microglia, Circadian rhythms, Bmal, LTP, Behavioral abnormalities, Neuroinflammation
Topic: Neuroinflammation and Neurodegeneration Mechanisms (Neurology, Neuroscience), according to OpenAlex
Funding: Hubei Province Natural Science Foundation (2021CFB058)
Citations: cited by 1 paper (Europe PMC); 24 references in the paper

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

License: other
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 5df1144f5b5127893438ec0fc42e72cc3ac75ec1, 9 January 2024
Languages: R (12)
Size: 34 files, 12 scripts
Software Heritage: not archived
Found in: the text, “Circadian rhythm analysis”
Holds: README, license file, environment (DESCRIPTION), tests, continuous integration, documentation, 1 notebook
Not found: CITATION.cff
Tools: ggplot2 (5 files), nlme (3 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
15 files

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://doi.org/10.1016/j.bbih.2026.101264

BibTeX

@article{gong2026microglia,
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/j.bbih.2026.101264},
url = {https://doi.org/10.1016/j.bbih.2026.101264},
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/05/20
VL - 54
SP - 101264
SN - 2666-3546
PB - Elsevier
DO - 10.1016/j.bbih.2026.101264
UR - https://doi.org/10.1016/j.bbih.2026.101264
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.bbih.2026.101264",
"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": "Brain Behav Immun Health",
"volume": "54",
"page": "101264",
"DOI": "10.1016/j.bbih.2026.101264",
"PMID": "42210978",
"PMCID": "PMC13214300",
"ISSN": "2666-3546",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.bbih.2026.101264",
"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 advances
In 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 neuroinflammation
In 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 biology
In 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 neurology
In 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 reports
In 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 neuroinflammation
In 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 genetics
In 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 America
In 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 communications
In 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.

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.