Esempio n. 1
0
 def compound_idxs_not_evaluated(self) -> List[int]:
     """
     Returns list of compound indices where ms1 note is not 'remove' and
     ms2 note is None or 'no selection'
     """
     out = []
     for i, compound in enumerate(self.data[0].compounds):
         ms1_note = ma_data.extract(compound,
                                    ["identification", "ms1_notes"])
         ms2_note = ma_data.extract(compound,
                                    ["identification", "ms2_notes"])
         if (not _is_remove(ms1_note)) and (not _has_selection(ms2_note)):
             out.append(i)
     return out
Esempio n. 2
0
 def compound_indices_marked_remove(self) -> List[int]:
     """
     outputs:
         list of compound_idx of the compound identifications with ms1_notes to remove
     """
     ids = ["identification", "ms1_notes"]
     return [
         i for i, j in enumerate(self.data[0].compounds)
         if _is_remove(ma_data.extract(j, ids))
     ]
Esempio n. 3
0
def test_extract_dict01():
    assert gdhf.extract({"foo": 1, "bar": 2}, ["bar"]) == 2
Esempio n. 4
0
def test_extract_tuple03():
    assert gdhf.extract(("foo", "bar"), [9], "zoop") == "zoop"
Esempio n. 5
0
def test_extract_tuple02():
    assert gdhf.extract(("foo", "bar"), [-1]) == "bar"
Esempio n. 6
0
def test_extract_list05():
    assert gdhf.extract("okay", [], 99) == "okay"
Esempio n. 7
0
def test_extract_list04():
    assert gdhf.extract([], [0], 99) == 99
Esempio n. 8
0
def test_extract_list03():
    assert gdhf.extract([1, 2], [5], 99) == 99
Esempio n. 9
0
def test_extract_list02():
    assert gdhf.extract([1, 2], [5]) is None
Esempio n. 10
0
def test_extract_list01():
    assert gdhf.extract([1, 2], [0]) == 1
Esempio n. 11
0
def test_extract_metatlas_dataset03(metatlas_dataset):
    assert gdhf.extract(metatlas_dataset, ["foo"], "zoop") == "zoop"
Esempio n. 12
0
def test_extract_metatlas_dataset02(metatlas_dataset):
    ids = [0, 0, "identification", "compound", 0, "inchi_key"]
    assert gdhf.extract(metatlas_dataset, ids,
                        "zoop") == "OLXZPDWKRNYJJZ-RRKCRQDMSA-N"
Esempio n. 13
0
def test_extract_default01():
    assert gdhf.extract({"foo": 1, "bar": 2}, ["foo", "bar"], "zoop") == "zoop"
Esempio n. 14
0
def test_extract_dict02():
    assert gdhf.extract({"foo": 1, "bar": 2}, ["blah"], "zoop") == "zoop"