# Requirements & Acknowledgements


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install viset
```

VISET requires **Python ≥ 3.9** and these packages, all installed
automatically by `pip`:

<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr>
<th>Package</th>
<th>Used for</th>
</tr>
</thead>
<tbody>
<tr>
<td><a
href="https://github.com/jolars/eunoia"><code>eunoia</code></a></td>
<td>area-proportional Euler layouts (ellipses/boxes)</td>
</tr>
<tr>
<td><a
href="https://upsetplot.readthedocs.io"><code>upsetplot</code></a></td>
<td>UpSet intersection layout</td>
</tr>
<tr>
<td><a href="https://matplotlib.org"><code>matplotlib</code></a></td>
<td>static rendering + font auto-fit</td>
</tr>
<tr>
<td><a href="https://plotly.com/python/"><code>plotly</code></a></td>
<td>interactive (hover) rendering</td>
</tr>
<tr>
<td><code>pandas</code>, <code>numpy</code>, <code>scipy</code></td>
<td>data handling + region geometry</td>
</tr>
</tbody>
</table>

> **Version note:** `upsetplot` 0.9.0 (the current release) is not yet
> compatible with `pandas ≥ 3`, so VISET pins `pandas < 3`.

## Loading your sets

The **Venn** plotters take a list of one-column `DataFrame`s, one per
set. [`load`](https://mnicolee.github.io/VISET/core.html#load) builds
each one from a CSV column: it reads the column, drops blanks, and names
the set. The **UpSet** plotters instead take a plain `{name: [members]}`
dictionary, which you can build with `pandas` directly.

------------------------------------------------------------------------

<a href="https://github.com/mnicolee/VISET/blob/main/viset/core.py#L14"
target="_blank" style="float:right; font-size:smaller">source</a>

### load

``` python
def load(
    path, col, label
):
```

*Read `col` from the CSV at `path`, drop NaNs, and return a one-column
DataFrame named `label`.*

<details class="code-fold">
<summary>Code</summary>

``` python
from viset import load
db = ("Drug target sample files/" if __import__("os").path.isdir("Drug target sample files") else "../Drug target sample files/")
flu = load(db + "1. FLUOXETINE_sample.csv", "Gene names", "Fluoxetine")
flu.head()
```

</details>

<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }
&#10;    .dataframe tbody tr th {
        vertical-align: top;
    }
&#10;    .dataframe thead th {
        text-align: right;
    }
</style>

<table class="dataframe" data-quarto-postprocess="true" data-border="1">
<thead>
<tr style="text-align: right;">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">Fluoxetine</th>
</tr>
</thead>
<tbody>
<tr>
<td data-quarto-table-cell-role="th">0</td>
<td>AANAT</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">1</td>
<td>ACE</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">2</td>
<td>ATXN2</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">3</td>
<td>CRHR1</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">4</td>
<td>CYP1A2</td>
</tr>
</tbody>
</table>

</div>

That single-column frame is what every Venn plotter expects; for UpSet,
call `.iloc[:, 0].tolist()` (or
`pd.read_csv(...)[col].dropna().tolist()`) to get a plain member list.
With your sets loaded, head to a plotter: [Venn (static)](venn.html),
[Venn (interactive)](venn_interactive.html), [UpSet
(static)](upset.html), or [UpSet (interactive)](upset_interactive.html).

## Acknowledgements

VISET stands on the shoulders of several projects, with thanks to their
authors:

- **[eunoia](https://github.com/jolars/eunoia)** (Johan Larsson) is the
  area-proportional set-fitting engine VISET is built on — it computes
  the Euler layouts (ellipses, boxes) and region geometry that VISET
  labels and renders. eunoia is the Python successor to Larsson’s R
  package **[eulerr](https://github.com/jolars/eulerr)**. Both are
  MIT-licensed.
- **[UpSet](https://upset.app/)** (Lex, Gehlenborg, Strobelt, Vuillemin
  & Pfister, *IEEE TVCG*, 2014) is the intersection-visualization
  technique behind the UpSet plots, and the
  **[upsetplot](https://upsetplot.readthedocs.io)** package (Joel
  Nothman) provides the layout VISET restyles and itemizes.
- **[matplotlib-set-diagrams](https://pypi.org/project/matplotlib-set-diagrams/)**
  (Paul Brodersen) is related prior art: it also draws area-proportional
  Euler diagrams and labels members, as word clouds. VISET’s clean
  auto-fit member lists and its UpSet itemization were developed
  independently, but the project is well worth knowing for anyone
  working in this space.
- **Data:** The drug-target gene sets used throughout these docs come
  from [Enrichr](https://maayanlab.cloud/Enrichr) (Chen et al. 2013;
  Kuleshov et al. 2016), specifically the **DGIdb Drug Targets 2024**
  library. They are included only as a small public example.
- **Development:** Parts of VISET’s code and documentation were written
  with the help of Anthropic’s Claude (Claude Code).

## License & citation

VISET is released under the **MIT License**. As it is a thin
visualization layer, please cite the layout engine it depends on:

- Larsson J. **eunoia** / **eulerr: Area-Proportional Euler and Venn
  Diagrams with Ellipses.** <https://github.com/jolars/eunoia>,
  <https://github.com/jolars/eulerr>
- Lex A, Gehlenborg N, Strobelt H, Vuillemin R, Pfister H. **UpSet:
  Visualization of Intersecting Sets.** *IEEE Transactions on
  Visualization and Computer Graphics* 20(12):1983–1992, 2014.
