Skip to content

Commit

Permalink
fdr type check and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
michabirklbauer committed Jan 11, 2024
1 parent e6848a9 commit 9e3a7fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions msannika_fdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def main(argv = None) -> List[pd.DataFrame]:
version = __version)
args = parser.parse_args(argv)

if args.fdr is not None:
print(f"Using {float(args.fdr) if float(args.fdr) < 1.0 else float(args.fdr) / 100.0} FDR.")

result_list = list()

for f, file in enumerate(args.files):
Expand All @@ -205,10 +208,10 @@ def main(argv = None) -> List[pd.DataFrame]:
crosslinks.to_excel(file.rstrip(".xlsx") + "_crosslinks.xlsx", sheet_name = "Crosslinks", index = False)
result_list.append(crosslinks)
if args.fdr is not None:
validated_csms = MSAnnika_CSM_Validator.validate(df, args.fdr if args.fdr < 1.0 else args.fdr / 100)
validated_csms = MSAnnika_CSM_Validator.validate(df, float(args.fdr) if float(args.fdr) < 1.0 else float(args.fdr) / 100.0)
validated_csms.to_excel(file.rstrip(".xlsx") + "_validated.xlsx", sheet_name = "CSMs", index = False)
result_list.append(validated_csms)
validated_crosslinks = MSAnnika_Crosslink_Validator.validate(crosslinks, args.fdr if args.fdr < 1.0 else args.fdr / 100)
validated_crosslinks = MSAnnika_Crosslink_Validator.validate(crosslinks, float(args.fdr) if float(args.fdr) < 1.0 else float(args.fdr) / 100.0)
validated_crosslinks.to_excel(file.rstrip(".xlsx") + "_crosslinks_validated.xlsx", sheet_name = "Crosslinks", index = False)
result_list.append(validated_crosslinks)
else:
Expand Down

0 comments on commit 9e3a7fc

Please sign in to comment.