diff --git a/.tests/config/config.yaml b/.tests/config/config.yaml index 95d35f8..8def1fa 100644 --- a/.tests/config/config.yaml +++ b/.tests/config/config.yaml @@ -14,6 +14,8 @@ input: ../incoming/ data: data/ # Path to the sheet holding metadata information metadata: config/pep/metadata.txt +# Remove columns from analysis +remove-columns: ["site-name"] # Paths to the databases used for classification and taxonomy database: download-path-seq: resources/silva-138-99-seqs.qza diff --git a/config/config.yaml b/config/config.yaml index fd7db0d..ef7fddb 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -14,6 +14,8 @@ input: ../incoming/ data: data/ # Path to the sheet holding metadata information metadata: config/pep/metadata.txt +# Remove columns from analysis +remove-columns: ["site-name"] # Paths to the databases used for classification and taxonomy database: download-path-seq: https://data.qiime2.org/2022.2/common/silva-138-99-seqs.qza diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index 9d9deb5..0315905 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -90,6 +90,11 @@ def get_reads_for_kraken(): def get_metadata_columns(): metadata = pd.read_csv(config["metadata"], header=0, delimiter=",") header = metadata.columns[metadata.isin(["numeric"]).any()].values.tolist() + remove_list = config["remove-columns"] + if len(remove_list) != 0: + for item in remove_list: + if item in header: + header.remove(item) return header @@ -106,5 +111,10 @@ def get_metadata_categorical_columns(): if "barcode" in name: namelist.remove(name) y = y + 1 + remove_list = config["remove-columns"] + if len(remove_list) != 0: + for item in remove_list: + if item in header: + namelist.remove(item) print(namelist) return namelist