跳转到主要内容

LocusZoom的Jupyter小部件

项目描述

jupyter-locuszoom

Extension status Build Status PyPI

LocusZoom的Jupyter小部件

用法

在一个notebook单元格中导入LocusZoom

# should it be renamed to ipylocuszoom? Let me know!
from jupyter_locuszoom import LocusZoom

然后使用它与包含列 CHROMREFALTPOSP(或 LOG10_P)的GWAS结果DataFrame

LocusZoom(
    assoc,
    chrom='15',    # optional (if not given top locus will be shown)
    start=0,       # optional (if nto given top locus on given chromosome will be shown)
    end=100_000,   # optional, but has to be given if start was given
    build='GRCh38'
)

Example

或者,专注于特定的位置

LocusZoom(
    assoc,
    chrom='15',
    position=123_456,
    flank=100_000,
    build='GRCh38'
)

安装

您可以使用pip进行安装

pip install jupyter_locuszoom

如果您使用的是Jupyter Notebook 5.2或更早版本,您可能还需要启用nbextension

jupyter nbextension enable --py [--sys-prefix|--user|--system] jupyter_locuszoom

开发安装

创建开发环境

conda create -n jupyter_locuszoom-dev -c conda-forge nodejs yarn python jupyterlab
conda activate jupyter_locuszoom-dev

安装python。这将还会构建TS包。

pip install -e ".[test, examples]"

当您开发扩展时,您需要手动使用notebook / lab前端启用您的扩展。对于lab,这是通过以下命令完成的

jupyter labextension develop --overwrite .
yarn run build

对于经典notebook,您需要运行

jupyter nbextension install --sys-prefix --symlink --overwrite --py jupyter_locuszoom
jupyter nbextension enable --sys-prefix --py jupyter_locuszoom

请注意,--symlink标志在Windows上不起作用,因此您必须在这里每次重建扩展时都运行install命令。对于某些安装,您可能还需要使用另一个标志代替--sys-prefix,但这里不会解释这些标志的含义。

如何查看您的更改

Typescript

如果您使用JupyterLab进行开发,则可以监视源目录,并同时在不同终端中运行JupyterLab以监视扩展源的变化,并自动重建小部件。

# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab

更改后,等待构建完成,然后刷新浏览器,更改应该生效。

Python

如果您修改了 Python 代码,则需要重新启动笔记本内核才能使其生效。

更新版本

要更新版本,请安装 tbump 并使用它来提升版本。默认情况下,它还会创建一个标签。

pip install tbump
tbump <new-version>

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

jupyter_locuszoom-0.1.1.dev0.tar.gz (856.3 kB 查看哈希值)

上传时间

构建分发

jupyter_locuszoom-0.1.1.dev0-py3-none-any.whl (1.6 MB 查看哈希值)

上传时间 Python 3

由以下组织支持