Skip to content

Commit

Permalink
integrated option to only align a subset of core genes and fixed a bu…
Browse files Browse the repository at this point in the history
…g in the alignment option of the merge graph script
  • Loading branch information
gtonkinhill committed Dec 20, 2023
1 parent 647443a commit 7ef8576
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion panaroo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def get_options(args):
default=0.95)
core.add_argument("--core_subset",
dest="subset",
help="Subset the core genome to these many random genes (default=all)",
help="Randomly subset the core genome to these many genes (default=all)",
type=int,
default=None)
core.add_argument("--core_entropy_filter",
Expand Down
19 changes: 15 additions & 4 deletions panaroo/merge_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def merge_graphs(directories,
aln,
alr,
core,
codons,
hc_threshold,
subset=None,
merge_single=False,
Expand Down Expand Up @@ -425,14 +426,15 @@ def merge_graphs(directories,
if aln == "pan":
if not quiet: print("generating pan genome MSAs...")
generate_pan_genome_alignment(G, temp_dir, output_dir, n_cpu, alr,
isolate_names)
codons, isolate_names)
core_nodes = get_core_gene_nodes(G, core, len(isolate_names))
concatenate_core_genome_alignments(core_nodes, output_dir, hc_threshold)
elif aln == "core":
if not quiet: print("generating core genome MSAs...")
generate_core_genome_alignment(G, temp_dir, output_dir, n_cpu, alr,
isolate_names, core, len(isolate_names),
hc_thresholdi, subset)
isolate_names, core, codons, len(isolate_names),
hc_threshold, subset)

return


Expand Down Expand Up @@ -529,14 +531,21 @@ def get_options():
type=str,
choices=['prank', 'clustal', 'mafft'],
default="mafft")
core.add_argument(
"--codons",
dest="codons",
help=
"Generate codon alignments by aligning sequences at the protein level",
action='store_true',
default=False)
core.add_argument("--core_threshold",
dest="core",
help="Core-genome sample threshold (default=0.95)",
type=float,
default=0.95)
core.add_argument("--core_subset",
dest="subset",
help="Subset the core genome to these many random genes (default=all)",
help="Randomly subset the core genome to these many genes (default=all)",
type=int,
default=None)
core.add_argument("--core_entropy_filter",
Expand Down Expand Up @@ -596,7 +605,9 @@ def main():
aln=args.aln,
alr=args.alr,
core=args.core,
codons=args.codons,
hc_threshold=args.hc_threshold,
subset=args.subset,
n_cpu=args.n_cpu,
quiet=args.quiet)

Expand Down

0 comments on commit 7ef8576

Please sign in to comment.