Class BlockImpl
java.lang.Object
org.biojava.nbio.structure.align.multiple.AbstractScoresCache
org.biojava.nbio.structure.align.multiple.BlockImpl
- All Implemented Interfaces:
Serializable,Cloneable,Block,ScoresCache
General implementation of a
Block that supports any type of
sequential alignment with gaps.- Since:
- 4.1.0
- Author:
- Aleix Lafita
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cached scores.clone()Creates and returns an identical copy of this block.Returns the double List containing the aligned residues for each structure.Returns the number of non null positions (residues) of each structure in the alignment Block.Returns the parent BlockSet of the Block.intReturns the number of aligned positions (columns) without gaps in the Block.intgetFinalIndex(int str) Calculates and returns the last position of the specified structure in the alignment that is not null.intgetFinalResidue(int str) Calculates and returns the last residue of the specified structure in the alignment that is not null.intgetStartIndex(int str) Calculates and returns the first position of the specified structure in the alignment that is not null.intgetStartResidue(int str) Calculates and returns the first residue of the specified structure in the alignment that is not null.intlength()Returns the total number of aligned positions (columns) in the Block.voidsetAlignRes(List<List<Integer>> alignRes) Set the double List containing the aligned residues for each structure.voidsetBlockSet(BlockSet parent) Set the back-reference to its parent BlockSet.intsize()Returns the number of aligned structures (rows) in the Block.toString()protected voidMethods inherited from class org.biojava.nbio.structure.align.multiple.AbstractScoresCache
clone, getScore, getScores, putScoreMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.nbio.structure.align.multiple.ScoresCache
getScore, getScores, putScore
-
Constructor Details
-
BlockImpl
Constructor. Links also the parent to this instance, by adding the Block to the parent's list.- Parameters:
blockSet- the parent BlockSet of the BlockImpl instance.
-
BlockImpl
Copy constructor.- Parameters:
b- BlockImpl object to be copied.
-
-
Method Details
-
clone
Description copied from interface:BlockCreates and returns an identical copy of this block. -
clear
Description copied from class:AbstractScoresCacheClear the cached scores. This frees memory after the alignment changed.- Specified by:
clearin interfaceBlock- Overrides:
clearin classAbstractScoresCache
-
toString
-
setBlockSet
Description copied from interface:BlockSet the back-reference to its parent BlockSet.- Specified by:
setBlockSetin interfaceBlock- Parameters:
parent- the parent BlockSet.- See Also:
-
getBlockSet
Description copied from interface:BlockReturns the parent BlockSet of the Block. Returns null if there is no referenced object.- Specified by:
getBlockSetin interfaceBlock- Returns:
- BlockSet the parent BlockSet of the Block, or null.
- See Also:
-
getAlignRes
Description copied from interface:BlockReturns the double List containing the aligned residues for each structure.alignRes.get(structure).get(residue) = alignRes.get(size).get(length).
- Specified by:
getAlignResin interfaceBlock- Returns:
- List a double List of aligned residues for each structure.
- See Also:
-
setAlignRes
Description copied from interface:BlockSet the double List containing the aligned residues for each structure.- Specified by:
setAlignResin interfaceBlock- Parameters:
alignRes- a double List of Integers with the aligned residues.- See Also:
-
length
Description copied from interface:BlockReturns the total number of aligned positions (columns) in the Block. -
size
Description copied from interface:BlockReturns the number of aligned structures (rows) in the Block. -
getCoreLength
Description copied from interface:BlockReturns the number of aligned positions (columns) without gaps in the Block.- Specified by:
getCoreLengthin interfaceBlock- Returns:
- int number of aligned residues.
- See Also:
-
updateCoreLength
-
getStartIndex
Description copied from interface:BlockCalculates and returns the first position of the specified structure in the alignment that is not null. This will return the alignment index, not the residue aligned in that position.- Specified by:
getStartIndexin interfaceBlock- Parameters:
str- structure index- Returns:
- the first non null aligned position of the structure
-
getStartResidue
Description copied from interface:BlockCalculates and returns the first residue of the specified structure in the alignment that is not null. This will return the aligned residue, not the alignment index.- Specified by:
getStartResiduein interfaceBlock- Parameters:
str- structure index- Returns:
- the first non null aligned residue of the structure
-
getFinalIndex
Description copied from interface:BlockCalculates and returns the last position of the specified structure in the alignment that is not null. This will return the alignment index, not the residue aligned in that position.- Specified by:
getFinalIndexin interfaceBlock- Parameters:
str- structure index- Returns:
- the last non null aligned position of the structure
-
getFinalResidue
Description copied from interface:BlockCalculates and returns the last residue of the specified structure in the alignment that is not null. This will return the aligned residue, not the alignment index.- Specified by:
getFinalResiduein interfaceBlock- Parameters:
str- structure index- Returns:
- the last non null aligned residue of the structure
-
getAlignResCounts
Description copied from interface:BlockReturns the number of non null positions (residues) of each structure in the alignment Block. The values can be used to compute the coverages.- Specified by:
getAlignResCountsin interfaceBlock- Returns:
- List of residue counts for each structure
-