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


热门话题
如何为本地和Jenkins执行实现Java配置?   多日志文件创建的java log4j滚动追加器问题   安卓 java替换列表内容或替换引用值本身   java JOptionPane如何不尊重同步?   java Spring状态机访问eventNotAccepted侦听器中的StateContext   Java中的快速排序算法程序   java私有静态最终双精度为0   java中ByteBuffer的clear()方法   同步Java可重入锁的正确锁定/解锁用法   java拦截Couchbaselite中的CRUD操作   用于搜索广告的active directory Java程序   java为什么netty的handler成员变量在使用新handler()处理请求时不重置   java Mockito验证(…)fails“实际上,与此模拟没有任何交互。”按顺序在多个测试运行中   java为什么我的Alarmmanager在终止我的应用程序后不工作?   java如何正确排序groovy列表   一段时间后,java OAuth“401:无效凭据”   使用jtable和数据库在javaswing中进行分页   java如何在Android中将ASCII字符转换为字符串?   java如何运行。来自Javascript的jar方法   java Apache vfs:获取目录的最新更改文件(sftp)