牛津纳米孔技术Fast5 API软件
ont-fast5-api的Python项目详细描述
ont_fast5_API
ont_fast5_api是牛津纳米孔hdf5文件的简单接口 fast5文件格式。
- 源代码:https://github.com/nanoporetech/ont_fast5_api
- fast5文件架构:https://github.com/nanoporetech/ont_h5_validator
它提供:
- 使用通用h5py库具体实现fast5文件模式
- 与fast5文件模式交互并反映该模式的纯英语命名方法
- 在多读和单读格式之间转换的工具
开始
pypi上提供了ont_fast5_api,可以通过pip安装:
pip install ont-fast5-api
或者,它也可以在github上使用,可以从源代码:
git clone https://github.com/nanoporetech/ont_fast5_api cd ont_fast5_api python setup.py install
依赖性
ont_fast5_api是一个纯python项目,应该在大多数python上运行 版本和操作系统。
它需要:
- h5py:2.2.1或更高版本
- NumPy:1.8.1或更高版本
- six:1.9或更高
- progressbar33:2.3.1或更高版本
接口-获取fast5文件
ont_fast5_api提供了一个简单的接口来访问fast5中的数据结构 使用相同方法调用的单读或多读格式的文件。
例如,打印文件中所有读取的原始数据:
from ont_fast5_api.fast5_interface import get_fast5_file def print_all_raw_data(): fast5_filepath = "test/data/single_reads/read0.fast5" # This can be a single- or multi-read file with get_fast5_file(fast5_filepath, mode="r") as f5: for read_id in f5.get_read_ids(): read = f5.get_read(read_id) raw_data = read.get_raw_data() print(read_id, raw_data)
界面-控制台脚本
ont_fast5_api为 在牛津nanoporesingle_read和 multi_readfast5格式。提供这些是为了确保 需要single_read或multi_readfast5文件的工具 格式。
脚本是在安装期间添加的,可以从 终端/命令行或来自python内部。
单对多快速5
此脚本将包含single_read_fast5文件的文件夹转换为 multi_read_fast5_files:
single_to_multi_fast5 -i, --input_path <(path) folder containing single_read_fast5 files> -s, --save_path <(path) to folder where multi_read fast5 files will be output> [optional] -t, --threads <(int) number of CPU threads to use; default=1> [optional] -f, --filename_base <(string) name for new multi_read file; default="batch" (see note-1)> [optional] -n, --batch_size <(int) number of single_reads to include in each multi_read file; default=4000> [optional] --recursive <(bool) if included, rescursively search sub-directories for single_read files; default=False>
note-1:新创建的multi_read文件需要一个名称。这是 filename_base并附加批次计数和.fast5;例如。 -f batch产生batch_0.fast5, batch_1.fast5, ...
示例用法:
single_to_multi_fast5 --input_path /data/reads --save_path /data/multi_reads --filename_base batch_output --batch_size 100 --recursive
其中/data/reads和/或其子文件夹包含single_readfast5 文件夹。输出将是multi_readfast5文件,每个文件包含100次读取, 在名为batch_output_0.fast5的文件夹中:/data/multi_reads, batch_output_1.fast5等。
多对单快速5
此脚本将包含multi_read_fast5文件的文件夹转换为 single_read_fast5文件:
multi_to_single_fast5 -i, --input_path <(path) folder containing multi_read_fast5 files> -s, --save_path <(path) to folder where single_read fast5 files will be output> [optional] -t, --threads <(int) number of CPU threads to use; default=1> [optional] --recursive <(bool) if included, rescursively search sub-directories for multi_read files; default=False>
示例用法:
multi_to_single_fast5 --input_path /data/multi_reads --save_path /data/single_reads --recursive
其中/data/multi_reads和/或其子文件夹包含multi_readfast5 文件夹。输出将是文件夹中的single_readfast5文件 /data/single_reads每个multi_read输入文件有一个子文件夹
fast5_子集
此脚本基于读取id的列表从multi_read_fast5_file(s)中提取读取内容:
fast5_subset -i, --input <(path) to folder containing multi_read_fast5 files or an individual multi_read_fast5 file> -s, --save_path <(path) to folder where multi_read fast5 files will be output> -l,--read_id_list <(file) either sequencing_summary.txt file or a file containing a list of read_ids> [optional] -f, --filename_base <(string) name for new multi_read file; default="batch" (see note-1)> [optional] -n, --batch_size <(int) number of single_reads to include in each multi_read file; default=4000> [optional] --recursive <(bool) if included, rescursively search sub-directories for single_read files; default=False>
示例用法:
fast5_subset --input /data/multi_reads --save_path /data/subset --read_id_list read_id_list.txt --batch_size 100 --recursive
其中/data/multi_reads和/或其子文件夹包含multi_readfast5 files和read_id_list.txt是一个文本文件,每行包含一个读取id 或者一个列名为read_id的tsv文件。 输出将是multi_readfast5文件,每个文件包含100次读取, 在名为batch_output_0.fast5的文件夹中:/data/multi_reads, batch_output_1.fast5等。
术语表:
hdf5文件格式-用于存储和管理的可移植文件格式 数据。它是为灵活和高效的I/O和高容量而设计的。 复杂数据 fast5-HDF5文件格式的实现,具有特定的数据 牛津纳米孔测序数据的模式 single read fast5-包含与 单牛津纳米孔阅读。这可能包括原始信号数据、运行元数据, fastq基本调用和任何其他附加分析 multi-read fast5-一个fast5文件,包含与multiple相关的数据 牛津纳米孔阅读。