Skip to content

Commit 8d99782

Browse files
committed
add cli options to assign pangenome outgroups
1 parent e1728d7 commit 8d99782

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/cactus/refmap/cactus_pangenome.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def main():
5252
parser.add_argument("seqFile", help = "Seq file (will be modified if necessary to include graph Fasta sequence)")
5353
parser.add_argument("--outDir", help = "Output directory", required=True)
5454
parser.add_argument("--outName", help = "Output name (without extension)", required=True)
55-
parser.add_argument("--reference", required=True, nargs='+', type=str, help = "Reference event name(s). The first will be the \"true\" reference and will be left unclipped and uncollapsed. It also should have been used with --reference in all upstream commands. Other names will be promoted to reference paths in vg")
55+
parser.add_argument("--reference", required=True, nargs='+', type=str, help = "Reference event name(s). The first will be the \"true\" reference and will be left unclipped and uncollapsed. It also should have been used with --reference in all upstream commands. Other names will be promoted to reference paths in vg")
56+
parser.add_argument("--outgroup", type=str, nargs='+', help = "Use given genome as outgroup. Multiple allowed")
5657

5758
# cactus-minigraph options
5859
parser.add_argument("--mgCores", type=int, help = "Number of cores for minigraph construction (defaults to the same as --maxCores).")

src/cactus/setup/cactus_align.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def main():
6969
parser.add_argument("--outGFA", action="store_true", help = "export pangenome grpah in GFA (.gfa.gz) in addition to HAL")
7070
parser.add_argument("--batch", action="store_true", help = "Launch batch of alignments. Input seqfile is expected to be chromfile as generated by cactus-graphmap-slit. IMPORTANT: paffile argument should bot be specified when using this option")
7171
parser.add_argument("--reference", type=str, help = "Ensure that given genome is acyclic by deleting all paralogy edges in postprocessing, also do not mask its PAF mappings")
72+
parser.add_argument("--outgroup", type=str, nargs='+', help = "Use given genome as outgroup. Only works with --pangenome. Multiple allowed")
7273

7374
#Progressive Cactus Options
7475
parser.add_argument("--configFile", dest="configFile",
@@ -130,7 +131,10 @@ def main():
130131
raise RuntimeError('--consCores required for non single_machine batch systems')
131132
if options.maxCores is not None and options.consCores > int(options.maxCores):
132133
raise RuntimeError('--consCores must be <= --maxCores')
133-
134+
135+
if options.outgroup and not options.pangenome:
136+
raise RuntimeError('--outgroup can only be used with --pangenome')
137+
134138
options.buildHal = True
135139
options.buildFasta = True
136140

@@ -261,6 +265,9 @@ def make_align_job(options, toil, config_wrapper=None, chrom_name=None):
261265
if options.reference and options.pangenome:
262266
# validate the sample names
263267
check_sample_names(input_seq_map.keys(), options.reference)
268+
269+
if options.outgroup and options.pangenome:
270+
og_map[ options.root if options.root else mc_tree.getRootName()] = options.outgroup
264271

265272
# apply path overrides. this was necessary for wdl which doesn't take kindly to
266273
# text files of local paths (ie seqfile). one way to fix would be to add support

0 commit comments

Comments
 (0)