有根Newick分类单元裁剪
在声明为有根的Newick树中保留或删除指定taxa,保持原根、未知边长、注释与精确十进制收缩记录。
- 1添加输入
- 2调整设置
- 3获取结果
工具输入和文件在当前浏览器处理,不会上传。
开始之前
提供一棵有根树及精确叶标签JSON列表。每个保留、删除、缺失或重复请求都可追溯到原件,并下载带完整来源的修改后Newick。
如何使用
- 选择一棵有根UTF-8树并确认声明,用JSON数组输入精确标签。
- 选择保留或删除,检查存活/删除taxa、未匹配请求和精确边长变更。
- 下载新Newick及完整JSON/CSV,先核对原根路径和未知长度状态。
支持范围与限制
单棵UTF-8 Newick最多5 MiB,可含BOM;taxa JSON数组最多1 MiB。最多50,000节点、10,000内部括号深度、10,000请求;每个解码标签与数值token最多4,096个UTF-16单位,指数绝对值最多100。完整JSON、CSV和Newick合计最多20 MiB。
必须声明输入为有根树。保留/删除按精确区分大小写的叶标签,下划线保持文字;支持单引号标签和连续两个单引号转义。原树重复叶标签会整批拒绝,重复请求及未匹配标签分别保留。
原根及其边长保持。仅当非根单子节点没有标签/注释,且其边长与存活子节点边长都存在时才收缩,十进制加法精确且不受float64范围限制;缺失边长保持未知,不改成零。
存活内部标签/support与注释仍附在对应节点;含注释或未知长度的单子节点保持。不做MRCA提取、重新定根、无根最小子树搜索、严格最少节点优化或生物学推断。
匿名叶及[&U]等其它前置directive不在此profile内,[&R]会保留;不代表这些形式违反Newick标准。删除全部叶会整批拒绝,请调整模式或列表至少保留一叶。
完整JSON保存两份原输入与hash、全部原节点/边长跨度、所有请求(包括重复)、保留/删除/未匹配taxa与精确收缩记录。CSV包含所有原taxon及未匹配唯一请求。预览200行,每格2,000个UTF-16单位;大报告复制只有明确预览,完整下载原子交付。
操作示例
示例输入
((raccoon,bear),((sea_lion,seal),((monkey,cat),weasel)),dog);
示例参数
{"secondary":"[\"raccoon\",\"sea_lion\"]","params":{"rooted":true,"mode":"keep","spreadsheetSafe":true}}示例输出
{"source":{"name":"pasted.txt","bytes":61,"sha256":"012acf1a865f4aaf4df104c3f133fd2d35fcaa2c567e3a4bfa007cdb09a5b2be","encoding":"UTF-8","bomRetained":false},"sourceText":"((raccoon,bear),((sea_lion,seal),((monkey,cat),weasel)),dog);","taxaSource":{"text":"[\"raccoon\",\"sea_lion\"]","bytes":22,"sha256":"86125ef83d644c9874454f8a09481021f4920040bf9cd01c163cab4ad0974a2b"},"summary":{"inputNodes":14,"inputTaxa":8,"keptTaxa":2,"removedTaxa":6,"notFound":0,"requestedTaxa":2,"duplicateRequests":0,"contractions":0,"maxDepth":4,"originalRootRetained":true,"status":"rooted-taxa-pruned"},"requestedTaxa":["raccoon","sea_lion"],"uniqueRequestedTaxa":2,"duplicateRequests":[],"inputNodes":14,"maxDepth":4,"originalRootRetained":true,"rootDirective":"","nodeRecords":[{"index":0,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[1,4,13],"sourceSpan":{"utf8Start":0,"utf8Bytes":60},"lengthSpan":null},{"index":1,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[2,3],"sourceSpan":{"utf8Start":1,"utf8Bytes":14},"lengthSpan":null},{"index":2,"name":"raccoon","rawName":"raccoon","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":2,"utf8Bytes":7},"lengthSpan":null},{"index":3,"name":"bear","rawName":"bear","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":10,"utf8Bytes":4},"lengthSpan":null},{"index":4,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[5,8],"sourceSpan":{"utf8Start":16,"utf8Bytes":39},"lengthSpan":null},{"index":5,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[6,7],"sourceSpan":{"utf8Start":17,"utf8Bytes":15},"lengthSpan":null},{"index":6,"name":"sea_lion","rawName":"sea_lion","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":18,"utf8Bytes":8},"lengthSpan":null},{"index":7,"name":"seal","rawName":"seal","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":27,"utf8Bytes":4},"lengthSpan":null},{"index":8,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[9,12],"sourceSpan":{"utf8Start":33,"utf8Bytes":21},"lengthSpan":null},{"index":9,"name":null,"rawName":"","comments":[],"rawLength":null,"children":[10,11],"sourceSpan":{"utf8Start":34,"utf8Bytes":12},"lengthSpan":null},{"index":10,"name":"monkey","rawName":"monkey","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":35,"utf8Bytes":6},"lengthSpan":null},{"index":11,"name":"cat","rawName":"cat","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":42,"utf8Bytes":3},"lengthSpan":null},{"index":12,"name":"weasel","rawName":"weasel","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":47,"utf8Bytes":6},"lengthSpan":null},{"index":13,"name":"dog","rawName":"dog","comments":[],"rawLength":null,"children":null,"sourceSpan":{"utf8Start":56,"utf8Bytes":3},"lengthSpan":null}],"contractionRecords":[],"keptTaxa":["raccoon","sea_lion"],"removedTaxa":["bear","seal","monkey","cat","weasel","dog"],"notFound":[],"mode":"keep","rootPolicy":"original-root-inclusive-declared-paths-not-MRCA","contractions":0,"underscoreMode":"literal-preserve","annotatedUnary":"retained","scope":"User-declared rooted ordinary single Newick. Original root and root edge retained. Unknown edge lengths are not zero; only unlabeled/unannotated non-root unary nodes with both known finite decimals contract by exact arithmetic. No rerooting, unrooted/MRCA subtree, strict minimum nodes or biological inference."}出现问题时
确认有根profile,修正Newick/JSON语法并明确保留或删除模式,至少保留一个有名叶。用可信流程处理原树重复标签。超限时减少输入、请求或完整收缩报告体量;取消不交付部分树。
常见问题
是否得到包含指定taxa的最小子树?
本工具保留原根及声明根路径,不选MRCA或重新定根。带注释或未知边长的单子节点也保留,因此不声称严格最少节点。
未知边长怎么处理?
保持未知。用于收缩的任一长度缺失时,父节点会保留,不补零,也不推断距离。
下划线会替换为空格吗?
不会,此profile将下划线视为原文字。含空格或特殊标点的Newick标签请加单引号,JSON列表中输入精确解码标签。