pub struct ChainTable { /* private fields */ }Expand description
The chain table.
Implementations§
Source§impl ChainTable
impl ChainTable
Sourcepub fn push(
&mut self,
record: ChainRecord,
residues: Range<u32>,
) -> Result<ChainIndex, TableError>
pub fn push( &mut self, record: ChainRecord, residues: Range<u32>, ) -> Result<ChainIndex, TableError>
Appends a chain covering a range of residues.
§Errors
Returns TableError for a reversed range or exhausted index space.
Sourcepub fn residues(&self, chain: ChainIndex) -> Option<Range<u32>>
pub fn residues(&self, chain: ChainIndex) -> Option<Range<u32>>
The residues this chain contains.
Sourcepub fn containing(&self, residue: u32) -> Option<ChainIndex>
pub fn containing(&self, residue: u32) -> Option<ChainIndex>
Finds the chain whose contiguous range contains residue.
Chain ranges are ordered, so this is logarithmic in the chain count.
§Panics
Panics only if the table exceeds the core’s u32 position limit.
Sourcepub fn label_asym_id(&self, chain: ChainIndex) -> Option<SymbolId>
pub fn label_asym_id(&self, chain: ChainIndex) -> Option<SymbolId>
The normalised chain label.
Sourcepub fn auth_asym_id(&self, chain: ChainIndex) -> Option<SymbolId>
pub fn auth_asym_id(&self, chain: ChainIndex) -> Option<SymbolId>
The depositor’s chain label, if the file carried one.
Sourcepub fn rename(
&mut self,
chain: ChainIndex,
label: SymbolId,
) -> Result<(), TableError>
pub fn rename( &mut self, chain: ChainIndex, label: SymbolId, ) -> Result<(), TableError>
Replaces both chain namespaces with one explicit label.
Renaming both prevents a writer from silently preferring the old depositor label over the requested new normalised label.
§Errors
Returns TableError when chain is absent.
Sourcepub fn relabel(
&mut self,
chain: ChainIndex,
label: SymbolId,
) -> Result<(), TableError>
pub fn relabel( &mut self, chain: ChainIndex, label: SymbolId, ) -> Result<(), TableError>
Replaces the normalised label only, leaving the depositor label alone.
§Errors
Returns TableError when chain is absent.
Sourcepub fn entity(&self, chain: ChainIndex) -> Option<EntityIndex>
pub fn entity(&self, chain: ChainIndex) -> Option<EntityIndex>
The species this chain instantiates.
Sourcepub fn polymer_kind(&self, chain: ChainIndex) -> Option<PolymerKind>
pub fn polymer_kind(&self, chain: ChainIndex) -> Option<PolymerKind>
What kind of polymer this chain is.
Sourcepub fn set_polymer_kind(
&mut self,
chain: ChainIndex,
kind: PolymerKind,
) -> Result<(), TableError>
pub fn set_polymer_kind( &mut self, chain: ChainIndex, kind: PolymerKind, ) -> Result<(), TableError>
Reclassifies a chain after component chemistry has been resolved.
§Errors
Returns TableError when chain is absent.
Sourcepub fn instances_of(
&self,
entity: EntityIndex,
) -> impl Iterator<Item = ChainIndex> + '_
pub fn instances_of( &self, entity: EntityIndex, ) -> impl Iterator<Item = ChainIndex> + '_
Every chain that instantiates entity.
This is the copies-of-the-same-molecule question, answered by reading a column rather than by comparing sequences.
Sourcepub fn iter(&self) -> impl Iterator<Item = ChainIndex> + '_
pub fn iter(&self) -> impl Iterator<Item = ChainIndex> + '_
Every chain position.
Trait Implementations§
Source§impl Clone for ChainTable
impl Clone for ChainTable
Source§impl Debug for ChainTable
impl Debug for ChainTable
Auto Trait Implementations§
impl Freeze for ChainTable
impl RefUnwindSafe for ChainTable
impl Send for ChainTable
impl Sync for ChainTable
impl Unpin for ChainTable
impl UnsafeUnpin for ChainTable
impl UnwindSafe for ChainTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more