Class GeneSequence

    • Constructor Detail

      • GeneSequence

        public GeneSequence​(ChromosomeSequence parentSequence,
                            int begin,
                            int end,
                            Strand strand)
        A class that keeps track of the details of a GeneSequence which is difficult to properly model. Two important concepts that is difficult to make everything flexible but still work. You can have GFF features that only describe Exons or Exons/Introns or CDS regions and one or more Transcriptions. You can have exon sequences but that does not imply transcription to the actual protein. The GeneSequence will keep track of Exons and Introns but to get a Protein sequence you need to start with a TranscriptSequence and then add CDS sequences. This is also a key class in the biojava-3-genome module for reading and writing GFF3 files
        Parameters:
        parentDNASequence -
        begin -
        end - inclusive of end
        strand - force a gene to have strand and transcription sequence will inherit
    • Method Detail

      • getParentChromosomeSequence

        public ChromosomeSequence getParentChromosomeSequence()
        The parent ChromosomeSequence which contains the actual DNA sequence data
        Returns:
        Chromosome sequence
      • addIntronsUsingExons

        public void addIntronsUsingExons()
                                  throws java.lang.Exception
        Once everything has been added to the gene sequence where you might have added exon sequences only then you can infer the intron sequences and add them. You may also have the case where you only added one or more TranscriptSequences and from that you can infer the exon sequences and intron sequences. Currently not implement
        Throws:
        java.lang.Exception
      • getStrand

        public Strand getStrand()
        A gene should have Strand
        Returns:
        the strand
      • setStrand

        public void setStrand​(Strand strand)
        Parameters:
        strand - the strand to set
      • getTranscript

        public TranscriptSequence getTranscript​(java.lang.String accession)
        Get the transcript sequence by accession
        Parameters:
        accession -
        Returns:
        the transcript
      • getTranscripts

        public java.util.LinkedHashMap<java.lang.String,​TranscriptSequence> getTranscripts()
        Get the collection of transcription sequences assigned to this gene
        Returns:
        transcripts
      • removeTranscript

        public TranscriptSequence removeTranscript​(java.lang.String accession)
        Remove the transcript sequence from the gene
        Parameters:
        accession -
        Returns:
        transcriptsequence
      • addTranscript

        public TranscriptSequence addTranscript​(AccessionID accession,
                                                int begin,
                                                int end)
                                         throws java.lang.Exception
        Add a transcription sequence to a gene which describes a ProteinSequence
        Parameters:
        accession -
        begin -
        end -
        Returns:
        transcript sequence
        Throws:
        java.lang.Exception - If the accession id is already used
      • removeIntron

        public IntronSequence removeIntron​(java.lang.String accession)
        Remove the intron by accession
        Parameters:
        accession -
        Returns:
        intron sequence
      • addIntron

        public IntronSequence addIntron​(AccessionID accession,
                                        int begin,
                                        int end)
                                 throws java.lang.Exception
        Add an Intron Currently used to mark an IntronSequence as a feature
        Parameters:
        accession -
        begin -
        end -
        Returns:
        intron sequence
        Throws:
        java.lang.Exception
      • removeExon

        public ExonSequence removeExon​(java.lang.String accession)
        Remove the exon sequence
        Parameters:
        accession -
        Returns:
        exon sequence
      • addExon

        public ExonSequence addExon​(AccessionID accession,
                                    int begin,
                                    int end)
                             throws java.lang.Exception
        Add an ExonSequence mainly used to mark as a feature
        Parameters:
        accession -
        begin -
        end -
        Returns:
        exon sequence
        Throws:
        java.lang.Exception
      • getExonSequences

        public java.util.ArrayList<ExonSequence> getExonSequences()
        Get the exons as an ArrayList
        Returns:
        exons
      • getIntronSequences

        public java.util.ArrayList<IntronSequence> getIntronSequences()
        Get the introns as an ArrayList
        Returns:
        introns
      • getSequence5PrimeTo3Prime

        public DNASequence getSequence5PrimeTo3Prime()
        Try to give method clarity where you want a DNASequence coding in the 5' to 3' direction Returns the DNASequence representative of the 5' and 3' reading based on strand
        Returns:
        dna sequence