Class SiftsChainToUniprotMapping


  • public class SiftsChainToUniprotMapping
    extends java.lang.Object
    A mapping between UniProt entries and PDB chains. For example
     SiftsChainToUniprot sifts = SiftsChainToUniprot.load();
     SiftsChainEntry entry1 = sifts.getByUniProtId("P04585");
     System.out.println(entry1.getPdbId() + "." + entry1.getChainName()); // 1hiv.A
     System.out.println(entry1.getPdbStart() + "-" + entry1.getPdbStop()); // 1-99
     SiftsChainEntry entry2 = sifts.getByChainId("1hiv", "A");
     System.out.println(entry1.equals(entry2)); // true
     
    See SIFTS project documentation: https://www.ebi.ac.uk/pdbe/docs/sifts/
    Since:
    3.0.7
    Author:
    dmyersturnbull
    See Also:
    SiftsChainEntry
    • Field Detail

      • DEFAULT_FILE

        protected static java.io.File DEFAULT_FILE
    • Method Detail

      • load

        public static SiftsChainToUniprotMapping load()
                                               throws java.io.IOException
        Loads the SIFTS mapping. Attempts to load the mapping file in the PDB cache directory. If the file does not exist or could not be parsed, downloads and stores a GZ-compressed file.
        Returns:
        Throws:
        java.io.IOException - If the local file could not be read and could not be downloaded
      • load

        public static SiftsChainToUniprotMapping load​(boolean useOnlyLocal)
                                               throws java.io.IOException
        Loads the SIFTS mapping. Attempts to load the mapping file in the PDB cache directory. If the file does not exist or could not be parsed, downloads and stores a GZ-compressed file.
        Parameters:
        useOnlyLocal - If true, will throw an IOException if the file needs to be downloaded
        Returns:
        Throws:
        java.io.IOException - If the local file could not be read and could not be downloaded (including if onlyLocal is true)
      • build

        protected static SiftsChainToUniprotMapping build()
                                                   throws java.io.IOException
        Builds the mapping by reading SIFTS the tsv file set in DEFAULT_FILE variable.
        Returns:
        Throws:
        java.io.IOException
      • chainEntrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​SiftsChainEntry>> chainEntrySet()
      • containsChainId

        public boolean containsChainId​(java.lang.String pdbId,
                                       java.lang.String chainId)
      • containsUniProtId

        public boolean containsUniProtId​(java.lang.String uniProtId)
      • getByChainId

        public SiftsChainEntry getByChainId​(java.lang.String pdbId,
                                            java.lang.String chainId)
      • getByUniProtId

        public SiftsChainEntry getByUniProtId​(java.lang.String uniProtId)
      • keySet

        public java.util.Set<java.lang.String> keySet()
      • size

        public int size()
        Returns the number of mapped entries.
      • uniProtEntrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​SiftsChainEntry>> uniProtEntrySet()