nuget server logo nuget api documents
↑

API Docs / SMRUCC.genomics.Analysis.SequenceAlignment / Output

Output

Full name SMRUCC.genomics.Analysis.SequenceAlignment.BestLocalAlignment.Output Assembly SMRUCC.genomics.Analysis.SequenceAlignment Members 7

Smith-Waterman 局部比对的完整输出结果。

00 Remarks

该对象是一个重量级结果容器:Output.DP 与 Output.Directions 均为按行包装的动态规划矩阵视图,其内存占用与 query*subject 成正比 (千级长度的蛋白序列比对即可达到数十 MB),并且这些行数组会进入大对象堆(LOH)。

特别注意 Output.Directions 的构建代价:它由方向矩阵(Integer)逐行 转换成 Double 数组,元素被放大到 8 字节;而 Output.DP 又是得分矩阵的 一份完整副本。也就是说单次比对会额外产生两份与 query*subject 等大的 Double 矩阵,与算法自身持有的矩阵叠加后内存放大到约三倍。

因此本类实现了 IDisposable:在批量/循环比对场景中,请使用 Using 语句或显式调用 Output.Dispose() 及时切断对矩阵的引用。 若只需要得分最高的一条比对结果,应改用轻量级接口 GSW.GetBestHSP(),它完全不会构建本对象。

01 Syntax

SMRUCC.genomics.Analysis.SequenceAlignment.BestLocalAlignment.Output

02 Methods

NameOverloadsSummary
CreateObject 1
Dispose 1 释放本对象所持有的动态规划矩阵引用。
eraseMatrix 1 逐行切断矩阵视图对底层行数组的引用。

03 Properties

NameOverloadsSummary
Best 1 best chain, 但是不明白这个有什么用途
HSP 1 最佳的比对结果
DP 1 Dynmaic programming matrix.(也可以看作为得分矩阵)
Directions 1 The directions pointing to the cells that give the maximum score at the current cell.

04 Members

method CreateObject #
CreateObject``1(GSW(Of ``0), Double, Int32)
Type Parameters
NameDescription
T
Parameters
NameTypeDescription
swGSW(Of ``0)

-

thresholdDouble

0% - 100%

method Dispose #
Dispose(Boolean)

释放本对象所持有的动态规划矩阵引用。

Remarks

Output.DP / Output.Directions 的每一个元素都是一行矩阵数据的包装, 每行都是一个独立的 Double 数组,长度与序列长度同阶,足以进入大对象堆(LOH)。 这里先逐行置空,再释放外层数组,确保这些大数组在本对象被丢弃后可以立即被 GC 回收, 而不是滞留在大对象堆中造成常驻内存持续增长。

Output.Best / Output.Query / Output.Subject 属于小对象, 通常需要在 Dispose 之后继续使用(例如返回给调用方),因此不在此处清理。

method eraseMatrix #
eraseMatrix(ArrayRow())

逐行切断矩阵视图对底层行数组的引用。

property Best #
Best

best chain, 但是不明白这个有什么用途

property HSP #
HSP

最佳的比对结果

property DP #
DP

Dynmaic programming matrix.(也可以看作为得分矩阵)

property Directions #
Directions

The directions pointing to the cells that give the maximum score at the current cell. The first index is the column index. The second index is the row index.