Package pl.poznan.put.structure.formats
Class BpSeq
- java.lang.Object
-
- pl.poznan.put.structure.formats.BpSeq
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ImmutableBpSeq
@Immutable public abstract class BpSeq extends Object implements Serializable
RNA secondary structure in BPSEQ format.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBpSeq.EntryAn entry of a BPSEQ data.
-
Constructor Summary
Constructors Constructor Description BpSeq()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SortedSet<BpSeq.Entry>entries()static BpSeqfromBasePairs(List<PdbNamedResidueIdentifier> residues, Collection<? extends ClassifiedBasePair> basePairs)Creates an instance of BPSEQ from a list of residue identifiers and a list of base pairs.static BpSeqfromCt(Ct ct)Converts RNA secondary structure in CT format to BPSEQ format.static BpSeqfromDotBracket(DotBracket db)Converts RNA secondary structure in dot-bracket format to BPSEQ format.static BpSeqfromString(String data)Parses string into an instance of this class.booleanhasAnyPair()SortedSet<BpSeq.Entry>paired()Stringsequence()intsize()StringtoString()protected voidvalidate()BpSeqwithoutIsolatedPairs()Finds all isolated base pairs and creates a copy of this instance without them.BpSeqwithoutPair(BpSeq.Entry entry)Creates a copy of this instance, but with the given pair removed.
-
-
-
Method Detail
-
fromString
public static BpSeq fromString(String data)
Parses string into an instance of this class.- Parameters:
data- The string with BPSEQ data.- Returns:
- An instance of this class with parsed data.
-
fromCt
public static BpSeq fromCt(Ct ct)
Converts RNA secondary structure in CT format to BPSEQ format.- Parameters:
ct- The data in CT format.- Returns:
- An instance of this class with converted data.
-
fromDotBracket
public static BpSeq fromDotBracket(DotBracket db)
Converts RNA secondary structure in dot-bracket format to BPSEQ format.- Parameters:
db- The data in dot-bracket format.- Returns:
- An instance of this class with converted data.
-
fromBasePairs
public static BpSeq fromBasePairs(List<PdbNamedResidueIdentifier> residues, Collection<? extends ClassifiedBasePair> basePairs)
Creates an instance of BPSEQ from a list of residue identifiers and a list of base pairs. The PDB chains are automatically reordered so that connecting ones are next to each other.- Parameters:
residues- The list of residue identifiers with names.basePairs- The list of base pairs.- Returns:
- An instance of this class.
-
entries
@Parameter(order=1) @NaturalOrder public abstract SortedSet<BpSeq.Entry> entries()
- Returns:
- The list of BPSEQ entries.
-
sequence
public final String sequence()
- Returns:
- The sequence of nucleotides stored in this object.
-
paired
public final SortedSet<BpSeq.Entry> paired()
- Returns:
- The set of paired BPSEQ entries without duplicates. For example, pair (4, 15) will not be repeated as (15, 4).
-
size
public final int size()
- Returns:
- The number of BPSEQ entries.
-
hasAnyPair
public final boolean hasAnyPair()
- Returns:
- True if at least one BPSEQ entry stands for a pair.
-
withoutIsolatedPairs
public final BpSeq withoutIsolatedPairs()
Finds all isolated base pairs and creates a copy of this instance without them.- Returns:
- A copy of this instance, but with all isolated base pairs removed.
-
withoutPair
public final BpSeq withoutPair(BpSeq.Entry entry)
Creates a copy of this instance, but with the given pair removed.- Parameters:
entry- The pair to remove.- Returns:
- A copy of this instance without the given pair.
-
validate
@Check protected void validate()
-
-