Class Astral


  • public class Astral
    extends Object
    Provides programmatic access to ASTRAL representative sets. See the paper by Chandonia et. al. for more information. Example:
     Set<String> astralSet = Astral.getRepresentatives(Astral.AstralSet.NINETY_FIVE_175B);
     
    This class uses a multiton pattern with soft references for caching. In short: the first time you call the above, it will fetch the data from ASTRAL; the second time will (probably) not have to; and the instances can still be garbage-collected if necessary (meaning they don't require heap memory).
    Since:
    3.0.6
    Author:
    dmyerstu
    • Constructor Detail

      • Astral

        public Astral​(Astral.AstralSet cutoff)
        Constructs a new Astral object. Generally, client code should prefer calling getRepresentatives(AstralSet) instead. This constructor should only be used when an ASTRAL set not included in Astral(AstralSet) is required.
        Parameters:
        cutoff - The ASTRAL sequence-identity cutoff required
        Throws:
        RuntimeException - If the Astral set could not be parsed or accessed for any reason
      • Astral

        public Astral​(String id,
                      URL url)
        Constructs a new Astral object. Generally, client code should prefer calling getRepresentatives(AstralSet) instead. This constructor should only be used when an ASTRAL set not included in Astral(AstralSet) is required.
        Throws:
        RuntimeException - If the Astral set could not be parsed or accessed for any reason
    • Method Detail

      • getRepresentatives

        public static Set<String> getRepresentatives​(Astral.AstralSet cutoff)
        Get a list of representatives' names for the specified ASTRAL cutoff.
      • getRepresentatives

        public static Set<String> getRepresentatives​(String id)
        Get a list of representatives' names for the specified ASTRAL cutoff.
        Parameters:
        id - An ASTRAL Id, such as 1.75A_95.
      • getNames

        public Set<String> getNames()
        Returns:
        The names of representatives in this ASTRAL set.
      • getFailedLines

        public LinkedHashMap<Integer,​String> getFailedLines()
        Gets a map describing lines read in the file that weren't understood.
        Returns:
        A LinkedHashMap mapping line numbers of failures to the lines themselves