vyleung / logseq-logtero-plugin

a Logseq plugin to create pages for Zotero items using custom page titles and properties
MIT License
23 stars 1 forks source link

Abstract with new paragraphs displaying outside page property #4

Open danieltomasz opened 2 years ago

danieltomasz commented 2 years ago

This is a really small details, but for one paper I have abstract like this

abstract:: "Introduction: The slope of the electroencephalography (EEG) power spectrum (also referred to as 1/f noise) is an important consideration when calculating narrow-band power. However, psychophysiological data also suggest this slope is a meaningful signal itself, not merely background activity or noise. We present two different methods for quantifying the slope of the power spectrum and assess their reliability and sensitivity.
Methods: We used data from N = 60 participants who had EEG collected during rest, a videogame task, and a second period of rest. At all phases of the experiment, we calculated the “spectral slope” (a regression-based method fit to all datapoints) and the “aperiodic slope” (estimated with the fitting oscillations with 1/f algo­ rithm FOOOF). For both methods we assessed: their reliability, their sensitivity to the transition from rest to task, their sensitivity to changes during the videogame task itself, and the agreement between the two measures.
Results: Across resting phases, both spectral and aperiodic slopes showed a high degree of reliability. Both methods also showed a steepening of the power spectrum on-task compared to rest. There was also a high degree of consistency between the two methods in their estimate of the underlying slope, but FOOOF explained more variance in the power spectra across regions and type of activity (rest versus task).
Conclusion: The slope of the power spectrum is a highly reliable individual difference and sensitive to withinsubject changes across two different methods of estimation. Moving forward, we generally recommend the use of the FOOOF algorithm for its ability to account for narrow-band signals, but these data show how regression-based approaches produce similar estimates of the spectral slope, which may be useful in some applications."

is rendered in logseq like this

abstract:: "<h3>Abstract</h3> <h3>Background</h3> <p>Previous research has shown that the slope of the electroencephalography (EEG) power spectrum mediates the difference between older and younger adults on a visuo-spatial working memory task. The present study sought to replicate and extend that work using a larger sample and a validated set of neuropsychological tests: The Repeatable Battery for the Assessment of Neuropsychological Status (RBANS).</p><h3>Methods</h3> <p>Forty-four participants (21 younger adults, 23 older adults) completed a battery of cognitive and motor tasks that included the RBANS. EEG data was collected both during rest and on-task. Excluding the alpha-band, RBANS scores were regressed onto the slope of the resting EEG power spectrum, controlling for age and using robust mediation analysis.</p><h3>Results</h3> <p>Older adults performed reliably lower on the composite RBANS and the Coding, List Recall, List Recognition, and Figure Recall subtests. However, boot-strapped mediation models only showed a mediating effect of the spectral slope on the RBANS composite and the Coding subtest.</p><h3>Conclusions</h3> <p>The resting slope of the EEG power spectrum mediated age-related differences in cognition in the current study, which replicates prior work and is consistent with the neural noise hypothesis of aging. In extending this work, it was shown that these effects are strongest in tasks requiring speeded processing and/or executive functions, whereas this effect was weaker (to absent) for delayed memory, even though age-related differences were present. This pilot study warrants further exploration of the EEG power spectrum in age-related cognitive decline.</p>"

Only the first paragraph is displayed in the page property, the rest is outside it.

image

below the bib file but it seems normal when I try to read the item in other editor Exported Items.bib.zip

Maybe stripping the enters and replacing it by soft enters is possible? if this is not a easy fix or something not important you might close the issue

danieltomasz commented 2 years ago

Also this abstract note is creating after reininding new redundant notes image

vyleung commented 2 years ago

this is really strange... have you encountered this bug w/ other papers?

danieltomasz commented 2 years ago

yes, for example here

image

Children with ADHD who were treated with stimulants had comparable slopes and offsets to the typically developing group despite a 24-h medication-washout period. We further show that spectral slope correlates with traditional measures of theta/beta ratio, suggesting the utility of slope as a neural marker over and above traditional approaches. Taken with past research demonstrating that spectral slope is associated with executive functioning and excitatory/inhibitory balance, these results suggest that altered slope of the power spectrum may reflect pathology in ADHD. NEW & NOTEWORTHY This article highlights the clinical utility of comprehensively quantifying features of the EEG power spectrum. Using this approach, we identify, for the first time, differences in the aperiodic components of the EEG power spectrum in children with attention-deficit/hyperactivity disorder (ADHD) and provide evidence that spectral slope is a robust indictor of an increase in low- relative to high-frequency power in ADHD." I think it is happening when abstracts contain some kind of abstract/newline character; is not that critical I think but I will investigate

danieltomasz commented 2 years ago

Maybe this is logseq bug, but within Obsidian those abstracts also rendered differently, which might point to special line-breakers characters theory

image
danieltomasz commented 2 years ago

I could share a library with problematic Zotero items for testing later

danieltomasz commented 2 years ago

This is markdown content of another note

status:: to-read
category:: zotero
citekey:: pathania2021RelatingrestingEEG
authors:: "Pathania, A., Clark, M., Cowan, R., Euler, M., Duff, K., Lohse, K."
local-library:: [Local library](zotero://select/library/items/GGGYRAFS)
abstract:: "<h3>Abstract</h3> <h3>Background</h3> <p>Previous research has shown that the slope of the electroencephalography (EEG) power spectrum mediates the difference between older and younger adults on a visuo-spatial working memory task. The present study sought to replicate and extend that work using a larger sample and a validated set of neuropsychological tests: The Repeatable Battery for the Assessment of Neuropsychological Status (RBANS).</p><h3>Methods</h3> <p>Forty-four participants (21 younger adults, 23 older adults) completed a battery of cognitive and motor tasks that included the RBANS. EEG data was collected both during rest and on-task. Excluding the alpha-band, RBANS scores were regressed onto the slope of the resting EEG power spectrum, controlling for age and using robust mediation analysis.</p><h3>Results</h3> <p>Older adults performed reliably lower on the composite RBANS and the Coding, List Recall, List Recognition, and Figure Recall subtests. However, boot-strapped mediation models only showed a mediating effect of the spectral slope on the RBANS composite and the Coding subtest.</p><h3>Conclusions</h3> <p>The resting slope of the EEG power spectrum mediated age-related differences in cognition in the current study, which replicates prior work and is consistent with the neural noise hypothesis of aging. In extending this work, it was shown that these effects are strongest in tasks requiring speeded processing and/or executive functions, whereas this effect was weaker (to absent) for delayed memory, even though age-related differences were present. This pilot study warrants further exploration of the EEG power spectrum in age-related cognitive decline.</p>"
title:: @Pathania et al. 2021 Relating resting EEG power spectra to age-related differences in cognitive performance: An observational pilot study

Then in Logseq every paragraph become new note (and new block)

The json also contains html markers. Is there any quick function that strip html and convert it to markdown before inserting abstract into logseq? this might be a solution

For some reason the whole abstract is not treated as an one string, maybe there is an escape character somewhere? (I have other notes with paragraphs markers in abstracts and they seems to be ok)

Pathania.json.zip

This is not a big priority, but converting html to markdown before inserting (if this is possible) might help to avoid such problems (also this might make the plugin potentially safer against html injection, but I am not a security expert)

vyleung commented 2 years ago

thoughts on removing the HTML markers completely rather than converting them to markdown? using your example, it'd be something like Background Previous research has shown that the slope of the electroencephalography (EEG) power spectrum... instead of ### Background Previous research has shown that the slope of the electroencephalography (EEG) power spectrum...

danieltomasz commented 2 years ago

For me this would be enough and solve my problem. Maybe some users might want to retain the html, maybe some handle (yes/no) in settings Remove html markers from abstract would be useful? Or the handle could be introduced when another user will request it, for this moment just removing HTML works for my use case.

danieltomasz commented 2 years ago

This reference is rendering outside the properties and after reindexing pages is generating pages from abstract, please let me know if you can replicate Roberts.json.zip

vyleung commented 2 years ago

can reproduce this bug (sorry for polluting your graph 😅)

update: your line break theory was spot on! fixed the bug by removing the line breaks

danieltomasz commented 2 years ago

@vyleung the 'properties' also could create pages by default https://github.com/logseq/logseq/issues/6065