From 19502b5853d4d792db31b395f5fa46d47791c3d7 Mon Sep 17 00:00:00 2001 From: Jayoung Ryu Date: Wed, 11 Oct 2023 14:59:23 -0400 Subject: [PATCH] check sgRNA table file by run options --- bean/mapping/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bean/mapping/utils.py b/bean/mapping/utils.py index bfcdec9..e160a31 100644 --- a/bean/mapping/utils.py +++ b/bean/mapping/utils.py @@ -240,7 +240,7 @@ def _check_sgrna_info_table(args, sgRNA_info_tbl): if args.offset: if "offset" not in sgRNA_info_tbl.columns: raise InputFileError( - "Offset option is set but the input file doesn't contain the `offset` column." + f"Offset option is set but the input file doesn't contain the `offset` column: Provided {sgRNA_info_tbl.columns}" ) if len(args.align_fasta) > 0: error_logger("Can't have --offset and --align_fasta option together.") @@ -252,12 +252,17 @@ def _check_sgrna_info_table(args, sgRNA_info_tbl): raise InputFileError( f"Specified target position column '{args.target_pos_col}' not in the input file {args.sgRNA_filename}." ) + if args.count_reporter_edits: + if "reporter" not in sgRNA_info_tbl.columns: + raise InputFileError( + f"Offset option is set but the input file doesn't contain the `reporter` column: Provided {sgRNA_info_tbl.columns}" + ) _check_sgrna_info_table(args, sgRNA_info_tbl) if args.match_target_pos and (args.target_pos_col not in sgRNA_info_tbl.columns): raise InputFileError( - "Target position option is set but the input file doesn't contain the target position column." + f"Target position option is set as `{args.target_pos_col}` but the input file doesn't contain the target position column: provided {sgRNA_info_tbl.columns}" ) info_logger("Done checking input arguments.")