<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Python script for treemap using Python's Plotly library]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library</guid>
	<pubDate>Sat, 14 Dec 2024 12:45:15 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library</link>
	<title><![CDATA[Python script for treemap using Python's Plotly library]]></title>
	<description><![CDATA[<code>import plotly.express as px
import pandas as pd

# Sample dataset: Representing biological pathways and their associated counts
data = {
    &quot;Category&quot;: [&quot;Metabolism&quot;, &quot;Metabolism&quot;, &quot;Metabolism&quot;, 
                 &quot;Cellular Processes&quot;, &quot;Cellular Processes&quot;, &quot;Cellular Processes&quot;, 
                 &quot;Information Storage&quot;, &quot;Information Storage&quot;],
    &quot;Subcategory&quot;: [&quot;Carbohydrate metabolism&quot;, &quot;Lipid metabolism&quot;, &quot;Amino acid metabolism&quot;, 
                    &quot;Signal transduction&quot;, &quot;Cell cycle&quot;, &quot;Transport&quot;, 
                    &quot;DNA replication&quot;, &quot;RNA processing&quot;],
    &quot;Count&quot;: [150, 120, 90, 100, 85, 70, 110, 95]
}

# Convert data to a DataFrame
df = pd.DataFrame(data)

# Create the treemap
fig = px.treemap(
    df,
    path=[&quot;Category&quot;, &quot;Subcategory&quot;],  # Hierarchical levels
    values=&quot;Count&quot;,                   # Size of the treemap blocks
    color=&quot;Count&quot;,                    # Color based on the count values
    color_continuous_scale=&quot;Viridis&quot;  # Color scale
)

# Add a title
fig.update_layout(title=&quot;Treemap: Hierarchical Data Representation in Bioinformatics&quot;)

# Show the plot
fig.show()</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>

</channel>
</rss>