nuget server logo nuget api documents
↑

API Docs / SMRUCC.genomics.Core / GenomeContext

GenomeContext

Full name SMRUCC.genomics.ContextModel.GenomeContext`1 Assembly SMRUCC.genomics.Core Members 32

表示一个基因组上下文模型,用于在内存中高效地存储、索引和查询基因组特征(如基因)。

00 Remarks

此对象在初始化时会对基因按照物理位置和链方向进行排序和索引, 从而将区间查询的时间复杂度优化至 O(log N) 或通过提前跳出优化至近似 O(N)。

注意:此类假设输入的基因组特征集合是基于同一条染色体或重叠群 的, 跨越不同染色体的特征不应放入同一个上下文实例中。

Type Parameters
NameDescription
T

基因组特征的类型,必须实现 IGeneBrief 接口。

01 Syntax

SMRUCC.genomics.ContextModel.GenomeContext`1

02 Methods

NameOverloadsSummary
.ctor 1 使用基因组特征集合初始化 GenomeContext 类的新实例。 此构造函数会执行数据预处理:按特征名分组、按链方向和物理坐标排序、计算基因组大小。
selectByStrand 1 A helper function for the constructor to select genes by strand and store them in the corresponding arrays.
GeneDensity 1 获取指定滑动窗口内的基因密度 (基因数量 / 窗口大小)
SelectByPosition 1 查找距离指定坐标位点一定半径范围内的所有feature
GetPhysicalNeighbours 1 获取指定基因在基因组物理位置上的左侧和右侧紧邻基因
GetDirectionalNeighbours 1 获取指定基因在转录方向上的上游和下游紧邻基因
FindOverlaps 1 查找与指定位点存在重叠的所有基因
IsOverlapping 1 判断两个特征区间是否存在物理重叠
GetPhysicalDistance 1 计算两个位点的物理距离。如果重叠,返回0
GetFeatureDistance 1 计算两个基因特征之间的最短物理距离
SearchByProduct 1 根据基因产物的注释关键词模糊搜索基因
GetGenesByProduct 1 获取所有具有相同功能注释的基因集合
GetNearbyFeatures 1 查找指定位点附近上下游范围内的feature。此函数会考虑链的方向性: 对于正链,上游为坐标减小方向,下游为坐标增大方向; 对于负链,上游为坐标增大方向,下游为坐标减小方向。
GetNearbyFeaturesByName 1 查找指定名称的feature附近上下游范围内的feature
Delta 1 count the number of genes between feature 1 and feature 2.
SelectByRange 1 将基因组上面的某一区域内的基因对象都查找出来
GetByFeature 1 Get features data via a given key id
Absent 1 Check of the target feature is missing inside this genomics context model?
GenericEnumerator 1 populate out the genomics feature GenomeContext.sequence data
ToString 1

03 Properties

NameOverloadsSummary
contextName 1 当前基因组上下文的名称(如染色体名称或菌株名称)。
Feature 2 通过物理位置索引获取基因组特征
N 1 The number of genes in this genome
size 1 得到根据所输入的位点信息估算出目标基因组可能的大小
AllFeatureKeys 1 获取当前基因组中所有不重复的特征标签名称。
AverageGeneLength 1 计算全基因组的平均基因长度
AverageIntergenicDistance 1 计算全基因组的平均基因间距

04 Fields

NameOverloadsSummary
plus 1 正链基因集合。按照 Location.left 升序排列。
minus 1 负链基因集合。按照 Location.right 降序排列(符合负链转录方向)。
sequence 1 所有基因的统一物理位置序列。严格按照 Location.left 从小到大排序。 此数组是执行区间范围查询的基础,确保了空间局部性和提前跳出循环的正确性。
featureTags 1 按照 IFeatureDigest.Feature 关键字分组的基因字典,用于快速按名称检索。

05 Members

method .ctor #
#ctor(IEnumerable(Of `0), String)

使用基因组特征集合初始化 GenomeContext 类的新实例。 此构造函数会执行数据预处理:按特征名分组、按链方向和物理坐标排序、计算基因组大小。

Parameters
NameTypeDescription
genomeIEnumerable(Of `0)

基因组特征的集合。

nameString

上下文名称,默认为 "unnamed"。

method selectByStrand #
selectByStrand(Strands)

A helper function for the constructor to select genes by strand and store them in the corresponding arrays.

Parameters
NameTypeDescription
strandStrands

-

method GeneDensity #
GeneDensity(Int32, Int32)

获取指定滑动窗口内的基因密度 (基因数量 / 窗口大小)

Parameters
NameTypeDescription
startInt32

窗口起始

endInt32

窗口结束

method SelectByPosition #
SelectByPosition(Int32, Int32, Strands)

查找距离指定坐标位点一定半径范围内的所有feature

Parameters
NameTypeDescription
positionInt32

基因组上的具体坐标点

radiusInt32

上下游的查找半径

strandStrands

限制查找的链方向,默认为Unknown,即双向都查找

method GetPhysicalNeighbours #
GetPhysicalNeighbours(`0, Int32)

获取指定基因在基因组物理位置上的左侧和右侧紧邻基因

Parameters
NameTypeDescription
gene`0

目标基因

distanceLimitInt32

最大允许的物理间距,超过此间距则认为不相邻,默认无限制

Returns

包含左侧邻居和右侧邻居的元组

method GetDirectionalNeighbours #
GetDirectionalNeighbours(`0, Int32)

获取指定基因在转录方向上的上游和下游紧邻基因

method FindOverlaps #
FindOverlaps(NucleotideLocation, Boolean)

查找与指定位点存在重叠的所有基因

Parameters
NameTypeDescription
lociNucleotideLocation

目标位点

overlapStrandBoolean

是否要求必须在同一条链上重叠

method IsOverlapping #
IsOverlapping(String, String)

判断两个特征区间是否存在物理重叠

method GetPhysicalDistance #

计算两个位点的物理距离。如果重叠,返回0

method GetFeatureDistance #
GetFeatureDistance(String, String)

计算两个基因特征之间的最短物理距离

method SearchByProduct #
SearchByProduct(String, Boolean)

根据基因产物的注释关键词模糊搜索基因

Parameters
NameTypeDescription
keywordString

搜索关键词

ignoreCaseBoolean

是否忽略大小写,默认忽略

method GetGenesByProduct #
GetGenesByProduct(String, Boolean)

获取所有具有相同功能注释的基因集合

method GetNearbyFeatures #
GetNearbyFeatures(NucleotideLocation, Int32, Int32, Boolean, Strands)

查找指定位点附近上下游范围内的feature。此函数会考虑链的方向性: 对于正链,上游为坐标减小方向,下游为坐标增大方向; 对于负链,上游为坐标增大方向,下游为坐标减小方向。

Parameters
NameTypeDescription
lociNucleotideLocation

参考位点

upstreamInt32

上游延伸长度

downstreamInt32

下游延伸长度

includeSelfBoolean

是否包含与参考位点完全重叠的feature

strandStrands

限制查找的链方向,默认为Unknown,即双向都查找

method GetNearbyFeaturesByName #
GetNearbyFeaturesByName(String, Int32, Int32, Boolean, Strands)

查找指定名称的feature附近上下游范围内的feature

Parameters
NameTypeDescription
featureNameString

目标feature的名称

upstreamInt32

上游延伸长度

downstreamInt32

下游延伸长度

includeSelfBoolean

是否包含目标feature自身

strandStrands

限制查找的链方向

method Delta #
Delta(String, String)

count the number of genes between feature 1 and feature 2.

Parameters
NameTypeDescription
feature1String

-

feature2String

-

method SelectByRange #
SelectByRange(Int32, Int32, Strands)

将基因组上面的某一区域内的基因对象都查找出来

Parameters
NameTypeDescription
iInt32

left position

jInt32

right position

strandStrands

默认不限制链的方向

method GetByFeature #
GetByFeature(String)

Get features data via a given key id

Parameters
NameTypeDescription
featureString

-

method Absent #
Absent(String)

Check of the target feature is missing inside this genomics context model?

Parameters
NameTypeDescription
featureString

-

method GenericEnumerator #
GenericEnumerator

populate out the genomics feature GenomeContext.sequence data

property contextName #
contextName

当前基因组上下文的名称(如染色体名称或菌株名称)。

property Feature #
Feature(Int32)

通过物理位置索引获取基因组特征

Parameters
NameTypeDescription
iInt32

在 GenomeContext.sequence 中的零基索引。

Returns

对应位置的特征对象。

property Feature overload 2 #
Feature(String)

通过特征名称获取基因组特征。如果存在同名特征,返回第一个匹配项。

Parameters
NameTypeDescription
nameString

特征的唯一标识符或功能名称。

Returns

匹配的特征对象,如果未找到则返回类型的默认值 (Nothing)。

property N #
N

The number of genes in this genome

property size #
size

得到根据所输入的位点信息估算出目标基因组可能的大小

property AllFeatureKeys #
AllFeatureKeys

获取当前基因组中所有不重复的特征标签名称。

Returns

特征标签字符串数组。

property AverageGeneLength #
AverageGeneLength

计算全基因组的平均基因长度

property AverageIntergenicDistance #
AverageIntergenicDistance

计算全基因组的平均基因间距

field plus #
plus

正链基因集合。按照 Location.left 升序排列。

field minus #
minus

负链基因集合。按照 Location.right 降序排列(符合负链转录方向)。

field sequence #
sequence

所有基因的统一物理位置序列。严格按照 Location.left 从小到大排序。 此数组是执行区间范围查询的基础,确保了空间局部性和提前跳出循环的正确性。

field featureTags #
featureTags

按照 IFeatureDigest.Feature 关键字分组的基因字典,用于快速按名称检索。

method ToString #
ToString()