Skip to content

Commit

Permalink
Added d-tartrate qc message for Paratyphi B, Paratyphi B var. Java an…
Browse files Browse the repository at this point in the history
…d I 1,4,[5],12:i:-
  • Loading branch information
kbessonov1984 committed Nov 26, 2024
1 parent dc88a91 commit 0eacf75
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ If you run ``sistr -h``, you should see the following usage info:
Number of parallel threads to run sistr_cmd analysis.
-l LIST_OF_SEROVARS, --list-of-serovars LIST_OF_SEROVARS
A path to a single column text file containing list of
serovar(s) to check serovar prediction against. Report
predicted serovar is Y (present) and N (absent) in the
list
serovar(s) to check serovar prediction against. Result
reported in the "predicted_serovar_in_list"
field as Y (present) or N (absent) value.
-v, --verbose Logging verbosity level (-v == show warnings; -vvv ==
show debug info)
-V, --version show program's version number and exit
Expand Down
13 changes: 7 additions & 6 deletions sistr/sistr_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def init_parser():
help='Number of parallel threads to run sistr_cmd analysis.')
parser.add_argument('-l', '--list-of-serovars', nargs='?',
required=False, const=os.path.join(os.path.dirname(os.path.abspath(__file__)), "data/serovar-list.txt"),
help='A path to a single column text file containing list of serovar(s) to check SISTR serovar prediction against. Report predicted serovar in "serovar_in_serovar_list" field as Y (present) or N (absent).')
help='A path to a single column text file containing list of serovars to check SISTR serovar prediction against. Result reported in the "predicted_serovar_in_list" field as Y (present) or N (absent) value.')
parser.add_argument('-v',
'--verbose',
action='count',
Expand Down Expand Up @@ -255,7 +255,7 @@ def sistr_predict(input_fasta, genome_name, tmp_dir, keep_tmp, args):
if os.path.exists(args.list_of_serovars):
with open(args.list_of_serovars) as fp:
serovars_selected_list = [l.rstrip() for l in fp.readlines()]
logging.info(f"Selected list of serovars at {args.list_of_serovars} with {len(serovars_selected_list)} serovars to check SISTR serovar prediction against. Result reported in the 'serovar_in_serovar_list' field")
logging.info(f"Using the selected list of serovars {args.list_of_serovars} with {len(serovars_selected_list)} serovars to check overall SISTR serovar prediction against. Result will be reported in the 'predicted_serovar_in_list' field")
else:
logging.warning(f"File {args.list_of_serovars} does not exist in path specified. Would not perform SISTR serovar check against the list of serovars ...")

Expand Down Expand Up @@ -297,10 +297,11 @@ def sistr_predict(input_fasta, genome_name, tmp_dir, keep_tmp, args):
infer_o_antigen(prediction)
# if list of reportable serovars is provided to check prediction serovar against
if serovars_selected_list:
prediction.serovar_in_serovar_list = "N"
for selected_serovar in serovars_selected_list:
if selected_serovar == prediction.serovar:
prediction.serovar_in_serovar_list = "Y"
prediction.predicted_serovar_in_list = "N"
for serovar in serovars_selected_list:
if serovar in prediction.serovar: #try to match list serovar to the predicted serovar(s)
prediction.predicted_serovar_in_list = "Y"
logging.info(f"Found {serovar} serovar from {args.list_of_serovars} in SISTR predicted serovar(s) ({prediction.serovar})")
break

logging.info('%s | Antigen gene BLAST serovar prediction: "%s" serogroup=%s %s:%s:%s',
Expand Down
4 changes: 4 additions & 0 deletions sistr/src/qc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ def qc(fasta_path, cgmlst_results, prediction):
qc_status = 'FAIL'
qc_msgs.append('FAIL: Wzx/Wzy genes missing. Cannot determine O-antigen group/serogroup. Cannot accurately predict serovar from antigen genes.')

if prediction.serovar in 'Paratyphi B|Paratyphi B var. Java':
qc_msgs.append("Perform d-tartrate test (dT) to differentiate between Paratyphi B and Paratyphi B var. Java. The dT+ result is indicative of variant Java.")
if prediction.serovar in 'I 1,4,[5],12:i:-':
qc_msgs.append(f"Perform d-tartrate test (dT) as both dT+ and dT- {prediction.serovar} subtypes exist.")
qc_msgs.sort()
return qc_status, qc_msgs

0 comments on commit 0eacf75

Please sign in to comment.