@@ -157,21 +157,29 @@ def combine_groot_mappings(argannot_path, resfinder_path, card_path, missing_pat
157
157
card_groot_mapping ,
158
158
missing_groot_mapping
159
159
]).sort_values (by = ['Original ID' ])
160
- comb_groot_mapping .to_csv ('./mapping/groot_ARO_mapping.tsv' , sep = '\t ' , index = False )
160
+ oname_aro = 'mapping/groot_ARO_mapping.tsv'
161
+ comb_groot_mapping .to_csv (oname_aro , sep = '\t ' , index = False )
161
162
162
163
groot_missing_genes = []
163
164
with open ('./manual_curation/groot_missing.fasta' , 'r' ) as ifile :
164
165
for record in SeqIO .parse (ifile , 'fasta' ):
165
166
groot_missing_genes .append (record .id )
166
167
167
168
groot_manual_curation = pd .DataFrame (list (set (groot_missing_genes ) - set (comb_groot_mapping ['Original ID' ])), columns = ['Original ID' ])
168
- groot_manual_curation .to_csv ('./manual_curation/groot_curation.tsv' , sep = '\t ' , index = False )
169
+ oname_manual = 'manual_curation/groot_curation.tsv'
170
+ groot_manual_curation .to_csv (oname_manual , sep = '\t ' , index = False )
171
+ return oname_aro , oname_manual
172
+
173
+ @TaskGenerator
174
+ def copy_file (oname , dest ):
175
+ os .makedirs (os .path .dirname (dest ), exist_ok = True )
176
+ os .rename (oname , dest )
177
+ return dest
169
178
170
179
def get_groot_aro_mapping ():
171
180
argannot_input = get_groot_argannot_db ()
172
181
resfinder_input = get_groot_resfinder_db ()
173
182
card_input = get_groot_card_db ()
174
183
missing_input = get_groot_missing ()
175
- combine_groot_mappings (argannot_input , resfinder_input , card_input , missing_input )
176
- barrier ()
177
- os .rename ('./mapping/groot_ARO_mapping.tsv' , '../argnorm/data/groot_ARO_mapping.tsv' )
184
+ onames = combine_groot_mappings (argannot_input , resfinder_input , card_input , missing_input )
185
+ copy_file (onames [0 ], '../argnorm/data/groot_ARO_mapping.tsv' )
0 commit comments