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


热门话题
反射Java反射:高负载下的NoSuchMethodException   java RxJava:one request>list of Integer>sequence of requests for each int>result to list   java为什么循环之前索引会增加   JavaSpring远程处理和RESTfulURL   java Hibernate搜索仅对我的实体的一部分进行索引   使用DPAD快速滚动时,java RecyclerView onCreateViewHolder调用过多   java将JSON解析到一个表中   java导航抽屉标题textview nullpointerexception   基于接口的Java链接队列   java Guice运行时依赖项参数重新注入   java展平/压缩ZSH中的深度嵌套目录   JavaSpring:Http406此请求标识的资源只能   java如何制作Android启动器图标   Java代码在windows上显示不正确(包含希腊语句子)   使用yourkit进行内存分析所用的java时间   java为什么可以序列化属性而不能序列化对象本身?