Skip to content

Commit

Permalink
feat: possibility to manually exclude metadata columns (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
AKBrueggemann authored Oct 4, 2022
1 parent 209a0f9 commit 6758bf5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .tests/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

0 comments on commit 6758bf5

Please sign in to comment.