基于python的illumina甲基化阵列预处理软件

methpype的Python项目详细描述


methpype是一个用于处理illumina甲基化数组数据的python包。 查看ReadTheDocs.

ReadthedocsimageCircleCIBuild statusCodacy BadgeCoverage Status

methpype包

methpype包包含用于处理本地文件数据的高级api和允许您自定义数据流及其处理方式的低级功能。

安装

methpype为您选择的python包管理器维护配置文件:condapipenvpip

pipinstallmethpype

高级处理

主要的methpype api为最常见的数据处理和文件检索功能提供了方法。

run_pipeline

为给定的项目目录运行完整的甲基化处理管道,可以选择将结果导出到文件。

返回:每个已处理样本的数据容器对象集合

frommethpypeimportrun_pipelinedata_containers=run_pipeline(data_dir,array_type=None,export=False,manifest_filepath=None,sample_sheet_filepath=None,sample_names=None)
ArgumentTypeDefaultDescription
^{}^{}, ^{}-Base directory of the sample sheet and associated IDAT files
^{}^{}^{}Code of the array type being processed. Possible values are ^{}, ^{}, ^{}, and ^{}. If not provided, the pacakage will attempt to determine the array type based on the number of probes in the raw data.
^{}^{}^{}Whether to export the processed data to CSV
^{}^{}, ^{}^{}File path for the array's manifest file. If not provided, this file will be downloaded from a Life Epigenetics archive.
^{}^{}, ^{}^{}File path of the project's sample sheet. If not provided, the package will try to find one based on the supplied data directory path.
^{}^{} collection^{}List of sample names to process. If provided, only those samples specified will be processed. Otherwise all samples found in the sample sheet will be processed.

methpype命令行界面(cli)

methpype提供了一个命令行界面(cli),因此可以在bash/batchfile脚本中直接使用该包,作为构建自定义处理管道的一部分。

所有对methpype cli的调用都将提供上下文帮助,根据调用的命令提供可能的参数和/或可用选项。如果指定详细日志记录,则包将发出调试级别及更高级别的日志输出。

>>> python -m methpype

usage: methpype [-h][-v]{process,sample_sheet} ...

Utility to process methylation data from Illumina IDAT files

positional arguments:
  {process,sample_sheet}
    process             process help
    sample_sheet        sample sheet help

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose logging

命令

methpype cli提供两个顶级命令:

  • process处理甲基化数据
  • sample_sheet查找/读取样本表并输出其内容

process

处理单个样本表中列出的一组样本的甲基化数据。

如果不提供项目示例工作表的文件路径,则模块将尝试根据提供的数据目录路径查找文件路径。 必须提供正在处理的数组的名称或数组清单文件的文件路径。如果只指定数组类型,则数组的清单文件将从生命表观遗传学存档中下载。

>>> python -m methpype process

usage: methpype idat [-h] -d DATA_DIR [-a {custom,450k,epic,epic+}][-m MANIFEST][-s SAMPLE_SHEET][--sample_name [SAMPLE_NAME [SAMPLE_NAME ...]]][--export]

Process Illumina IDAT files

optional arguments:
  -h, --help            show this help message and exit
  -d, --data_dir        Base directory of the sample sheet and associated IDAT
                        files
  -a, --array_type      Type of array being processed
                        Choices: {custom,450k,epic,epic+}
  -m, --manifest        File path of the array manifest file
  -s, --sample_sheet    File path of the sample sheet
  --sample_name         Sample(s) to process
  --export              Export data to csv

sample_sheet

在给定的目录中查找和分析样本表,并发出每个样本的详细信息。这不是实际处理数据所必需的。

>>> python -m methpype sample_sheet

usage: methpype sample_sheet [-h] -d DATA_DIR

Process Illumina sample sheet file

optional arguments:
  -h, --help            show this help message and exit
  -d, --data_dir        Base directory of the sample sheet and associated IDAT
                        files

低级处理

这些函数可以在methpype中使用。run_pipeline根据需要为您调用它们。

get_sample_sheet

查找并分析提供的项目目录路径的示例表。

返回:sample sheet对象,该对象包含从项目的示例表文件中分析的示例信息

frommethpypeimportget_sample_sheetsample_sheet=get_sample_sheet(dir_path,filepath=None)
ArgumentTypeDefaultDescription
^{}^{}, ^{}-Base directory of the sample sheet and associated IDAT files
^{}^{}, ^{}^{}File path of the project's sample sheet. If not provided, the package will try to find one based on the supplied data directory path.

get_manifest

查找并分析已处理数组类型的清单文件。

返回:包含已处理数组类型的已分析探测信息的清单对象

frommethpypeimportget_manifestmanifest=get_manifest(raw_datasets,array_type=None,manifest_filepath=None)
ArgumentTypeDefaultDescription
^{}^{} collection-Collection of RawDataset objects containing probe information from the raw IDAT files.
^{}^{}^{}Code of the array type being processed. Possible values are ^{}, ^{}, ^{}, and ^{}. If not provided, the pacakage will attempt to determine the array type based on the provided RawDataset objects.
^{}^{}, ^{}^{}File path for the array's manifest file. If not provided, this file will be downloaded from a Life Epigenetics archive.

get_raw_datasets

在项目的示例表中查找和分析示例的IDAT文件。

返回:每个样本的IDAT文件对的rawdataset对象的集合。

frommethpypeimportget_raw_datasetsraw_datasets=get_raw_datasets(sample_sheet,sample_names=None)
ArgumentTypeDefaultDescription
^{}^{}-A SampleSheet instance from a valid project sample sheet file.
^{}^{} collection^{}List of sample names to process. If provided, only those samples specified will be processed. Otherwise all samples found in the sample sheet will be processed.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
切换名称节点Hadoop Java api和camel、jms   java首先执行服务器调用,然后执行下一行代码   java如何登录到这样的站点?   C#AES在Java中使用CFB NoPadding模式进行加密   JVM中的java确定性垃圾收集   java在与PC相连的移动设备上读写数据   java jar编译运行时。getRuntime。exec()jar中的完整目录   java HTTP状态500无法转换类型的值   如何获取另一种语言的Java日期   java无法使用安卓 emulator连接到本地服务器   java计算窗口内两个Swing组件的焦点遍历距离   Java字符串将错误与正则表达式匹配   java将请求从servlet发送到jsp   math Java cast未生成预期输出   在Java中,获取字符串最后250个字符的最佳方法是什么?   Java线程同步管理中的静态关键字   项目中的java Eclipse错误   数组JAVA从txt文件读取整数并计算整数