Skip to content

Commit

Permalink
* removed polyA_adapter_trimming=false support throughout. If it's pr…
Browse files Browse the repository at this point in the history
…esent in a user's config.yaml, this will trigger a warning and be overriden with 'true'
  • Loading branch information
marvin-jens committed Apr 21, 2023
1 parent b1fc856 commit 18b9d0e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
31 changes: 22 additions & 9 deletions spacemake/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def get_run_mode_parser(required=True):
+ "parameter is set, contiguous islands within umi_cutoff passing beads will "
+ "also be included in the analysis",
)
parser.add_argument(
"--polyA_adapter_trimming",
required=False,
choices=bool_in_str,
type=str,
help="if set, reads will have polyA stretches and adapter sequence overlaps trimmed "
+ "BEFORE mapping.",
)
# parser.add_argument(
# "--polyA_adapter_trimming",
# required=False,
# choices=bool_in_str,
# type=str,
# help="if set, reads will have polyA stretches and adapter sequence overlaps trimmed "
# + "BEFORE mapping.",
# )
parser.add_argument(
"--count_intronic_reads",
required=False,
Expand Down Expand Up @@ -581,6 +581,18 @@ def correct(self):
if not var in RunMode.variable_types:
del variables[var]

if ("polyA_adapter_trimming" in variables) and (
variables["polyA_adapter_trimming"] == False
):
import logging

logger = logging.getLogger("spacemake.config")
logger.warning(
f"WARNING: run_mode {run_mode_name} lists polyA_adapter_trimming=false. This is no longer supported and will be overriden with true"
)
variables["polyA_adapter_trimming"] = True

# print(f"assigning run mode {run_mode_name}: {variables}")
self.variables["run_modes"][run_mode_name] = variables

def dump(self):
Expand Down Expand Up @@ -723,7 +735,7 @@ def add_variable(self, variable, name, **kwargs):
# --name is absolutely REQUIRED and its value has to map somehow onto
# an internal function name
# @TAMAS: can you help?
print(f"add_variable() called with variable={variable} name={name} kw={kwargs}")
# print(f"add_variable() called with variable={variable} name={name} kw={kwargs}")

if variable == "species":
# for the species command, collision check is on the reference name, not the species name
Expand Down Expand Up @@ -769,6 +781,7 @@ def update_variable(self, variable, name, **kwargs):
return variable_data

def get_variable(self, variable, name):
# print(f"config.get_variable({variable}, {name})")
if not self.variable_exists(variable, name):
raise ConfigVariableNotFoundError(variable, name)
else:
Expand Down
2 changes: 0 additions & 2 deletions spacemake/data/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ run_modes:
umi_cutoff: [1000]
clean_dge: False
detect_tissue: True
polyA_adapter_trimming: False
count_intronic_reads: False
count_mm_reads: True
slide_seq:
Expand All @@ -47,7 +46,6 @@ run_modes:
n_beads: 10000
umi_cutoff: [500]
detect_tissue: False
polyA_adapter_trimming: True
count_intronic_reads: True
count_mm_reads: False
seq_scope:
Expand Down
1 change: 0 additions & 1 deletion spacemake/snakemake/scripts/snakemake_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def get_output_files(

for run_mode in row["run_mode"]:
run_mode_variables = project_df.config.get_run_mode(run_mode).variables

if "polyA_adapter_trimmed" in kwargs:
polyA_adapter_trimmed = kwargs["polyA_adapter_trimmed"]
else:
Expand Down

0 comments on commit 18b9d0e

Please sign in to comment.