Exemplo n.º 1
0
def create_atlas(b):
    identifications = list()
    file_names = wfiles.value
    compound_name = wcompounds.value
    idx2 = compound_idx[compound_name]

    atlas = metob.Atlas()
    atlas.name = wfname.value

    # create an empty rt reference
    rt_ref = metob.RtReference()

    rt_ref.rt_min = rtmin_widget.value
    rt_ref.rt_max = rtmax_widget.value
    rt_ref.rt_peak = rtpeak_widget.value
    rt_ref.rt_units = data[0][idx2]['identification'].rt_references[0].rt_units

    # create an empty mz_reference
    mz_ref = metob.MzReference()

    mz_ref.mz = data[0][idx2]['identification'].mz_references[0].mz
    mz_ref.mz_tolerance = data[0][idx2]['identification'].mz_references[
        0].mz_tolerance
    mz_ref.mz_tolerance_units = data[0][idx2]['identification'].mz_references[
        0].mz_tolerance_units
    mz_ref.detected_polarity = data[0][idx2]['identification'].mz_references[
        0].detected_polarity

    identification = metob.CompoundIdentification()
    identification.compoud = compound_name
    identification.name = compound_name
    identification.rt_references = [rt_ref]
    identification.mz_references = [mz_ref]

    identifications.append(identification)

    atlas.compound_identifications = identifications
Exemplo n.º 2
0
def test_id_grade_trait():
    e = mo.IdentificationGrade(name='E')
    mo.store(e)
    cid = mo.CompoundIdentification(identification_grade='e')
    assert cid.identification_grade.unique_id == e.unique_id