Annotate somatic calls if we have cosmic data installed.
493762
def _annotate_somatic(data, retriever=None):
    
    if is_human(data):
        paired = vcfutils.get_paired([data])
        if paired:
            r = dd.get_variation_resources(data)
            if r.get("cosmic") and objectstore.file_exists_or_remote(r["cosmic"]):
                return True
    return False
387164
def cli(ctx, organism="", sequence=""):
    
    return ctx.gi.annotations.get_features(organism=organism, sequence=sequence)
108274
def install(name, provider, genome_dir, localname, mask, regex, match, annotation):
    """"""
    genomepy.install_genome(
            name, provider, genome_dir=genome_dir, localname=localname, mask=mask, 
            regex=regex, invert_match=not(match), annotation=annotation)
682158
private Collection<MetricDatum> filterOSMetrics(Collection<MetricDatum> data) {
        Collection<MetricDatum> output = new ArrayList<MetricDatum>(data.size());
        for (MetricDatum datum: data) {
            if (!OS_METRIC_NAME.equals(datum.getMetricName()))
                output.add(datum);
        }
        return output;
    }
410484
private void handleResidueAnnotation(String seqName, String featureName, String value) {

		if (featureName.equals(GR_SURFACE_ACCESSIBILITY)) {
			stockholmStructure.addSurfaceAccessibility(seqName, value);
		} else if (featureName.equals(GR_TRANS_MEMBRANE)) {
			stockholmStructure.addTransMembrane(seqName, value);
		} else if (featureName.equals(GR_POSTERIOR_PROBABILITY)) {
			stockholmStructure.addPosteriorProbability(seqName, value);
		} else if (featureName.equals(GR_LIGAND_BINDING)) {
			stockholmStructure.addLigandBinding(seqName, value);
		} else if (featureName.equals(GR_ACTIVE_SITE)) {
			stockholmStructure.addActiveSite(seqName, value);
		} else if (featureName.equals(GR_AS_PFAM_PREDICTED)) {
			stockholmStructure.addASPFamPredicted(seqName, value);
		} else if (featureName.equals(GR_AS_SWISSPROT)) {
			stockholmStructure.addASSwissProt(seqName, value);
		} else if (featureName.equals(GR_INTRON)) {
			stockholmStructure.addIntron(seqName, value);
		} else if (featureName.equals(GR_SECONDARY_STRUCTURE)) {
			stockholmStructure.addSecondaryStructure(seqName, value);
		} else {
			// unknown feature
			logger.warn("Unknown Residue Feature [{}].\nPlease contact the Biojava team.", featureName);
		}
	}
1195312
def data_handle(self, loc, tokens):
        """"""
        if len(tokens) == 3:
            name, original_args, stmts = tokens
            inherit = None
        elif len(tokens) == 4:
            name, original_args, inherit, stmts = tokens
        else:
            raise CoconutInternalException("invalid data tokens", tokens)

        all_args = []  # string definitions for all args
        base_args = []  # names of all the non-starred args
        req_args = 0  # number of required arguments
        starred_arg = None  # starred arg if there is one else None
        saw_defaults = False  # whether there have been any default args so far
        types = {}  # arg position to typedef for arg
        for i, arg in enumerate(original_args):

            star, default, typedef = False, None, None
            if "name" in arg:
                internal_assert(len(arg) == 1)
                argname = arg[0]
            elif "default" in arg:
                internal_assert(len(arg) == 2)
                argname, default = arg
            elif "star" in arg:
                internal_assert(len(arg) == 1)
                star, argname = True, arg[0]
            elif "type" in arg:
                internal_assert(len(arg) == 2)
                argname, typedef = arg
            elif "type default" in arg:
                internal_assert(len(arg) == 3)
                argname, typedef, default = arg
            else:
                raise CoconutInternalException("invalid data arg tokens", arg)

            if argname.startswith("_"):
                raise CoconutDeferredSyntaxError("data fields cannot start with an underscore", loc)
            if star:
                if i != len(original_args) - 1:
                    raise CoconutDeferredSyntaxError("starred data field must come last", loc)
                starred_arg = argname
            else:
                if default:
                    saw_defaults = True
                elif saw_defaults:
                    raise CoconutDeferredSyntaxError("data fields with defaults must come after data fields without", loc)
                else:
                    req_args += 1
                base_args.append(argname)
            if typedef:
                internal_assert(not star, "invalid typedef in starred data field", typedef)
                types[i] = typedef
            arg_str = ("*" if star else "") + argname + ("=" + default if default else "")
            all_args.append(arg_str)

        attr_str = " ".join(base_args)
        extra_stmts = '''__slots__ = ()
__ne__ = _coconut.object.__ne__
def __eq__(self, other):
    {oind}return self.__class__ is other.__class__ and _coconut.tuple.__eq__(self, other)
{cind}'''.format(
            oind=openindent,
            cind=closeindent,
        )
        if starred_arg is not None:
            attr_str += (" " if attr_str else "") + starred_arg
            if base_args:
                extra_stmts += '''def __new__(_cls, {all_args}):
                    {oind}return _coconut.tuple.__new__(_cls, {base_args_tuple} + {starred_arg})
                {cind}@_coconut.classmethod
                def _make(cls, iterable, {kwd_only}new=_coconut.tuple.__new__, len=_coconut.len):
                    {oind}result = new(cls, iterable)
                    if len(result) < {req_args}:
                        {oind}raise _coconut.TypeError("Expected at least {req_args} argument(s), got %d" % len(result))
                    {cind}return result
                {cind}def _asdict(self):
                    {oind}return _coconut.OrderedDict((f, _coconut.getattr(self, f)) for f in self._fields)
                {cind}def __repr__(self):
                    {oind}return "{name}({args_for_repr})".format(**self._asdict())
                {cind}def _replace(_self, **kwds):
                    {oind}result = _self._make(_coconut.tuple(_coconut.map(kwds.pop, {quoted_base_args_tuple}, _self)) + kwds.pop("{starred_arg}", self.{starred_arg}))
                    if kwds:
                        {oind}raise _coconut.ValueError("Got unexpected field names: " + _coconut.repr(kwds.keys()))
                    {cind}return result
                {cind}@_coconut.property
                def {starred_arg}(self):
                    {oind}return self[{num_base_args}:]
                {cind}'''.format(
                    oind=openindent,
                    cind=closeindent,
                    name=name,
                    args_for_repr=", ".join(arg + "={" + arg.lstrip("*") + "!r}" for arg in base_args + ["*" + starred_arg]),
                    starred_arg=starred_arg,
                    all_args=", ".join(all_args),
                    req_args=req_args,
                    num_base_args=str(len(base_args)),
                    base_args_tuple="(" + ", ".join(base_args) + ("," if len(base_args) == 1 else "") + ")",
                    quoted_base_args_tuple='("' + '", "'.join(base_args) + '"' + ("," if len(base_args) == 1 else "") + ")",
                    kwd_only=("*, " if self.target.startswith("3") else ""),
                )
            else:
                extra_stmts += '''def __new__(_cls, *{arg}):
                    {oind}return _coconut.tuple.__new__(_cls, {arg})
                {cind}@_coconut.classmethod
                def _make(cls, iterable, {kwd_only}new=_coconut.tuple.__new__, len=None):
                    {oind}return new(cls, iterable)
                {cind}def _asdict(self):
                    {oind}return _coconut.OrderedDict([("{arg}", self[:])])
                {cind}def __repr__(self):
                    {oind}return "{name}(*{arg}=%r)" % (self[:],)
                {cind}def _replace(_self, **kwds):
                    {oind}result = self._make(kwds.pop("{arg}", _self))
                    if kwds:
                        {oind}raise _coconut.ValueError("Got unexpected field names: " + _coconut.repr(kwds.keys()))
                    {cind}return result
                {cind}@_coconut.property
                def {arg}(self):
                    {oind}return self[:]
                {cind}'''.format(
                    oind=openindent,
                    cind=closeindent,
                    name=name,
                    arg=starred_arg,
                    kwd_only=("*, " if self.target.startswith("3") else ""),
                )
        elif saw_defaults:
            extra_stmts += '''def __new__(_cls, {all_args}):
                {oind}return _coconut.tuple.__new__(_cls, {args_tuple})
            {cind}'''.format(
                oind=openindent,
                cind=closeindent,
                all_args=", ".join(all_args),
                args_tuple="(" + ", ".join(base_args) + ("," if len(base_args) == 1 else "") + ")",
            )

        out = (
            "class " + name + "("
            + (
                '_coconut.collections.namedtuple("' + name + '", "' + attr_str + '")' if not types
                else '_coconut_NamedTuple("' + name + '", [' + ", ".join(
                    '("' + argname + '", ' + self.wrap_typedef(types.get(i, "_coconut.typing.Any")) + ")"
                    for i, argname in enumerate(base_args + ([starred_arg] if starred_arg is not None else []))
                ) + "])"
            ) + (
                ", " + inherit if inherit is not None
                else ", _coconut.object" if not self.target.startswith("3")
                else ""
            ) + "):\n" + openindent
        )
        rest = None
        if "simple" in stmts and len(stmts) == 1:
            out += extra_stmts
            rest = stmts[0]
        elif "docstring" in stmts and len(stmts) == 1:
            out += stmts[0] + extra_stmts
        elif "complex" in stmts and len(stmts) == 1:
            out += extra_stmts
            rest = "".join(stmts[0])
        elif "complex" in stmts and len(stmts) == 2:
            out += stmts[0] + extra_stmts
            rest = "".join(stmts[1])
        elif "empty" in stmts and len(stmts) == 1:
            out += extra_stmts.rstrip() + stmts[0]
        else:
            raise CoconutInternalException("invalid inner data tokens", stmts)
        if rest is not None and rest != "pass\n":
            out += rest
        out += closeindent
        return out
12655
def extract_statements(self):
        """"""
        for _, (tf, target, effect, refs) in self.df.iterrows():
            tf_agent = get_grounded_agent(tf)
            target_agent = get_grounded_agent(target)
            if effect == 'Activation':
                stmt_cls = IncreaseAmount
            elif effect == 'Repression':
                stmt_cls = DecreaseAmount
            else:
                continue
            pmids = refs.split(';')
            for pmid in pmids:
                stmt = make_stmt(stmt_cls, tf_agent, target_agent, pmid)
                self.statements.append(stmt)
331742
def add_psms_to_proteindata(proteindata, p_acc, pool, psmdata):
    """"""
    seq, psm_id = psmdata[2], psmdata[3]
    try:
        proteindata[p_acc]['pools'][pool]['psms'].add(psm_id)
    except KeyError:
        emptyinfo = {'psms': set(), 'peptides': set(), 'unipeps': 0}
        try:
            proteindata[p_acc]['pools'][pool] = emptyinfo
        except KeyError:
            proteindata[p_acc].update({'pools': {pool: emptyinfo}})
        proteindata[p_acc]['pools'][pool]['psms'].add(psm_id)
    proteindata[p_acc]['pools'][pool]['peptides'].add(seq)
162027
def run(vrn_info, cnvs_by_name, somatic_info):
    
    cmd = _get_cmd("RunTHeTA.py")
    if not cmd:
        logger.info("THetA scripts not found in current PATH. Skipping.")
    else:
        from bcbio.structural import cnvkit
        work_dir = _sv_workdir(somatic_info.tumor_data)
        assert "cnvkit" in cnvs_by_name, "THetA requires CNVkit calls"
        cnv_info = cnvkit.export_theta(cnvs_by_name["cnvkit"], somatic_info.tumor_data)
        cnv_info["theta_input"] = subset_by_supported(cnv_info["theta_input"], _theta_to_coords,
                                                      cnvs_by_name, work_dir, somatic_info.tumor_data)
        return _run_theta(cnv_info, somatic_info.tumor_data, work_dir, run_n3=False)
1133417
def cli(ctx, feature_id, status, organism="", sequence=""):
    
    return ctx.gi.annotations.set_status(feature_id, status, organism=organism, sequence=sequence)
1008090
def _annotate(args, setclus):
    """"""
    logger.info("Creating bed file")
    bedfile = generate_position_bed(setclus)
    a = pybedtools.BedTool(bedfile, from_string=True)
    beds = []
    logger.info("Annotating clusters")
    if hasattr(args, 'list_files'):
        beds = args.list_files.split(",")
        for filebed in beds:
            logger.info("Using %s " % filebed)
            db = os.path.basename(filebed)
            b = pybedtools.BedTool(filebed)
            c = a.intersect(b, wo=True)
            setclus = anncluster(c, setclus, db, args.type_ann, args.feature_id)
    return setclus
1151215
def new_data(self, mem, addr, data):
        """"""
        if mem.id == self.id:
            logger.debug(
                "Got new data from the LED driver, but we don't care.")
297549
def plotcommand(cosmology='WMAP5', plotname=None):
    

    # Plot the c-M relation as a functon of redshift
    xarray = 10**(np.arange(1, 15, 0.2))
    yval = 'c'

    # Specify the redshift range
    zarray = np.arange(0, 5, 0.5)

    xtitle = r"Halo Mass (M$_{sol}$)"
    ytitle = r"Concentration"
    linelabel = "z="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    plt.ylim([2, 30])

    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=zval, Mi=xarray)

        # Access the column yval from the data file
        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, yarray, label=linelabel+str(zval), color=colors[zind])
        # Overplot the D08 predictions in black
        ax.plot(xarray, commah.commah.cduffy(zval, xarray), color="black")

    ax.set_xscale('log')
    ax.set_yscale('log')

    leg = ax.legend(loc=1)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_CM_relation.png'" % (plotname))
        fig.savefig(plotname+"_CM_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the c-z relation as a function of mass (so always Mz=M0)
    xarray = 10**(np.arange(0, 1, 0.05)) - 1
    yval = 'c'

    # Specify the mass range
    zarray = 10**np.arange(6, 14, 2)

    xtitle = r"Redshift"
    ytitle = r"NFW Concentration"
    linelabel = r"log$_{10}$ M$_{z}$(M$_{sol}$)="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=xarray, Mi=zval)

        # Access the column yval from the data file
        yarray = output[yval].flatten()

        # Plot each line in turn with different colours
        ax.plot(xarray, yarray,
                label=linelabel+"{0:.1f}".format(np.log10(zval)),
                color=colors[zind],)

    leg = ax.legend(loc=1)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_Cz_relation.png'" % (plotname))
        fig.savefig(plotname+"_Cz_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the zf-z relation for different masses (so always Mz=M0)
    xarray = 10**(np.arange(0, 1, 0.05)) - 1
    yval = 'zf'

    # Specify the mass range
    zarray = 10**np.arange(6, 14, 2)

    xtitle = r"Redshift"
    ytitle = r"Formation Redshift"
    linelabel = r"log$_{10}$ M$_{z}$(M$_{sol}$)="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=xarray, Mi=zval)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, yarray,
                label=linelabel+"{0:.1f}".format(np.log10(zval)),
                color=colors[zind],)

    leg = ax.legend(loc=2)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_zfz_relation.png'" % (plotname))
        fig.savefig(plotname+"_zfz_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the dM/dt-z relation for different masses (so always Mz=M0)
    xarray = 10**(np.arange(0, 1, 0.05)) - 1
    yval = 'dMdt'

    # Specify the mass range
    zarray = 10**np.arange(10, 14, 0.5)

    xtitle = r"log$_{10}$ (1+z)"
    ytitle = r"log$_{10}$ Accretion Rate M$_{sol}$ yr$^{-1}$"
    linelabel = r"log$_{10}$ M$_z$(M$_{sol}$)="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    cosmo = commah.getcosmo(cosmology)
    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=xarray, Mi=zval,
                            com=False, mah=True)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(np.log10(xarray+1.), np.log10(yarray),
                label=linelabel+"{0:.1f}".format(np.log10(zval)),
                color=colors[zind],)

        # Plot the semi-analytic approximate formula from Correa et al 2015b
        semianalytic_approx = 71.6 * (zval / 1e12) * (cosmo['h'] / 0.7) *\
            (-0.24 + 0.75 * (xarray + 1)) * np.sqrt(
            cosmo['omega_M_0'] * (xarray + 1)**3 + cosmo['omega_lambda_0'])

        ax.plot(np.log10(xarray + 1), np.log10(semianalytic_approx),
                color='black')

    leg = ax.legend(loc=2)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_dMdtz_relation.png'" % (plotname))
        fig.savefig(plotname+"_dMdtz_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the dMdt-M relation as a function of redshift
    xarray = 10**(np.arange(10, 14, 0.5))
    yval = 'dMdt'

    # Specify the redshift range
    zarray = np.arange(0, 5, 0.5)

    xtitle = r"Halo Mass M$_{sol}$"
    ytitle = r"Accretion Rate M$_{sol}$ yr$^{-1}$"
    linelabel = "z="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=zval, Mi=xarray,
                            com=False, mah=True)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, yarray, label=linelabel+str(zval),
                color=colors[zind],)

    ax.set_xscale('log')
    ax.set_yscale('log')

    leg = ax.legend(loc=2)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_MAH_M_relation.png'" % (plotname))
        fig.savefig(plotname+"_MAH_M_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the (dM/M)dt-M relation as a function of redshift
    xarray = 10**(np.arange(10, 14, 0.5))
    yval = 'dMdt'

    # Specify the redshift range
    zarray = np.arange(0, 5, 0.5)

    xtitle = r"Halo Mass M$_{sol}$"
    ytitle = r"Specific Accretion Rate yr$^{-1}$"
    linelabel = "z="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=zval, Mi=xarray,
                            mah=True, com=False)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, yarray/xarray, label=linelabel+str(zval),
                color=colors[zind],)

    ax.set_xscale('log')
    ax.set_yscale('log')

    leg = ax.legend(loc=1)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_specificMAH_M_relation.png'" % (plotname))
        fig.savefig(plotname+"_specificMAH_M_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the Mz-z relation as a function of mass
    # (so mass is decreasing to zero as z-> inf)
    xarray = 10**(np.arange(0, 1, 0.05)) - 1
    yval = 'Mz'

    # Specify the mass range
    zarray = 10**np.arange(10, 14, 0.5)

    xtitle = r"Redshift"
    ytitle = r"M(z) (M$_{sol}$)"
    linelabel = r"log$_{10}$ M$_{0}$(M$_{sol}$)="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=0, Mi=zval, z=xarray)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, yarray,
                label=linelabel+"{0:.1f}".format(np.log10(zval)),
                color=colors[zind],)

    ax.set_yscale('log')

    leg = ax.legend(loc=1)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_Mzz_relation.png'" % (plotname))
        fig.savefig(plotname+"_Mzz_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    # Plot the Mz/M0-z relation as a function of mass
    xarray = 10**(np.arange(0, 1, 0.02)) - 1
    yval = 'Mz'

    # Specify the mass range
    zarray = 10**np.arange(10, 14, 0.5)

    xtitle = r"Redshift"
    ytitle = r"log$_{10}$ M(z)/M$_{0}$"
    linelabel = r"log$_{10}$ M$_{0}$(M$_{sol}$)="

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_xlabel(xtitle)
    ax.set_ylabel(ytitle)
    colors = cm.rainbow(np.linspace(0, 1, len(zarray)))

    for zind, zval in enumerate(zarray):
        output = commah.run(cosmology=cosmology, zi=0, Mi=zval, z=xarray)

        yarray = output[yval].flatten()

        # Plot each line in turn with different colour
        ax.plot(xarray, np.log10(yarray/zval),
                label=linelabel+"{0:.1f}".format(np.log10(zval)),
                color=colors[zind],)

    leg = ax.legend(loc=3)
    # Make box totally transparent
    leg.get_frame().set_alpha(0)
    leg.get_frame().set_edgecolor('white')
    for label in leg.get_texts():
        label.set_fontsize('small')  # the font size
    for label in leg.get_lines():
        label.set_linewidth(4)   # the legend line width

    if plotname:
        fig.tight_layout(pad=0.2)
        print("Plotting to '%s_MzM0z_relation.png'" % (plotname))
        fig.savefig(plotname+"_MzM0z_relation.png", dpi=fig.dpi*5)
    else:
        plt.show()

    return("Done")
443345
def _parse(self):
        """"""
        with open(self.filename, 'r') as fobj:
            lines = fobj.read().split('\n')

        # Create a header object with content at start of file
        self.header = MOPHeader(self.subfmt).parser(lines)

        # Create a data attribute to hold an astropy.table.Table object
        self.data = MOPDataParser(self.header).parse(lines)
1243003
def _memdata(osdata):
    '''
    
    '''
    # Provides:
    #   mem_total
    #   swap_total, for supported systems.
    grains = {'mem_total': 0}
    if osdata['kernel'] == 'Linux':
        grains.update(_linux_memdata())
    elif osdata['kernel'] in ('FreeBSD', 'OpenBSD', 'NetBSD'):
        grains.update(_bsd_memdata(osdata))
    elif osdata['kernel'] == 'Darwin':
        grains.update(_osx_memdata())
    elif osdata['kernel'] == 'SunOS':
        grains.update(_sunos_memdata())
    elif osdata['kernel'] == 'AIX':
        grains.update(_aix_memdata())
    elif osdata['kernel'] == 'Windows' and HAS_WMI:
        grains.update(_windows_memdata())
    return grains
687454
def load(self, data, many=None, partial=None):
        """"""
        result = super(ResumptionTokenSchema, self).load(
            data, many=many, partial=partial
        )
        result.data.update(
            result.data.get('resumptionToken', {}).get('kwargs', {})
        )
        return result
143386
def _is_somatic(rec):
    
    if _has_somatic_flag(rec):
        return True
    if _is_mutect2_somatic(rec):
        return True
    ss_flag = rec.INFO.get("SS")
    if ss_flag is not None:
        if str(ss_flag) == "2":
            return True
    status_flag = rec.INFO.get("STATUS")
    if status_flag is not None:
        if str(status_flag).lower() in ["somatic", "likelysomatic", "strongsomatic", "samplespecific"]:
            return True
    epr = rec.INFO.get("EPR", "").split(",")
    if epr and all([p == "pass" for p in epr]):
        return True
    return False