Add a frequency that will be displayed on the variant level

            Args:
                name (str): The name of the frequency field
7368
def add_frequency(self, name, value):
        
        logger.debug("Adding frequency {0} with value {1} to variant {2}".format(
            name, value, self['variant_id']))
        self['frequencies'].append({'label': name, 'value': value})
325194
def name_variants(self):
        
        out = []
        variant = namedtuple('Variant', 'name doc_count')
        for var in chained_get(self._json, ['name-variants', 'name-variant'], []):
            new = variant(name=var['$'], doc_count=var.get('@doc-count'))
            out.append(new)
        return out
1021500
def increase_frequency(self, frequency=None):
        
        if frequency is None:
            javabridge.call(self.jobject, "increaseFrequency", "()V")
        else:
            javabridge.call(self.jobject, "increaseFrequency", "(I)V", frequency)
1063675
def addVariantSet(self, variantSet):
        
        id_ = variantSet.getId()
        self._variantSetIdMap[id_] = variantSet
        self._variantSetNameMap[variantSet.getLocalId()] = variantSet
        self._variantSetIds.append(id_)
782571
def add_tag(self, name, value):
        

        self.tags.append(Tag(name, value))
458730
def _AddOption(self, name):
    

    # Check for duplicate option declaration
    if name in [option.name for option in self.options]:
      raise TextFSMTemplateError('Duplicate option "%s"' % name)

    # Create the option object
    try:
      option = self._options_cls.GetOption(name)(self)
    except AttributeError:
      raise TextFSMTemplateError('Unknown option "%s"' % name)

    self.options.append(option)
107710
def add_preset(self, name, desc="", note=""):
        
        policy = self.policy
        if policy.find_preset(name):
            self.ui_log.error("A preset named '%s' already exists" % name)
            return False

        desc = desc or self.opts.desc
        note = note or self.opts.note

        try:
            policy.add_preset(name=name, desc=desc, note=note, opts=self.opts)
        except Exception as e:
            self.ui_log.error("Could not add preset: %s" % e)
            return False

        # Filter --add-preset <name> from arguments list
        arg_index = self._args.index("--add-preset")
        args = self._args[0:arg_index] + self._args[arg_index + 2:]

        self.ui_log.info("Added preset '%s' with options %s\n" %
                         (name, " ".join(args)))
        return True
532667
def add_parameter(self, name, value=None):
		
		if name not in self.__query:
			self.__query[name] = [value]
		else:
			self.__query[name].append(value)
1311142
def pick_frequency_line(self, filename, frequency, cumulativefield='cumulative_frequency'):
        ''''''
        if resource_exists('censusname', filename):
            with closing(resource_stream('censusname', filename)) as b:
                g = codecs.iterdecode(b, 'ascii')
                return self._pick_frequency_line(g, frequency, cumulativefield)
        else:
            with open(filename, encoding='ascii') as g:
                return self._pick_frequency_line(g, frequency, cumulativefield)
1262230
def set_name(self, value):
        
        if value is None:
            self.__name = value
        elif not isinstance(value, str):
            raise TypeError("Name must be set to a String")
        else:
            self.__name = value
304328
def AddValue(self, name, number, aliases=None, description=None):
    
    if name in self.values_per_name:
      raise KeyError('Value with name: {0:s} already exists.'.format(name))

    if number in self.values_per_number:
      raise KeyError('Value with number: {0!s} already exists.'.format(number))

    for alias in aliases or []:
      if alias in self.values_per_alias:
        raise KeyError('Value with alias: {0:s} already exists.'.format(alias))

    enumeration_value = EnumerationValue(
        name, number, aliases=aliases, description=description)

    self.values.append(enumeration_value)
    self.values_per_name[name] = enumeration_value
    self.values_per_number[number] = enumeration_value

    for alias in aliases or []:
      self.values_per_alias[alias] = enumeration_value
1370002
def _add_exac(self, variant_obj, gemini_variant):
        
        exac = gemini_variant['aaf_exac_all']
        if exac:
            exac = float(exac)
            variant_obj.add_frequency('ExAC', exac)
            logger.debug("Updating ExAC to: {0}".format(
                exac))
164584
def get_variant_by_name(self, name):
        
        results = []

        try:
            for info, dosage in self._bgen.get_variant(name):
                results.append(Genotypes(
                    Variant(
                        info.name,
                        CHROM_STR_ENCODE.get(info.chrom, info.chrom),
                        info.pos,
                        [info.a1, info.a2],
                    ),
                    dosage,
                    reference=info.a1,
                    coded=info.a2,
                    multiallelic=False,
                ))

        except ValueError:
            logging.variant_name_not_found(name)

        return results
1236164
def add_field(self, name, default=None, required=False, error=None):
        
        if name is None:
            return
        self.field_arguments.append(dict(
            name=name,
            default=default,
            required=required,
            error=error))
869459
def set_listener(self, name, listener):
        
        with self.__listeners_change_condition:
            self.listeners[name] = listener
985108
def append(self, name, value):
        
        if self.vars is None:
            self.vars = {}
        if name in self.vars:
            self.vars[name].append(value)
        else:
            self.vars[name] = [value]
226992
def add_task(cls, task, frequency=None):
        
        with cls._lock:
            if not isinstance(task, Task):
                t = Task(name=task.__name__, frequency=frequency)
                t.execute, task = task, t

            if frequency:
                task.frequency = frequency

            cls.tasks.append(task)
            cls.tasks.sort()