How to generate PRISMA flow chart in Python Programming language?

“Graphviz” package produced by Sebastian Bank (available here: https://pypi.org/project/graphviz/) can be used to produce “Preferred Reporting Items for Systematic Reviews and Meta-Analyses (PRISMA)” (Moher et al., 2009) flow chart.

Initially, it is important to install Executable Package for Graphviz. It is available here: https://graphviz.org/download/  

For installation of the package in Python, write the following:

pip install graphviz

Now write the following to generate a PRISMA flow diagram:

from graphviz import Digraph
pri = Digraph()
with pri.subgraph() as c:
    c.attr(rank='same')
    c.node('a', '# of studies identified through database searching', shape='box')
    c.node('b', '# of additional studies identified through other sources', shape='box')
pri.node('c', '# of studies after duplicates removed', shape='box')
with pri.subgraph() as c:
    c.attr(rank='same')
    c.node('d', '# of studies with title and abstract screened', shape='box')
    c.node('e', '# of studies excluded, reasons', shape='box')
with pri.subgraph() as c:
    c.attr(rank='same')
    c.node('f', '# of full-text articles assessed for eligibility', shape='box')
    c.node('g', '# of full-text excluded, reasons', shape='box')
with pri.subgraph() as c:
    c.attr(rank='same')
    c.node('h', '# of studies included in qualitative synthesis', shape='box')
    c.node('i', '# of studies excluded, reasons', shape='box')
pri.node('j', 'final # of studies included in quantitative synthesis (meta-analysis)', shape='box')
pri.edges(['ac', 'bc', 'cd', 'de','df','fg','fh','hi','hj'])
pri.render(view=True)

This generates the following diagram:

PRISMA flow chart, flow chart, statistics, Python programming language, flow diagram, Graphviz

So, the numbers (of studies) could be entered accordingly.

Sources:

Graphiviz package, https://pypi.org/project/graphviz/

Moher, D., Liberati, A., Tetzlaff, J., Altman, D. G., & Group, P. (2009). Preferred reporting items for systematic reviews and meta-analyses: the PRISMA statement. PLoS Medicine, 6(7), e1000097.

saypeople

SayPeople.com gives you the news and information about Science, Research, Technology, Business and Islam.

%d bloggers like this: