File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88"""
99
1010import collections
11- import os
1211
1312
14- def tidy_output_dir (mothur_obj , whitelist = list ()):
15- """Removes files from the output directory that are not listed in the current_files attribute or a whitelist."""
16-
17- # append current files to whitelist
18- for file in mothur_obj .current_files .values ():
19- whitelist .append (file )
20-
21- # tidy up environment to help save space
22- out_dir = mothur_obj .current_dirs .get ('output' , None )
23-
24- # purge non-whitelist files from the output directory
25- for file in os .listdir (out_dir ):
26-
27- # conditionally correct filepath
28- if out_dir is not None :
29- file = os .path .join (out_dir , file )
30-
31- # only process files, not directories
32- if os .path .isfile (file ):
33- if file not in whitelist :
34- os .remove (file )
35-
3613def format_mothur_params (* args , ** kwargs ):
3714 """Formats mothur command paramters from python variables into a string formatted for mothur."""
3815
You can’t perform that action at this time.
0 commit comments