Class BpSeq

    • Constructor Detail

      • BpSeq

        public BpSeq()
    • 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()