基于python的illumina甲基化阵列预处理软件
methylprep的Python项目详细描述
methylprep
是一个用于处理illumina甲基化数组数据的python包。
查看ReadTheDocs.
methpype包
methpype包包含用于处理本地文件数据的高级api和允许您自定义数据流及其处理方式的低级功能。
安装
methpype为您选择的python包管理器维护配置文件:conda、pipenv和pip。
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)
Argument | Type | Default | Description |
---|---|---|---|
^{ | ^{ | - | Base directory of the sample sheet and associated IDAT files |
^{ | ^{ | ^{ | Code of the array type being processed. Possible values are ^{ |
^{ | ^{ | ^{ | 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. |
^{ | ^{ | ^{ | 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)
Argument | Type | Default | Description |
---|---|---|---|
^{ | ^{ | - | 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)
Argument | Type | Default | Description |
---|---|---|---|
^{ | ^{ | - | Collection of RawDataset objects containing probe information from the raw IDAT files. |
^{ | ^{ | ^{ | Code of the array type being processed. Possible values are ^{ |
^{ | ^{ | ^{ | 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)
Argument | Type | Default | Description |
---|---|---|---|
^{ | ^{ | - | A SampleSheet instance from a valid project sample sheet file. |
^{ | ^{ | ^{ | 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. |