In [1]:
from pyzotero import zotero
import datetime
import re
import os

Input the following variables


In [ ]:
api_key = ""
pth = ""

title = ""
pdfname = ''
MyTitle = ''
presenter = ""
email_acc = ""
email_password = "" # warning this is not 'safe'

In [2]:
library_id = 5473189
library_type = "user"
def next_weekday(d, weekday):
    days_ahead = weekday - d.weekday()
    if days_ahead <= 0: # Target day already happened this week
        days_ahead += 7
    return d + datetime.timedelta(days_ahead)

d = datetime.datetime.now().date()
next_monday = next_weekday(d, 0) # 0 = Monday, 1=Tuesday, 2=Wednesday...

In [3]:
zot = zotero.Zotero(library_id, library_type, api_key)
query = zot.top(format="json",q=title, limit=7)[0]

title = title.replace('\"','').replace('\'','')

In [4]:
date = next_monday

In [5]:
next_monday = next_monday.strftime("%B %d, %Y")

In [6]:
auths = []
firstauth = query['data']['creators'][0]['lastName']
for creator in query['data']['creators']:
    auths+= [creator['firstName'],' ',creator['lastName'],', ']
auths = "".join(auths)[:-2]

In [7]:
abstract = query['data']['abstractNote']
abstract = abstract.encode("windows-1252").decode("utf-8","ignore")
year = re.search("(19[0-9][0-9])|(20[0-1][0-9])|9999$",query['data']['date']).group()#string
url = query['data']['url']
journal = query['data']['publicationTitle']
JCpaperspth = "/journalclub/JCpapers/"+pdfname

In [8]:
contents = "---\nlayout: post\ntitle:  {} ({})\ncategory: journalclub\nolddate: {}\n---\n \n*{}*. {} ({}) \n[({})]({})\n[(local cache)]({{{{site.url}}}}{})\n\n#### Abstract\n{}".format(title,year,next_monday,auths,journal,year,journal,url,JCpaperspth,abstract)
print(contents)


---
layout: post
title:  Hierarchical Heterogeneity across Human Cortex Shapes Large-Scale Neural Dynamics (2019)
category: journalclub
olddate: May 13, 2019
---
 
*Murat Demirtas, Joshua B. Burt, Markus Helmer, Jie Lisa Ji, Brendan D. Adkinson, Matthew F. Glasser, David C. Van Essen, Stamatios N. Sotiropoulos, Alan Anticevic, John D. Murray*. Neuron (2019) 
[(Neuron)](http://www.sciencedirect.com/science/article/pii/S0896627319300443)
[(local cache)]({{site.url}}/journalclub/JCpapers/HierarchicalHeterogeneity.pdf)

#### Abstract
Summary
The large-scale organization of dynamical neural activity across cortex emerges through long-range interactions among local circuits. We hypothesized that large-scale dynamics are also shaped by heterogeneity of intrinsic local properties across cortical areas. One key axis along which microcircuit properties are specialized relates to hierarchical levels of cortical organization. We developed a large-scale dynamical circuit model of human cortex that incorporates heterogeneity of local synaptic strengths, following a hierarchical axis inferred from magnetic resonance imaging (MRI)-derived T1- to T2-weighted (T1w/T2w) mapping and fit the model using multimodal neuroimaging data. We found that incorporating hierarchical heterogeneity substantially improves the model fit to functional MRI (fMRI)-measured resting-state functional connectivity and captures sensory-association organization of multiple fMRI features. The model predicts hierarchically organized higher-frequency spectral power, which we tested with resting-state magnetoencephalography. These findings suggest circuit-level mechanisms linking spatiotemporal levels of analysis and highlight the importance of local properties and their hierarchical specialization on the large-scale organization of human cortical dynamics.

In [9]:
with open(os.path.join(pth,"".join([str(date),"-",firstauth,"-",MyTitle,'.md'])), "w") as text_file:
    text_file.write(contents)

In [10]:
import smtplib
s = smtplib.SMTP('smtp.gmail.com', 587)

s.starttls()

s.login(email_acc, email_password)


Out[10]:
(235, b'2.7.0 Accepted')

In [11]:
if len(query['data']['creators']) > 1:
    firstauth_email=firstauth+" et al"
else:
        firstauth_email=firstauth
body ="Dear all,\n Our next Computational Neuroscience Journal Club meeting will be *Monday,{}, at 1:00 pm in the IACS Seminar Room*. {}  will be presenting the paper \"{}\" by  {}.  \n(You can download the paper from the Catnip Lab web page <https://catniplab.github.io/{}/>)\n>{}\n\nSincerely,\nPiotr".format(date.strftime("%b %d"), presenter, title, firstauth_email, "-".join([firstauth,MyTitle]),abstract.replace("\n","\n>"))

In [12]:
to = 'piotr.sokol@stonybrook.edu'
to = 'sbu-computational-neuroscience@googlegroups.com'

In [13]:
sent_from = email_acc
subject = "Comp. Neuroscience Journal Club Meeting on {} at 1:00 PM".format(date.strftime("%b %d"))

In [14]:
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import base64

In [15]:
body_html = """\
Dear all,<div><br></div><div>Our next Computational Neuroscience Journal Club meeting will be <b>Monday, {}, at 1:00 pm in the IACS Seminar Room</b>. {} will be presenting the paper &quot;{}&quot; by {}. (You can download the paper from the Catnip Lab <font color=3D"#1155cc"><a href="https://catniplab.github.io/{}/">web page</a></font>)<div></div></div><blockquote style=3D"margin:0px 0px 0px 40px;border:medium none;padding:0px">
{}

</blockquote>Sincerely, <br>{}""".format(date.strftime("%b %d"), presenter, title, firstauth_email, "-".join([firstauth,MyTitle]),abstract, sender)

In [16]:
import ipywidgets as widgets
from IPython.display import display, HTML
import threading
out = widgets.Output()

display(HTML(body_html))


Dear all,

Our next Computational Neuroscience Journal Club meeting will be Monday, May 13, at 1:00 pm in the IACS Seminar Room. Yanliang Shi will be presenting the paper "Hierarchical Heterogeneity across Human Cortex Shapes Large-Scale Neural Dynamics" by Demirtas et al. (You can download the paper from the Catnip Lab web page)
Summary The large-scale organization of dynamical neural activity across cortex emerges through long-range interactions among local circuits. We hypothesized that large-scale dynamics are also shaped by heterogeneity of intrinsic local properties across cortical areas. One key axis along which microcircuit properties are specialized relates to hierarchical levels of cortical organization. We developed a large-scale dynamical circuit model of human cortex that incorporates heterogeneity of local synaptic strengths, following a hierarchical axis inferred from magnetic resonance imaging (MRI)-derived T1- to T2-weighted (T1w/T2w) mapping and fit the model using multimodal neuroimaging data. We found that incorporating hierarchical heterogeneity substantially improves the model fit to functional MRI (fMRI)-measured resting-state functional connectivity and captures sensory-association organization of multiple fMRI features. The model predicts hierarchically organized higher-frequency spectral power, which we tested with resting-state magnetoencephalography. These findings suggest circuit-level mechanisms linking spatiotemporal levels of analysis and highlight the importance of local properties and their hierarchical specialization on the large-scale organization of human cortical dynamics.
Sincerely,
Piotr

In [17]:
msg = MIMEMultipart('alternative')
msg['Subject'] = subject
msg['From'] = sent_from
msg['To'] = to
part1 = MIMEText(body, 'plain')
part2 = MIMEText(body_html, 'html')
msg.attach(part1)
msg.attach(part2)
s.sendmail(sent_from, to, msg.as_string())
s.quit()


Out[17]:
(221, b'2.0.0 closing connection p63sm3081740qkd.1 - gsmtp')

In [ ]: