Skip to content

Commit

Permalink
run pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarcsj committed Jan 17, 2025
1 parent a888c66 commit 6821f51
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
30 changes: 19 additions & 11 deletions alphadia/outputtransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,28 +786,32 @@ def build_lfq_tables(

intensity_df, quality_df = qb.accumulate_frag_df_from_folders(folder_list)

quantlevel_configs = [ #the configs specified here are: quantlevel, level_name, should_process, save_fragments
(
quantlevel_configs = [ # the configs specified here are: quantlevel, level_name, should_process, save_fragments
(
"mod_seq_charge_hash",
"precursor",
self.config["search_output"]["precursor_level_lfq"],
self.config["search_output"]["fragment_quant_matrix"] #if we write out the fragment quantities, then with precursor-level filtering
self.config["search_output"][
"fragment_quant_matrix"
], # if we write out the fragment quantities, then with precursor-level filtering
),
(
"mod_seq_hash",
"peptide",
self.config["search_output"]["peptide_level_lfq"],
False
False,
),
("pg",
"pg",
True,
False), # Always process protein group level
("pg", "pg", True, False), # Always process protein group level
]

lfq_results = {}

for quantlevel, level_name, should_process, save_fragments in quantlevel_configs:
for (
quantlevel,
level_name,
should_process,
save_fragments,
) in quantlevel_configs:
if not should_process:
continue

Expand Down Expand Up @@ -852,10 +856,14 @@ def build_lfq_tables(
file_format=self.config["search_output"]["file_format"],
)
if save_fragments:
logger.info(f"Writing fragment quantity matrix to disk, filtered on {level_name}")
logger.info(
f"Writing fragment quantity matrix to disk, filtered on {level_name}"
)
write_df(
group_intensity_df,
os.path.join(self.output_folder, f"fragment_{level_name}filt.matrix"),
os.path.join(
self.output_folder, f"fragment_{level_name}filt.matrix"
),
file_format=self.config["search_output"]["file_format"],
)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_outputaccumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def prepare_input_data():
"normalize_lfq": True,
"peptide_level_lfq": False,
"precursor_level_lfq": False,
"fragment_quant_matrix": False
"fragment_quant_matrix": False,
},
"transfer_library": {
"enabled": True,
Expand Down

0 comments on commit 6821f51

Please sign in to comment.