Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…that caused boolean values to be converted into integers.
  • Loading branch information
lucventurini committed Oct 25, 2019
1 parent da0265b commit 5d9794a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Mikado/daijin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def assemble_transcripts_pipeline(args):
prefix="assemble")
yaml.dump(doc, yaml_file)
yaml_file.flush()
shutil.copystat(args.config, yaml_file.name)

if args.latency_wait is not None:
latency = abs(args.latency_wait)
Expand Down Expand Up @@ -400,7 +401,8 @@ def assemble_transcripts_pipeline(args):
"printdag": args.dag,
"forceall": args.dag,
"forcerun": args.forcerun,
"lock": (not args.nolock)
"lock": (not args.nolock),
"printreason": True
}

if "configfile" in inspect.getfullargspec(snakemake.snakemake).args:
Expand Down Expand Up @@ -494,6 +496,7 @@ def mikado_pipeline(args):
)
yaml.dump(doc, yaml_file)
yaml_file.flush()
shutil.copystat(args.config, yaml_file.name)

if SCHEDULER == "local":
hpc_conf = None
Expand Down Expand Up @@ -541,6 +544,7 @@ def mikado_pipeline(args):
"forceall": args.dag,
"forcerun": args.forcerun,
"lock": (not args.nolock),
"printreason": True
}

if "configfile" in inspect.getfullargspec(snakemake.snakemake).args:
Expand Down
1 change: 1 addition & 0 deletions Mikado/loci/superlocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def define_subloci(self):

if self.subloci_defined is True:
return

self.compile_requirements()
self.subloci = []

Expand Down
10 changes: 6 additions & 4 deletions Mikado/transcripts/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ def __initialize_with_gf(self, transcript_row: (GffLine, GtfLine)):
pass
elif val in booleans:
val = booleans[val]
elif isinstance(val, bool):
pass
else:
try:
val = int(val)
Expand Down Expand Up @@ -994,7 +996,7 @@ def is_reference(self, value):
value = False
else:
pass
if value not in (False, True, None):
if not isinstance(value, bool) and value is not None:
raise ValueError("Invalid value: {} (type: {})".format(value, type(value)))
self.__is_reference = value

Expand Down Expand Up @@ -2824,7 +2826,7 @@ def has_start_codon(self):
def has_start_codon(self, value):
"""Setter. Checks that the argument is boolean."""

if value not in (None, False, True):
if not isinstance(value, bool) and value is not None:
raise TypeError(
"Invalid value for has_start_codon: {0}".format(type(value)))
self.__has_start_codon = value
Expand All @@ -2841,7 +2843,7 @@ def has_stop_codon(self):
def has_stop_codon(self, value):
"""Setter. Checks that the argument is boolean."""

if value not in (None, False, True):
if not isinstance(value, bool) and value is not None:
raise TypeError(
"Invalid value for has_stop_codon: {0}".format(type(value)))

Expand Down Expand Up @@ -3539,7 +3541,7 @@ def suspicious_splicing(self):

mixed = bool(self.attributes.get("mixed_splices", False))
canonical_on_reverse = self.attributes.get("canonical_on_reverse_strand", False)
if canonical_on_reverse not in (True, False):
if not isinstance(canonical_on_reverse, bool):
canonical_on_reverse = literal_eval(canonical_on_reverse)
self.attributes["canonical_on_reverse_strand"] = canonical_on_reverse

Expand Down

0 comments on commit 5d9794a

Please sign in to comment.