Add the rank score if found
        
        Args:
            variant_obj (puzzle.models.Variant)
            info_dict (dict): A info dictionary
178907
def _add_rank_score(self, variant_obj, info_dict):
        
        rank_score_entry = info_dict.get('RankScore')
        if rank_score_entry:
            for family_annotation in rank_score_entry.split(','):
                rank_score = family_annotation.split(':')[-1]
            logger.debug("Updating rank_score to: {0}".format(
                rank_score))
            variant_obj.rank_score = float(rank_score)
1301740
def add_suspect(self, case_obj, variant_obj):
        """"""
        new_suspect = Suspect(case=case_obj, variant_id=variant_obj.variant_id,
                              name=variant_obj.display_name)
        self.session.add(new_suspect)
        self.save()
        return new_suspect
321323
def setrank(self,v):
        
        assert self.dag
        r=max([self.grx[x].rank for x in v.N(-1)]+[-1])+1
        self.grx[v].rank=r
        # add it to its layer:
        try:
            self.layers[r].append(v)
        except IndexError:
            assert r==len(self.layers)
            self.layers.append(Layer([v]))
368479
def _add_transcripts(self, variant_obj, gemini_variant):
        
        query = "SELECT * from variant_impacts WHERE variant_id = {0}".format(
            gemini_variant['variant_id']
        )

        gq = GeminiQuery(self.db)
        gq.run(query)
        
        for gemini_transcript in gq:
            transcript = Transcript(
                hgnc_symbol=gemini_transcript['gene'],
                transcript_id=gemini_transcript['transcript'],
                consequence=gemini_transcript['impact_so'],
                biotype=gemini_transcript['biotype'],
                polyphen=gemini_transcript['polyphen_pred'],
                sift=gemini_transcript['sift_pred'],
                HGVSc=gemini_transcript['codon_change'],
                HGVSp=', '.join([gemini_transcript['aa_change'] or '', gemini_transcript['aa_length'] or ''])
                )
            variant_obj.add_transcript(transcript)
968534
def add_opinion(self,opinion_obj):
        
        if self.opinion_layer is None:
            self.opinion_layer = Copinions()
            self.root.append(self.opinion_layer.get_node())
        self.opinion_layer.add_opinion(opinion_obj)
1190779
def update_obj
      mean, sd = rating.to_glicko_rating
      @obj.rating = mean
      @obj.rating_deviation = sd
      @obj.volatility = volatility
    end
1063675
def addVariantSet(self, variantSet):
        
        id_ = variantSet.getId()
        self._variantSetIdMap[id_] = variantSet
        self._variantSetNameMap[variantSet.getLocalId()] = variantSet
        self._variantSetIds.append(id_)
855813
def add_headers(vcf_obj, nr_cases=None, sv=False):
    

    vcf_obj.add_info_to_header(
        {
            'ID':"Obs",
            'Number': '1',
            'Type': 'Integer',
            'Description': "The number of observations for the variant"}
    )
    if not sv:
        vcf_obj.add_info_to_header(
            {
                'ID':"Hom",
                'Number': '1',
                'Type': 'Integer',
                'Description': "The number of observed homozygotes"}
        )
        vcf_obj.add_info_to_header(
            {
                'ID':"Hem",
                'Number': '1',
                'Type': 'Integer',
                'Description': "The number of observed hemizygotes"}
        )
    if nr_cases:
        case_header = "##NrCases={}".format(nr_cases)
        vcf_obj.add_to_header(case_header)
    # head.add_version_tracking("loqusdb", version, datetime.now().strftime("%Y-%m-%d %H:%M"))
    return
347406
def user_default_add_related_pks(self, obj):
        """"""
        if not hasattr(obj, '_votes_pks'):
            obj._votes_pks = list(obj.votes.values_list('pk', flat=True))
1003904
async def dump_variant(obj, elem, elem_type=None, params=None, field_archiver=None):
    
    field_archiver = field_archiver if field_archiver else dump_field
    if isinstance(elem, x.VariantType) or elem_type.WRAPS_VALUE:
        return {
            elem.variant_elem: await field_archiver(None, getattr(elem, elem.variant_elem), elem.variant_elem_type)
        }

    else:
        fdef = elem_type.find_fdef(elem_type.f_specs(), elem)
        return {
            fdef[0]: await field_archiver(None, elem, fdef[1])
        }
1199791
private void addHomozygousGenotype(Variant variant, int numAllele, String[] alternateAlleles, VariantStats stats, String[] homCounts) {
        if (homCounts.length == alternateAlleles.length) {
            for (int i = 0; i < homCounts.length; i++) {
                Integer alleles[] = new Integer[2];
                getHomozygousGenotype(i + 1, alleles);
                String gt = VariantVcfFactory.mapToMultiallelicIndex(alleles[0], numAllele) + "/" + VariantVcfFactory.mapToMultiallelicIndex(alleles[1], numAllele);
                Genotype genotype = new Genotype(gt, variant.getReference(), alternateAlleles[numAllele]);
                stats.addGenotype(genotype, Integer.parseInt(homCounts[i]));
            }
        }
    }
490225
def update_object(objref, data, **api_opts):
    '''
    
    '''
    if '__opts__' in globals() and __opts__['test']:
        return {'Test': 'Would attempt to update object: {0}'.format(objref)}
    infoblox = _get_infoblox(**api_opts)
    return infoblox.update_object(objref, data)
717263
async def dump_variant(self, elem, elem_type=None, params=None, obj=None):
        
        fvalue = None
        if isinstance(elem, x.VariantType) or elem_type.WRAPS_VALUE:
            try:
                self.tracker.push_variant(elem.variant_elem_type)
                fvalue = {
                    elem.variant_elem: await self._dump_field(getattr(elem, elem.variant_elem), elem.variant_elem_type, obj=obj)
                }
                self.tracker.pop()

            except Exception as e:
                raise helpers.ArchiveException(e, tracker=self.tracker) from e

        else:
            try:
                fdef = elem_type.find_fdef(elem_type.f_specs(), elem)
                self.tracker.push_variant(fdef[1])
                fvalue = {
                    fdef[0]: await self._dump_field(elem, fdef[1], obj=obj)
                }
                self.tracker.pop()

            except Exception as e:
                raise helpers.ArchiveException(e, tracker=self.tracker) from e

        return fvalue
128022
def get_variant_id(variant_dict=None, variant_line=None):
    
    
    if variant_dict:
        chrom = variant_dict['CHROM']
        position = variant_dict['POS']
        ref = variant_dict['REF']
        alt = variant_dict['ALT']
    elif variant_line:
        splitted_line = variant_line.rstrip().split('\t')
        chrom = splitted_line[0]
        position = splitted_line[1]
        ref = splitted_line[3]
        alt = splitted_line[4]
    else:
        raise Exception("Have to provide variant dict or variant line")
    
    return '_'.join([
        chrom,
        position,
        ref,
        alt,
    ])
1208154
def update_score(self, node, addToScore):
        
        current_score = 0
        score_string = self.parser.getAttribute(node, 'gravityScore')
        if score_string:
            current_score = int(score_string)

        new_score = current_score + addToScore
        self.parser.setAttribute(node, "gravityScore", str(new_score))
270999
def _add_genes(self, variant_obj):
        """"""
        genes = []
        ensembl_ids = []
        hgnc_symbols = []
        
        if variant_obj.transcripts:
            for transcript in variant_obj.transcripts:
                if transcript.ensembl_id:
                    ensembl_ids.append(transcript.ensembl_id)
                if transcript.hgnc_symbol:
                    hgnc_symbols.append(transcript.hgnc_symbol)

        else:
            hgnc_symbols = variant_obj.gene_symbols
        
        genes = get_gene_info(
                        ensembl_ids=ensembl_ids, 
                        hgnc_symbols=hgnc_symbols
                        )
            
        for gene in genes:
            variant_obj.add_gene(gene)
261160
def add_variant_args(arg_parser):
    
    variant_arg_group = arg_parser.add_argument_group(
        title="Variants",
        description="Genomic variant files")

    variant_arg_group.add_argument(
        "--vcf",
        default=[],
        action="append",
        help="Genomic variants in VCF format")

    variant_arg_group.add_argument(
        "--maf",
        default=[],
        action="append",
        help="Genomic variants in TCGA's MAF format",)

    variant_arg_group.add_argument(
        "--variant",
        default=[],
        action="append",
        nargs=4,
        metavar=("CHR", "POS", "REF", "ALT"),
        help=(
            "Individual variant as 4 arguments giving chromsome, position, ref,"
            " and alt. Example: chr1 3848 C G. Use '.' to indicate empty alleles"
            " for insertions or deletions."))

    variant_arg_group.add_argument(
        "--genome",
        type=str,
        help=(
            "What reference assembly your variant coordinates are using. "
            "Examples: 'hg19', 'GRCh38', or 'mm9'. "
            "This argument is ignored for MAF files, since each row includes "
            "the reference. "
            "For VCF files, this is used if specified, and otherwise is guessed from "
            "the header. For variants specfied on the commandline with --variant, "
            "this option is required."))

    variant_arg_group.add_argument(
        "--download-reference-genome-data",
        action="store_true",
        default=False,
        help=(
            ("Automatically download genome reference data required for "
             "annotation using PyEnsembl. Otherwise you must first run "
             "'pyensembl install' for the release/species corresponding "
             "to the genome used in your VCF.")))

    variant_arg_group.add_argument(
        "--json-variants",
        default=[],
        action="append",
        help="Path to Varcode.VariantCollection object serialized as a JSON file.")

    return variant_arg_group