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

methylprep的Python项目详细描述


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

ReadthedocsimageCircleCIBuild statusCodacy BadgeCoverage Status

methpype包

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

安装

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

pipinstallmethylprep

高级处理

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

run_pipeline

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

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

frommethylprepimportrun_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 methylprep

usage: methylprep [-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 methylprep process

usage: methylprep 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 methylprep sample_sheet

usage: methylprep 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

低级处理

这些是你可以在methylprep中使用的一些函数。run_pipeline根据需要为您调用它们。

get_sample_sheet

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

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

frommethylprepimportget_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

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

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

frommethylprepimportget_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对象的集合。

frommethylprepimportget_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第三方库


热门话题
java如何在部署在Tomcat7上的jbpmconsole中添加新用户?   JavaStruts2:我分配了一个参数的值,但在jsp文件中得到了一个空指针错误   检查类是否在同一个包或子包中访问的java ArchUnit规则?   java当您使用spring forward重定向到其他控制器时,如何从ModelAndView返回响应对象?   java jsp/servlet,显示管理员、用户和未登录用户的不同链接   java Eclipse警告消息   java加载多纹理openGL   java有没有一种方法可以通过Hibernate传递一个对象(genaric)并填充任何字段,然后让它返回一个包含所有字段的对象列表?   java如何将git存储url连接到本地存储库,以便每次都获得更新的代码?   java无限循环在程序中无法正常工作   java File writer正在写入没有“换行”的字符串   java为什么Spring或C3p0没有清理C3p0线程?   java通过JDBC从PostgreSQL检索几何数组