humann/store.py
def _is_optional_reaction(self, item, reaction_names=None):
        """
        Check if this reaction is optional
        """
        
        if reaction_names is None:
            reaction_names=[]
        
        # count the number of indicators at the beginning of the name
        char=item[0]
        index=0
        optional_indicator_count=0
        while char == config.pathway_reaction_optional: 
            optional_indicator_count+=1
            index+=1
            try:
                char=item[index]
            except IndexError:
                break
            
        # this reaction has an optional indicator only if it is
        # not part of the original reaction name
        # original names can start with "--"  
        
        # first check for the original name in the reactions names if provided
        optional=False
        if item in reaction_names:
            optional=False
        elif optional_indicator_count in [1,3]:
            optional=True
            
        return optional

        Check if this reaction is optional
        
Check if this reaction is optional
Check if this reaction is optional
def _is_optional_reaction(self, item, reaction_names=None):
        if reaction_names is None:
            reaction_names=[]
        char=item[0]
        index=0
        optional_indicator_count=0
        while char == config.pathway_reaction_optional: 
            optional_indicator_count+=1
            index+=1
            try:
                char=item[index]
            except IndexError:
                break
        optional=False
        if item in reaction_names:
            optional=False
        elif optional_indicator_count in [1,3]:
            optional=True
        return optional
def _is_optional_reaction ( self , item , reaction_names = None ) : if reaction_names is None : reaction_names = [ ] char = item [ 0 ] index = 0 optional_indicator_count = 0 while char == config . pathway_reaction_optional : optional_indicator_count += 1 index += 1 try : char = item [ index ] except IndexError : break optional = False if item in reaction_names : optional = False elif optional_indicator_count in [ 1 , 3 ] : optional = True return optional
Check if this reaction is optional
Check if this reaction is optional
"""
        Check if this reaction is optional
        """ # count the number of indicators at the beginning of the name # this reaction has an optional indicator only if it is # not part of the original reaction name # original names can start with "--"   # first check for the original name in the reactions names if provided
self
item
reaction_names