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
RNA secondary structure in BPSEQ format.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SortedSet<BpSeq.Entry>
entries()
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.static BpSeq
Converts RNA secondary structure in CT format to BPSEQ format.static BpSeq
Converts RNA secondary structure in dot-bracket format to BPSEQ format.static BpSeq
fromString
(String data) Parses string into an instance of this class.final boolean
final SortedSet<BpSeq.Entry>
paired()
final String
sequence()
final int
size()
final String
toString()
protected void
validate()
final BpSeq
Finds all isolated base pairs and creates a copy of this instance without them.final BpSeq
withoutPair
(BpSeq.Entry entry) Creates a copy of this instance, but with the given pair removed.
-
Constructor Details
-
BpSeq
public BpSeq()
-
-
Method Details
-
fromString
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
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
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
- Returns:
- The list of BPSEQ entries.
-
sequence
- Returns:
- The sequence of nucleotides stored in this object.
-
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
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
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.
-
toString
-
validate
@Check protected void validate()
-