Get the genotype of a marker using it's name.

        Args:
            name (str): The name of the marker.

        Returns:
            list: A list of Genotypes.
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
184968
def _get_update(self, variant):
        
        update = {
                '$inc': {
                    'homozygote': variant.get('homozygote', 0),
                    'hemizygote': variant.get('hemizygote', 0),
                    'observations': 1
                },
                '$set': {
                    'chrom': variant.get('chrom'),
                    'start': variant.get('pos'),
                    'end': variant.get('end'),
                    'ref': variant.get('ref'),
                    'alt': variant.get('alt'),
                }
             }
        if variant.get('case_id'):
            update['$push'] = {
                                'families': {
                                '$each': [variant.get('case_id')],
                                '$slice': -50
                                }
                            }
        return update
1297399
def get_name_curr(self, name):
        
        self._register_name(name)

        return self._var_name_mappers[name].get_current()
860718
def _get_genes(self, variant):
        
        ensembl_ids = []
        hgnc_symbols = []
        
        for transcript in variant.transcripts:
            if transcript.ensembl_id:
                ensembl_ids.append(transcript.ensembl_id)
            if transcript.hgnc_symbol:
                hgnc_symbols.append(transcript.hgnc_symbol)
        
        genes = get_gene_info(
                        ensembl_ids=ensembl_ids, 
                        hgnc_symbols=hgnc_symbols
                        )
        return genes
647912
def to_type(cls, typename):
        
        NAME_TYPES = {cls.TYPE_NAMES[x]: x for x in cls.TYPE_NAMES}
        return NAME_TYPES.get(typename, None)
253332
def genotypesPhenotypesGenerator(self, request):
        
        # TODO make paging work using SPARQL?
        compoundId = datamodel.PhenotypeAssociationSetCompoundId.parse(
            request.phenotype_association_set_id)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        phenotypeAssociationSet = dataset.getPhenotypeAssociationSet(
            compoundId.phenotypeAssociationSetId)
        featureSets = dataset.getFeatureSets()
        annotationList = phenotypeAssociationSet.getAssociations(
            request, featureSets)
        return self._protocolListGenerator(request, annotationList)
1326099
def find_gene(self, name: str):
        """"""
        result = [ExpGene.from_series(s)
                  for i, s in self.loc[self['name'] == name].iterrows()]
        return result
561373
def load_genotypes(self):
        

        if DataParser.compressed_pedigree:
            self.genotype_file = gzip.open("%s.gz" % self.tped_file, 'rb')
        else:
            self.genotype_file = open(self.tped_file)
        self.filter_missing()
1331368
def get_sample_info(self, individual=-1):
        
        if isinstance(individual, str):
            individual = self.individuals[individual]
        extra = OrderedDict()
        for format_ in self.format:
            index = getattr(self, format_)
            if index != -1:
                if format_ == 'GT':
                    d = self.genotype
                elif format_ == 'GQ':
                    d = self.genome_quality
                elif format_ == 'DP':
                    d = self.depth
                if individual == -1:
                    if len(d) != len(self.samples):
                        [self.parse_sample(i) for i in six.moves.range(len(self.samples))]
                    extra[format_] = [d[i] for i in six.moves.range(len(d))]
                else:
                    if individual not in d:
                        self.parse_sample(individual)
                    extra[format_] = [d[individual]]
        return extra
668398
def get_name_init(self, name):
        
        self._register_name(name)

        return self._var_name_mappers[name].get_init()
1090067
def get_acgt_geno_marker(self, marker):
        
        # Getting the marker's genotypes
        geno, snp_position = self.get_geno_marker(marker, return_index=True)

        # Returning the ACGT's format of the genotypes
        return self._allele_encoding[snp_position][geno]
91845
def get_variants(data, include_germline=False):
    
    data = utils.deepish_copy(data)
    supported = ["precalled", "vardict", "vardict-java", "vardict-perl",
                 "freebayes", "octopus", "strelka2"]
    # Right now mutect2 and mutect do not provide heterozygous germline calls
    # to be useful https://github.com/bcbio/bcbio-nextgen/issues/2464
    # supported += ["mutect2", "mutect"]
    if include_germline:
        supported.insert(1, "gatk-haplotype")
    out = []
    # CWL based input
    if isinstance(data.get("variants"), dict) and "samples" in data["variants"]:
        cur_vs = []
        # Unpack single sample list of files
        if (isinstance(data["variants"]["samples"], (list, tuple)) and
              len(data["variants"]["samples"]) == 1 and isinstance(data["variants"]["samples"][0], (list, tuple))):
            data["variants"]["samples"] = data["variants"]["samples"][0]
        for fname in data["variants"]["samples"]:
            variantcaller = utils.splitext_plus(os.path.basename(fname))[0]
            variantcaller = variantcaller.replace(dd.get_sample_name(data) + "-", "")
            for batch in dd.get_batches(data):
                variantcaller = variantcaller.replace(batch + "-", "")
            cur_vs.append({"vrn_file": fname, "variantcaller": variantcaller})
        data["variants"] = cur_vs
    for v in data.get("variants", []):
        if v["variantcaller"] in supported and v.get("vrn_file"):
            out.append((supported.index(v["variantcaller"]), v))
    out.sort()
    return [xs[1] for xs in out]
1207415
def get_var(self, name):
        
        for var in self.vars:
            if var.name == name:
                return var
        else:
            raise ValueError
1300369
def _get_variants(name):
    """"""
    names = [name]
    oldname = name
    # Map greek words to unicode characters
    if DOT_GREEK_RE.search(name):
        wordname = name
        while True:
            m = DOT_GREEK_RE.search(wordname)
            if m:
                wordname = wordname[:m.start(1)-1] + m.group(1) + wordname[m.end(1)+1:]
            else:
                break
        symbolname = name
        while True:
            m = DOT_GREEK_RE.search(symbolname)
            if m:
                symbolname = symbolname[:m.start(1)-1] + GREEK_WORDS[m.group(1)] + symbolname[m.end(1)+1:]
            else:
                break
        names = [wordname, symbolname]
    else:
        while True:
            m = GREEK_RE.search(name)
            if m:
                name = name[:m.start(2)] + GREEK_WORDS[m.group(2)] + name[m.end(2):]
            else:
                break
        while True:
            m = UNAMBIGUOUS_GREEK_RE.search(name)
            if m:
                name = name[:m.start(1)] + GREEK_WORDS[m.group(1)] + name[m.end(1):]
            else:
                break
        if not name == oldname:
            names.append(name)
    newnames = []
    for name in names:
        # If last word \d+, add variants with hyphen and no space preceding
        if NUM_END_RE.search(name):
            newnames.append(NUM_END_RE.sub('-\g<1>', name))
            newnames.append(NUM_END_RE.sub('\g<1>', name))
        # If last word [A-Za-z]\d* add variants with hyphen preceding.
        if ALPHANUM_END_RE.search(name):
            newnames.append(ALPHANUM_END_RE.sub('-\g<1>', name))
    names.extend(newnames)
    return names
1011261
def get(self, name: str, default: Any = None) -> np.ndarray:
		
		if name in self:
			return self[name]
		else:
			return default
440673
def callSetsGenerator(self, request):
        
        compoundId = datamodel.VariantSetCompoundId.parse(
            request.variant_set_id)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        variantSet = dataset.getVariantSet(compoundId.variant_set_id)
        results = []
        for obj in variantSet.getCallSets():
            include = True
            if request.name:
                if request.name != obj.getLocalId():
                    include = False
            if request.biosample_id:
                if request.biosample_id != obj.getBiosampleId():
                    include = False
            if include:
                results.append(obj)
        return self._objectListGenerator(request, results)
827882
def _get_names(names, types):
    
    if types == "":
        try:
            names, types = names.split(":")
        except:
            pass
    return names.split(","), types