Beispiel #1
0
def _read_call_freqs(in_file, sample_name):
    """Identify frequencies for calls in the input file.
    """
    out = {}
    with VariantFile(in_file) as call_in:
        for rec in call_in:
            if rec.filter.keys() == ["PASS"]:
                for name, sample in rec.samples.items():
                    if name == sample_name:
                        alt, depth, freq = bubbletree.sample_alt_and_depth(rec, sample)
                        if freq is not None:
                            out[_get_key(rec)] = freq
    return out
Beispiel #2
0
def _read_call_freqs(in_file, sample_name):
    """Identify frequencies for calls in the input file.
    """
    out = {}
    with VariantFile(in_file) as call_in:
        for rec in call_in:
            if rec.filter.keys() == ["PASS"]:
                for name, sample in rec.samples.items():
                    if name == sample_name:
                        alt, depth = bubbletree.sample_alt_and_depth(sample)
                        if depth > 0:
                            out[_get_key(rec)] = float(alt) / float(depth)
    return out
Beispiel #3
0
def _read_call_freqs(in_file, sample_name):
    """Identify frequencies for calls in the input file.
    """
    from bcbio.heterogeneity import bubbletree
    out = {}
    with VariantFile(in_file) as call_in:
        for rec in call_in:
            if rec.filter.keys() == ["PASS"]:
                for name, sample in rec.samples.items():
                    if name == sample_name:
                        alt, depth, freq = bubbletree.sample_alt_and_depth(rec, sample)
                        if freq is not None:
                            out[_get_key(rec)] = freq
    return out