|
23 | 23 | from future.utils import viewitems
|
24 | 24 | from biom import load_table
|
25 | 25 | from biom.util import biom_open
|
| 26 | +from re import sub |
26 | 27 | import pandas as pd
|
27 | 28 |
|
28 | 29 | from qiita_core.exceptions import IncompetentQiitaDeveloperError
|
@@ -789,15 +790,12 @@ def build_files(self, merge_duplicated_sample_ids):
|
789 | 790 | if bi['artifact_id'] == aid][0]
|
790 | 791 |
|
791 | 792 | data_type = ainfo['data_type']
|
792 |
| - algorithm = ainfo['algorithm'] |
793 |
| - target_subfragment = ainfo['target_subfragment'] |
794 |
| - parameters = ['%s: %s' % (k, v) |
795 |
| - for k, v in viewitems(ainfo['parameters'])] |
| 793 | + # algorithm is: processing_method | parent_processing, just |
| 794 | + # keeping processing_method |
| 795 | + algorithm = ainfo['algorithm'].split('|')[0].strip() |
796 | 796 | files = ainfo['files']
|
797 | 797 |
|
798 |
| - l = "%s || %s || %s || %s" % ( |
799 |
| - data_type, algorithm, ','.join(target_subfragment), |
800 |
| - ', '.join(parameters)) |
| 798 | + l = "%s || %s" % (data_type, algorithm) |
801 | 799 | # deblur special case, we need to account for file name
|
802 | 800 | if 'deblur-workflow' in algorithm:
|
803 | 801 | # [0] there is always just one biom
|
@@ -841,8 +839,8 @@ def _build_biom_tables(self, grouped_samples, rename_dup_samples=False):
|
841 | 839 |
|
842 | 840 | biom_files = []
|
843 | 841 | for label, tables in viewitems(grouped_samples):
|
844 |
| - data_type, algorithm, target_subfragment, \ |
845 |
| - parameters, files = [l.strip() for l in label.split('||')] |
| 842 | + data_type, algorithm, files = [ |
| 843 | + l.strip() for l in label.split('||')] |
846 | 844 |
|
847 | 845 | new_table = None
|
848 | 846 | artifact_ids = []
|
@@ -891,9 +889,10 @@ def _build_biom_tables(self, grouped_samples, rename_dup_samples=False):
|
891 | 889 | "analysis due to rarefaction level")
|
892 | 890 |
|
893 | 891 | # write out the file
|
894 |
| - info = "%s_%s_%s_%s_%s" % ( |
895 |
| - data_type, algorithm, target_subfragment, parameters, |
896 |
| - files) |
| 892 | + data_type = sub('[^0-9a-zA-Z]+', '', data_type) |
| 893 | + algorithm = sub('[^0-9a-zA-Z]+', '', algorithm) |
| 894 | + files = sub('[^0-9a-zA-Z]+', '', files) |
| 895 | + info = "%s_%s_%s" % (data_type, algorithm, files) |
897 | 896 | fn = "%d_analysis_%s.biom" % (self._id, info)
|
898 | 897 | biom_fp = join(base_fp, fn)
|
899 | 898 | with biom_open(biom_fp, 'w') as f:
|
|
0 commit comments