Skip to content

Commit

Permalink
assemble/recover: Require users to specify coassembly or not.
Browse files Browse the repository at this point in the history
Fixes #219.
  • Loading branch information
wwood committed Nov 2, 2024
1 parent 2664ca1 commit 3c1c34d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ aviary_genome.egg-info

example/
test/data/.conda
test/data/wgsim.metaspades.assembly.fna.fai
1 change: 0 additions & 1 deletion aviary/aviary.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ def main():
nargs='?',
const=True,
dest='coassemble',
default=False,
)

assemble_group.add_argument(
Expand Down
12 changes: 10 additions & 2 deletions aviary/modules/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def __init__(self,
self.pe2 = 'none'
self.short_percent_identity = 'none'


try:
self.kmer_sizes = args.kmer_sizes
self.use_megahit = args.use_megahit
Expand All @@ -246,7 +245,7 @@ def __init__(self,
except AttributeError:
self.kmer_sizes = ['auto']
self.use_megahit = False
self.coassemble = True
self.coassemble = False
self.min_cov_long = 20
self.min_cov_short = 3
self.exclude_contig_cov = 100
Expand Down Expand Up @@ -346,6 +345,15 @@ def make_config(self):

with open(template_conf_file) as template_config:
conf = yaml.load(template_config)

if self.assembly == 'none' or self.assembly is None:
# Check if coassembly or not needs to be specified by the user.
if self.coassemble is None:
if len(self.pe1) > 1 or len(self.longreads) > 1:
logging.error("Multiple readsets detected. Either specify '--coassemble' for coassembly of or '--coassemble no'.")
sys.exit(-1)
if self.coassemble is None:
self.coassemble = False # ensure that something is specified so that the config file is well formed

if self.assembly != "none" and self.assembly is not None:
self.assembly = list(dict.fromkeys([os.path.abspath(p) for p in self.assembly]))
Expand Down

0 comments on commit 3c1c34d

Please sign in to comment.