Skip to content

Commit 0584ca9

Browse files
committed
Revert return type to List for ProteinGroups.get_protein_groups
1 parent 06ff6a1 commit 0584ca9

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ test:
2020
integration_test:
2121
python3 -um picked_group_fdr --mq_evidence $(DATA)/evidence.txt --fasta $(DATA)/db.fasta --enzyme trypsinp --min-length 6 --protein_groups_out ${DATA}/proteinGroups.txt --method picked_protein_group_mq_input --do_quant
2222

23+
fragpipe_test:
24+
cd data/fragpipe_example && ./run_picked_group_fdr.sh
25+
26+
sage_test:
27+
cd data/sage_example && ./run_picked_group_fdr.sh
28+
2329
pipeline_test: DOCKER_CMD=
2430
pipeline_test: IMAGE=
2531
pipeline_test: LOCAL_DIR=$(DATA)

docs/release_checklist.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
1. test if unit and system tests pass: `make test; make integration_test; make pipeline_test`
2+
test if fragpipe and sage system tests pass: `make fragpipe_test; make sage_test`
23
2. check if docker image works: `make build; make all`
34
3. update version number: `poetry version <major/minor/patch>`
45
4. add information to changelog on master `git log --pretty="%s"`

picked_group_fdr/protein_groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def get_protein_group_idxs(
125125

126126
def get_protein_groups(
127127
self, proteins: List[str], check_idx_valid: bool = True
128-
) -> Set[int]:
128+
) -> List[List[str]]:
129129
protein_group_idxs = self.get_protein_group_idxs(proteins, check_idx_valid)
130-
return {self.protein_groups[idx] for idx in protein_group_idxs}
130+
return [self.protein_groups[idx] for idx in protein_group_idxs]
131131

132132
def merge_groups(self, superset_protein: str, protein: str):
133133
"""Merge two protein groups"""

tests/unit_tests/test_helpers.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,42 @@ def test_is_shared_peptide_true():
2424
assert helpers.is_shared_peptide({1, 2, 3}) == True
2525

2626

27-
def test_is_shared_peptide_true():
27+
def test_is_shared_peptide_true_strings():
28+
assert helpers.is_shared_peptide([["proteinA"], ["proteinB", "proteinC"]]) == True
29+
30+
31+
def test_is_shared_peptide_true_with_missing():
2832
assert helpers.is_shared_peptide({1, 2, 3, -1}) == True
2933

3034

3135
def test_is_shared_peptide_false():
3236
assert helpers.is_shared_peptide({3}) == False
3337

3438

39+
def test_is_shared_peptide_false_strings():
40+
assert helpers.is_shared_peptide([["proteinB", "proteinC"]]) == False
41+
42+
3543
def test_is_missing_in_protein_groups_true():
3644
assert helpers.is_missing_in_protein_groups({-1}) == True
3745

3846

47+
def test_is_missing_in_protein_groups_true_strings():
48+
assert helpers.is_missing_in_protein_groups([]) == True
49+
50+
3951
def test_is_missing_in_protein_groups_false():
4052
assert helpers.is_missing_in_protein_groups({1}) == False
4153

4254

43-
def test_is_missing_in_protein_groups_false():
55+
def test_is_missing_in_protein_groups_false_strings():
56+
assert (
57+
helpers.is_missing_in_protein_groups([["proteinA"], ["proteinB", "proteinC"]])
58+
== False
59+
)
60+
61+
62+
def test_is_missing_in_protein_groups_false_with_missing():
4463
assert helpers.is_missing_in_protein_groups({1, -1}) == False
4564

4665

0 commit comments

Comments
 (0)