@@ -285,6 +285,44 @@ def parse_netmhc4_stdout(
285285 rank_index = 13 ,
286286 score_index = 11 )
287287
288+ def parse_netmhc41_stdout (
289+ stdout ,
290+ mode ,
291+ prediction_method_name = "netmhc41" ,
292+ sequence_key_mapping = None ):
293+ """
294+ # NetMHCpan version 4.1b
295+
296+ # Tmpdir made /tmp/netMHCpanGjkOCb
297+ # Input is in PEPTIDE format
298+
299+ # Make both EL and BA predictions
300+
301+ HLA-A02:01 : Distance to training data 0.000 (using nearest neighbor HLA-A02:01)
302+
303+ # Rank Threshold for Strong binding peptides 0.500
304+ # Rank Threshold for Weak binding peptides 2.000
305+ ---------------------------------------------------------------------------------------------------------------------------
306+ Pos MHC Peptide Core Of Gp Gl Ip Il Icore Identity Score_EL %Rank_EL Score_BA %Rank_BA Aff(nM) BindLevel
307+ ---------------------------------------------------------------------------------------------------------------------------
308+ 1 HLA-A*02:01 SIINFEKL SII-NFEKL 0 0 0 3 1 SIINFEKL PEPLIST 0.0100620 6.723 0.110414 20.171 15140.42
309+ ---------------------------------------------------------------------------------------------------------------------------
310+
311+ Protein PEPLIST. Allele HLA-A*02:01. Number of high binders 0. Number of weak binders 0. Number of peptides 1
312+ """
313+ assert mode in ("binding_affinity" , "elution_score" )
314+ return parse_stdout (
315+ stdout = stdout ,
316+ prediction_method_name = prediction_method_name ,
317+ sequence_key_mapping = sequence_key_mapping ,
318+ key_index = 10 ,
319+ offset_index = 0 ,
320+ peptide_index = 2 ,
321+ allele_index = 1 ,
322+ ic50_index = 15 if mode == "binding_affinity" else None ,
323+ rank_index = 14 if mode == "binding_affinity" else 12 ,
324+ score_index = 13 if mode == "binding_affinity" else 11 )
325+
288326def parse_netmhcpan28_stdout (
289327 stdout ,
290328 prediction_method_name = "netmhcpan" ,
@@ -400,6 +438,44 @@ def parse_netmhcpan4_stdout(
400438 rank_index = 12 if mode == "elution_score" else 13 ,
401439 transforms = transforms )
402440
441+ def parse_netmhcpan41_stdout (
442+ stdout ,
443+ prediction_method_name = "netmhcpan" ,
444+ sequence_key_mapping = None ,
445+ mode = "binding_affinity" ):
446+ """
447+ NetMHCpan version 4.1b
448+ # Rank Threshold for Strong binding peptides 0.500
449+ # Rank Threshold for Weak binding peptides 2.000
450+ ---------------------------------------------------------------------------------------------------------------------------
451+ Pos MHC Peptide Core Of Gp Gl Ip Il Icore Identity Score_EL %Rank_EL Score_BA %Rank_BA Aff(nM) BindLevel
452+ ---------------------------------------------------------------------------------------------------------------------------
453+ 1 HLA-A*03:01 GKSGGGRCGGG GKSGGGRGG 0 7 2 0 0 GKSGGGRCGGG seq1 0.0000000 100.000 0.009240 95.346 45243.03
454+ ---------------------------------------------------------------------------------------------------------------------------
455+
456+ Protein seq1. Allele HLA-A*03:01. Number of high binders 0. Number of weak binders 0. Number of peptides 1
457+
458+ -----------------------------------------------------------------------------------
459+ """
460+
461+ # the offset specified in "pos" (at index 0) is 1-based instead of 0-based. we adjust it to be
462+ # 0-based, as in all the other netmhc predictors supported by this library.
463+ transforms = {
464+ 0 : lambda x : int (x ) - 1 ,
465+ }
466+ return parse_stdout (
467+ stdout = stdout ,
468+ prediction_method_name = prediction_method_name ,
469+ sequence_key_mapping = sequence_key_mapping ,
470+ key_index = 10 ,
471+ offset_index = 0 ,
472+ peptide_index = 2 ,
473+ allele_index = 1 ,
474+ score_index = 11 if mode == "elution_score" else 13 ,
475+ ic50_index = None if mode == "elution_score" else 15 ,
476+ rank_index = 12 if mode == "elution_score" else 14 ,
477+ transforms = transforms )
478+
403479
404480def parse_netmhccons_stdout (
405481 stdout ,
0 commit comments