Class ReactionSearchSpecification

  • All Implemented Interfaces:
    java.io.Serializable

    public class ReactionSearchSpecification
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • ReactionSearchSpecification

        public ReactionSearchSpecification​(int searchType,
                                           java.lang.String[] query,
                                           long[][] reactionDescriptor,
                                           long[][] reactantDescriptor,
                                           long[][] productDescriptor,
                                           float reactionCenterSimilarity,
                                           float peripherySimilarity)
        Creates a complete specification for a reaction similarity search with one or more query reactions.
        Parameters:
        searchType - one of TYPE_...
        query - list of encoded query reactions
        reactionDescriptor - null or query reaction descriptors
        reactantDescriptor - null or reactant FFP512 descriptors
        productDescriptor - null or product FFP512 descriptors
        reactionCenterSimilarity - in case of TYPE_SIMILARITY
        peripherySimilarity - in case of TYPE_SIMILARITY
      • ReactionSearchSpecification

        public ReactionSearchSpecification​(int searchType,
                                           java.lang.String[] query,
                                           long[][] reactionDescriptor,
                                           long[][] reactantDescriptor,
                                           long[][] productDescriptor)
        Creates a complete specification for a reaction substructure search with one or more query generic reactions.
        Parameters:
        searchType - one of TYPE_...
        query - list of encoded query reactions
        reactionDescriptor - null or query reaction descriptors
        reactantDescriptor - null or reactant FFP512 descriptors
        productDescriptor - null or product FFP512 descriptors
      • ReactionSearchSpecification

        public ReactionSearchSpecification​(java.lang.String[] query,
                                           long[][] retronDescriptor)
        Creates a complete specification for a retron search with one or more query retron substructures.
        Parameters:
        query - list of encoded retron structures
        retronDescriptor - null or product FFP512 descriptors
    • Method Detail

      • getReactionCount

        public int getReactionCount()
        Returns the search type as integer including mode flags. In case of TYPE_SIMILARITY use getDescriptorShortName() and getSimilarityThreshold() for a full search specification.
        Returns:
        one of TYPE_... and possibly MODE_LARGEST_FRAGMENT_ONLY public int getSearchType() { return mSearchType; }
      • getEncodedQuery

        public java.lang.String getEncodedQuery​(int index)
        Returns the (or one of the) query structures encodes as idcode.
        Parameters:
        index -
        Returns:
      • getReactionDescriptor

        public long[] getReactionDescriptor​(int index)
        Parameters:
        index -
        Returns:
      • getReactantDescriptor

        public long[] getReactantDescriptor​(int index)
        Parameters:
        index -
        Returns:
      • getProductDescriptor

        public long[] getProductDescriptor​(int index)
        Parameters:
        index -
        Returns:
      • getRetronDescriptor

        public long[] getRetronDescriptor​(int index)
        Parameters:
        index -
        Returns:
      • isSimilaritySearch

        public boolean isSimilaritySearch()
      • isNoReactionSearch

        public boolean isNoReactionSearch()
        Returns:
        whether this search does not include a structure search component is uses exclusively external criteria
      • isSubreactionSearch

        public boolean isSubreactionSearch()
      • isRetronSearch

        public boolean isRetronSearch()
      • isExactSearch

        public boolean isExactSearch()
        An exact search is a comparison of idcodes of standardized molecules with full stereo features.
        Returns:
      • isNoStereoSearch

        public boolean isNoStereoSearch()
        A noStereo search is a hash code comparison from encoding stereo depleted structures.
        Returns:
      • removeDescriptors

        public void removeDescriptors()
      • getReactionCenterSimilarity

        public float getReactionCenterSimilarity()
      • getPeripherySimilarity

        public float getPeripherySimilarity()
      • validate

        public java.lang.String validate()
        Checks, whether this specification is correctly defining a search. If something is missing or inconsistent, an error message describing the problem is returned.
        Returns:
        null or error message
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object