跳转至

数据划分:参数与补充说明

用法和示例见功能教程。

各功能按作用、API、输入、输出、示例代码和结果说明介绍。运行前按说明准备凭据、本地文件与可选依赖;远程结果随数据库版本与查询时间变化。

ENCODE 接口返回文本:多数是 JSON,get_citations 可返回 BibTeX/RIS,export_data 可返回 CSV/TSV。仅 JSON 文本使用 json.loads()。追踪与凭据保存在 ~/.dnakit-encode/;持久化凭据功能需要 dnakit[encode-credentials]。

比较 ENCODE 实验的联合分析兼容性

dnakit.encode.compare_experiments(accession1, accession2, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
accession1 str 必填 First experiment accession (e.g., "ENCSR133RZO")
accession2 str 必填 Second experiment accession (e.g., "ENCSR000AKS")
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

将追踪的 ENCODE 实验导出为表格

dnakit.encode.export_data(format='csv', assay_title=None, organism=None, organ=None, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
format Literal['csv', 'tsv', 'json'] 'csv' Output format: - "csv": Comma-separated values (default, for Excel/spreadsheets) - "tsv": Tab-separated values (for R, pandas) - "json": JSON array (for programmatic use)
assay_title str | None None Filter by assay type (partial match)
organism str | None None Filter by organism (partial match)
organ str | None None Filter by organ (partial match)
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

获取追踪实验的论文与参考文献

dnakit.encode.get_citations(accession=None, export_format='json', *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
accession str | None None Specific experiment accession. If None, returns all publications.
export_format Literal['json', 'bibtex', 'ris'] 'json' Output format: - "json": Structured data (default) - "bibtex": BibTeX format for LaTeX - "ris": RIS format (Endnote, Zotero, Mendeley)
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

查询衍生文件的来源记录

dnakit.encode.get_provenance(file_path=None, source_accession=None, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
file_path str | None None Get provenance for a specific derived file
source_accession str | None None List all files derived from a specific ENCODE accession
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

查询实验关联的外部参考标识

dnakit.encode.get_references(experiment_accession=None, reference_type=None, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
experiment_accession str | None None Filter by specific experiment (optional)
reference_type Literal['pmid', 'doi', 'nct_id', 'preprint_doi', 'geo_accession', 'other'] | None None Filter by reference type (optional): "pmid", "doi", "nct_id", "preprint_doi", "geo_accession", "other"
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

dnakit.encode.link_reference(experiment_accession, reference_type, reference_id, description='', *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
experiment_accession str 必填 ENCODE experiment accession (e.g., "ENCSR133RZO")
reference_type Literal['pmid', 'doi', 'nct_id', 'preprint_doi', 'geo_accession', 'other'] 必填 Type of external reference: - "pmid": PubMed ID (e.g., "32728249") - "doi": DOI (e.g., "10.1038/s41586-020-2493-4") - "nct_id": ClinicalTrials.gov ID (e.g., "NCT04567890") - "preprint_doi": bioRxiv/medRxiv DOI - "geo_accession": GEO accession (e.g., "GSE123456") - "other": Any other identifier
reference_id str 必填 The actual identifier value
description str '' Optional description of why this reference is linked
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

列出本地追踪的 ENCODE 实验

dnakit.encode.list_tracked(assay_title=None, organism=None, organ=None, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
assay_title str | None None Filter by assay type (partial match)
organism str | None None Filter by organism (partial match)
organ str | None None Filter by organ (partial match)
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

登记衍生文件与数据来源

dnakit.encode.log_derived_file(file_path, source_accessions, description='', file_type='', tool_used='', parameters='', *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
file_path str 必填 Path to the derived file you created
source_accessions list[str] 必填 List of ENCODE accessions this file was derived from (experiment or file accessions, e.g., ["ENCSR133RZO", "ENCFF635JIA"])
description str '' What this derived file contains
file_type str '' Type of file (e.g., "filtered_peaks", "merged_signal", "differential")
tool_used str '' Tool/software used to create it (e.g., "bedtools intersect", "DESeq2")
parameters str '' Parameters or command used
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

按字段汇总追踪的实验集合

dnakit.encode.summarize_collection(assay_title=None, organism=None, organ=None, *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
assay_title str | None None Filter by assay type (partial match)
organism str | None None Filter by organism (partial match)
organ str | None None Filter by organ (partial match)
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。

在本地追踪 ENCODE 实验及其来源信息

dnakit.encode.track_experiment(accession, fetch_publications=True, fetch_pipelines=True, notes='', *, verbose=True)

参数 类型 必填 / 默认值 说明与约束
accession str 必填 ENCODE experiment accession (e.g., "ENCSR133RZO")
fetch_publications bool True Also fetch and store publications/citations (default True)
fetch_pipelines bool True Also fetch and store pipeline/analysis info (default True)
notes str '' Optional notes to attach to this experiment
verbose bool True 是否显示 DNAKit 运行提示;不会改变返回值。