Interface PairedReads

  • All Known Implementing Classes:
    CombinedAlignmentAndAminoAcidSequenceDocument, CombinedAlignmentAndNucleotideGraphSequenceDocument, CombinedAlignmentAndNucleotideSequenceDocument, CombinedAlignmentAndSequenceDocument, DefaultAlignmentDocument, DefaultPhylogenyDocument, DefaultSequenceListDocument, PairedReadManager, PhylogenyDocument, SequenceAlignmentDocument, SequenceGraph.SequencePropertyRetriever, SequenceViewerExtension.PropertyRetrieverAndEditor

    public interface PairedReads
    Provides data about whether nucleotide sequences are paired together and their expected paired distance.

    Different sequencing technologies have different relative orientations of reads. Geneious manages this by allowing each pair of a mate to specify its expected mate distance separately. For example, if unaligned pairs are:

    • Forward/Forward (solid) Then the first mate of the pair will have a positive expected distance to its mate and the second mate will have a negative expected distance.
    • Forward/Reverse (Illumina short read kit) Then the both mates in the pair will have positive expected distances
    • Reverse/Forward (Illumina long read kit) Then the both mates in the pair will have negative expected distances
    • Reverse/Reverse (454 from NCBI) Then the first mate of the pair will have a negative expected distance to its mate and the second mate will have a positive expected distance.

    The mate distance is defined as the length of the 2 reads plus the distance between them.

    Once sequences are placed in a SequenceAlignmentDocument, the expected distance now refers to where a sequence expects to find its mate. If a sequence is placed in the alignment without reverse-complementing, then its expected distance will remain the same as specified above. If the sequence is placed in an alignment reverse-complemented, then its expected distance will be negated (postive <-> negative). So, no matter what the sequencing technology used, when reads are correctly orientated in the alignment, the left-hand read will have a positive expected distance and the right-hand read will have a negative expected distance.

    For example, if aligned pairs are:

    • Forward/forward data, where the first mate has a positive expected distance and the second has a negative expected distance when unaligned, if they both align to the forward strand, then their expected distances remain the same. Alternatively, both could align to the reverse strand, in which case their relative order should change (first mate will be on the right and second mate will be on the left) so their expected distances get negated.
    • Forward/reverse data, where both mates have a positive expected distance when unaligned , if the first aligns to the forward strand and the second aligns to the reverse strand then the first will have a positive expected distance and the second will get negated to become a negative expected distance. Alternatively if the first aligns to the reverse strand and the second aligns to the forward strand then their relative order should change and so the first mate will end up with a negative expected distance and the second a positive expected distance in the alignment

    All SequenceAlignmentDocuments implements this interface. A SequenceListDocument can optionally implement this interface to provide paired read data.

    getMateIndex(int) returns the index of the mate sequence in the list (if any) and getMateExpectedDistance(int) returns the expected distance of the mate. getImmutablePairedReadManager() returns an immutable view of the paired properties and also provides additional functionality. See PairedReadManager

    The sequence viewer plugin displays paired reads with a little paired-read icon to the left of their name. For paired reads in an alignment, the sequence viewer also links them together on the same line as long as the 'Link Paired Reads' setting (under 'Advanced') is on. The sequence viewer also has a color scheme to color paired reads based on how close they are to their expected distance.

    Since:
    API 4.11 (Geneious 5.0)
    • Method Detail

      • getMateExpectedDistance

        int getMateExpectedDistance​(int sequenceIndex)
        Gets the expected mate distance (also known as predicted median insert size) of this nucleotide sequence from its mate. This is defined as the length of the 2 reads plus the distance between them. For example if the 2 reads both have length 30 with a 40 bp gap between them, then the expected mate distance is 100. If the mate is expected to appear after this sequence with this sequence in its current orientation, then the expected distance will be positive. If the mate is expected to appear before this sequence with this sequence in its current orientation, then the expected distance will be negative.
        Parameters:
        sequenceIndex - the index of the nucleotide sequence for which to get the mate index of.
        Returns:
        the expected mate distance or 0 if this read is not paired. Note that a read may still have a mate distance!=0 but its mate may not be present in this document (in which case getMateIndex(int) will be -1.
        See Also:
        getMateIndex(int)
      • getMateIndex

        int getMateIndex​(int sequenceIndex)
        Gets the index of the mate (if any) of the nucleotide/protein sequence at this index. PairedReads can only contain pairs of either nucleotides or proteins. Therefore the indexes handled by this method correspond with the index of a sequence in either SequenceListDocument.getNucleotideSequences() or SequenceListDocument.getAminoAcidSequences() or SequenceAlignmentDocument.getSequences() If a list contains both protein and nucleotides sequences, the paired reads correspond to the nucleotide sequences. Protein sequences cannot be paired in a list containing a mixture of protein and nucleotide sequences.
        Parameters:
        sequenceIndex - the index of the sequence to get the mate index of
        Returns:
        an index of the mate of the sequence, or -1 if the sequence has no mate.
        See Also:
        getMateExpectedDistance(int)
      • getImmutablePairedReadManager

        PairedReadManager getImmutablePairedReadManager()
        An immutable view of the paired reads managed by this list or alignment. Even if the list or alignment that implements this method is later modified, the returned PairedReadManager will not change.
        Returns:
        An immutable view of the paired reads managed by the list or alignment that implements this method or null if this class doesn't provide an immutable view of its paired reads.
        Since:
        API 4.11 (Geneious 5.0)