Class UniprotProxySequenceReader<C extends Compound>

    • Constructor Detail

      • UniprotProxySequenceReader

        public UniprotProxySequenceReader​(String accession,
                                          CompoundSet<C> compoundSet)
                                   throws CompoundNotFoundException,
                                          IOException
        The UniProt id is used to retrieve the UniProt XML which is then parsed as a DOM object so we know everything about the protein. If an error occurs throw an exception. We could have a bad uniprot id or network error
        Parameters:
        accession -
        compoundSet -
        Throws:
        CompoundNotFoundException
        IOException - if problems while reading the UniProt XML
      • UniprotProxySequenceReader

        public UniprotProxySequenceReader​(Document document,
                                          CompoundSet<C> compoundSet)
                                   throws CompoundNotFoundException
        The xml is passed in as a DOM object so we know everything about the protein. If an error occurs throw an exception. We could have a bad uniprot id
        Parameters:
        document -
        compoundSet -
        Throws:
        CompoundNotFoundException
    • Method Detail

      • parseUniprotXMLString

        public static <C extends CompoundUniprotProxySequenceReader<C> parseUniprotXMLString​(String xml,
                                                                                               CompoundSet<C> compoundSet)
        The passed in xml is parsed as a DOM object so we know everything about the protein. If an error occurs throw an exception. We could have a bad uniprot id
        Parameters:
        xml -
        compoundSet -
        Returns:
        UniprotProxySequenceReader
        Throws:
        Exception
      • getLength

        public int getLength()
        The sequence length
        Specified by:
        getLength in interface Sequence<C extends Compound>
        Returns:
      • getCompoundAt

        public C getCompoundAt​(int position)
        Description copied from interface: Sequence
        Returns the Compound at the given biological index
        Specified by:
        getCompoundAt in interface Sequence<C extends Compound>
        Parameters:
        position -
        Returns:
      • getIndexOf

        public int getIndexOf​(C compound)
        Description copied from interface: Sequence
        Scans through the Sequence looking for the first occurrence of the given compound
        Specified by:
        getIndexOf in interface Sequence<C extends Compound>
        Parameters:
        compound -
        Returns:
      • getLastIndexOf

        public int getLastIndexOf​(C compound)
        Description copied from interface: Sequence
        Scans through the Sequence looking for the last occurrence of the given compound
        Specified by:
        getLastIndexOf in interface Sequence<C extends Compound>
        Parameters:
        compound -
        Returns:
      • getAsList

        public List<C> getAsList()
        Description copied from interface: Sequence
        Returns the Sequence as a List of compounds
        Specified by:
        getAsList in interface Sequence<C extends Compound>
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getInverse

        public SequenceView<C> getInverse()
        Description copied from interface: Sequence
        Does the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.
        Specified by:
        getInverse in interface Sequence<C extends Compound>
        Returns:
      • getSequenceAsString

        public String getSequenceAsString​(Integer bioBegin,
                                          Integer bioEnd,
                                          Strand strand)
        Parameters:
        bioBegin -
        bioEnd -
        strand -
        Returns:
      • getSubSequence

        public SequenceView<C> getSubSequence​(Integer bioBegin,
                                              Integer bioEnd)
        Description copied from interface: Sequence
        Returns a portion of the sequence from the different positions. This is indexed from 1
        Specified by:
        getSubSequence in interface Sequence<C extends Compound>
        Parameters:
        bioBegin -
        bioEnd -
        Returns:
      • countCompounds

        public int countCompounds​(C... compounds)
        Description copied from interface: Sequence
        Returns the number of times we found a compound in the Sequence
        Specified by:
        countCompounds in interface Sequence<C extends Compound>
        Parameters:
        compounds -
        Returns:
      • getUniprotbaseURL

        public static String getUniprotbaseURL()
        The current UniProt URL to deal with caching issues. www.uniprot.org is load balanced but you can access pir.uniprot.org directly.
        Returns:
        the uniprotbaseURL
      • setUniprotbaseURL

        public static void setUniprotbaseURL​(String aUniprotbaseURL)
        Parameters:
        aUniprotbaseURL - the uniprotbaseURL to set
      • getUniprotDirectoryCache

        public static String getUniprotDirectoryCache()
        Local directory cache of XML that can be downloaded
        Returns:
        the uniprotDirectoryCache
      • setUniprotDirectoryCache

        public static void setUniprotDirectoryCache​(String aUniprotDirectoryCache)
        Parameters:
        aUniprotDirectoryCache - the uniprotDirectoryCache to set
      • getGeneName

        public String getGeneName()
        Get the gene name associated with this sequence.
        Returns:
      • getOrganismName

        public String getOrganismName()
        Get the organism name assigned to this sequence
        Returns: