Skip to content

Commit

Permalink
check sgRNA table file by run options
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Oct 11, 2023
1 parent 781b934 commit 19502b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bean/mapping/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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.")
Expand Down

0 comments on commit 19502b5

Please sign in to comment.