@@ -39,8 +39,12 @@ def merge_group(group):
39
39
40
40
return merged_row
41
41
42
+ ### format input flagged t13 binary hit file
43
+ redcap_t13_hit_binary_output = fl_t13_hit_binary_output_2 .copy ()
44
+ redcap_t13_hit_binary_output = redcap_t13_hit_binary_output .astype (str )
45
+
42
46
### convert 0 to 2 (negative)
43
- redcap_t13_hit_binary_output = fl_t13_hit_binary_output_2 .replace (0 , 2 )
47
+ redcap_t13_hit_binary_output = redcap_t13_hit_binary_output .replace (to_replace = r'^0.*' , value = 2 , regex = True )
44
48
45
49
### drop any rows incl and below 'Summary' row
46
50
if 'Summary' in redcap_t13_hit_binary_output .index :
@@ -64,7 +68,7 @@ def merge_group(group):
64
68
test_redcap_t13_hit_binary_output.loc[cont_ntc_sample, cont_ntc_assay] = '6'
65
69
"""
66
70
redcap_t13_hit_binary_output = redcap_t13_hit_binary_output .astype (str )
67
- redcap_t13_hit_binary_output = redcap_t13_hit_binary_output .applymap (lambda x : '6' if '†' in x else x )
71
+ redcap_t13_hit_binary_output = redcap_t13_hit_binary_output .map (lambda x : '6' if '†' in x else x )
68
72
69
73
70
74
@@ -98,7 +102,7 @@ def merge_group(group):
98
102
### add columns for the assay that wasn't run with since REDCAP format needs all assays (RVP and BBP) headers in
99
103
bbp_assays = ['CCHFV' , 'CHI' , 'DENV' , 'EBOV' , 'HBV_DNA' , 'HCV' , 'HIV_1' , 'HIV_2' , 'HTV' , 'LASV' , 'MBV' , 'MMV' ,
100
104
'MPOX_DNA' , 'ONN' , 'PF_3_DNA' , 'RBV' , 'RVFV' , 'SYPH_DNA' , 'WNV' , 'YFV' , 'ZIKV' ]
101
- rvp_assays = ['SARS-COV- 2' , 'HCOV-HKU1 ' , 'HCOV-NL63 ' , 'HCOV-OC43 ' , 'FLUAV' , 'FLUBV' , 'HMPV' , 'HRSV' , 'HPIV-3 ' ]
105
+ rvp_assays = ['SARS_COV- 2' , 'HCOV_HKU1 ' , 'HCOV_NL63 ' , 'HCOV_OC43 ' , 'FLUAV' , 'FLUBV' , 'HMPV' , 'HRSV' , 'HPIV_3 ' ]
102
106
# set column order
103
107
column_order = bbp_assays + rvp_assays + ['RNASEP_P1' ,'RNASEP_P2' ]
104
108
# when adding the new columns, enter the value as 4 (not run)
0 commit comments