@@ -1783,7 +1783,7 @@ def add_help_arguments(parser: argparse.ArgumentParser):
17831783 )
17841784
17851785
1786- def add_general_arguments (subparser : argparse .ArgumentParser ):
1786+ def add_universal_arguments (subparser : argparse .ArgumentParser ):
17871787 add_help_arguments (subparser )
17881788 reqos = subparser .add_argument_group (title = "Output" , description = None )
17891789 reqos .add_argument (
@@ -1795,9 +1795,22 @@ def add_general_arguments(subparser: argparse.ArgumentParser):
17951795 required = True ,
17961796 )
17971797
1798+
1799+ # TODO: These are not general.
1800+ # Outdir: All
1801+ # Minlength: Composition and abundance
1802+ # Nthreads: abundance, encoding and clustering
1803+ # norefcheck: abundance, encoding, clustering
1804+ # cuda: encoding and clustering
1805+ # seed: encoding and clustering
1806+ def add_general_group (subparser : argparse .ArgumentParser ) -> argparse ._ArgumentGroup :
17981807 general = subparser .add_argument_group (
17991808 title = "General optional arguments" , description = None
18001809 )
1810+ return general
1811+
1812+
1813+ def add_minlength (general : argparse ._ArgumentGroup ):
18011814 general .add_argument (
18021815 "-m" ,
18031816 dest = "minlength" ,
@@ -1807,6 +1820,13 @@ def add_general_arguments(subparser: argparse.ArgumentParser):
18071820 help = "Ignore contigs shorter than this [2000]" ,
18081821 )
18091822
1823+
1824+ def add_general_arguments (subparser : argparse .ArgumentParser ):
1825+ add_universal_arguments (subparser )
1826+
1827+ general = add_general_group (subparser )
1828+ add_minlength (general )
1829+
18101830 general .add_argument (
18111831 "-p" ,
18121832 dest = "nthreads" ,
@@ -2264,6 +2284,7 @@ def main():
22642284 TAXVAMB = "taxvamb"
22652285 AVAMB = "avamb"
22662286 RECLUSTER = "recluster"
2287+ PARTIAL = "partial"
22672288
22682289 vaevae_parserbin_parser = subparsers .add_parser (
22692290 BIN ,
@@ -2381,6 +2402,19 @@ def main():
23812402 add_predictor_arguments (recluster_parser )
23822403 add_taxonomy_arguments (recluster_parser )
23832404
2405+ partial_subparser = subparsers .add_parser (
2406+ PARTIAL , help = "Process individual parts of the VAMB pipelines" , add_help = False
2407+ )
2408+ partial_part = partial_subparser .add_subparsers (dest = "partial_part" )
2409+
2410+ composition_parser = partial_part .add_parser (
2411+ "composition" , help = "Process composition data" , add_help = False
2412+ )
2413+ add_universal_arguments (composition_parser )
2414+ general = add_general_group (composition_parser )
2415+ add_minlength (general )
2416+ add_composition_arguments (composition_parser )
2417+
23842418 args = parser .parse_args ()
23852419
23862420 if args .subcommand == TAXOMETER :
@@ -2404,10 +2438,25 @@ def main():
24042438 opt = BinAvambOptions .from_args (args )
24052439 runner = partial (run_bin_aae , opt )
24062440 run (runner , opt .common .general )
2441+ else :
2442+ assert False # no other options
24072443 elif args .subcommand == RECLUSTER :
24082444 opt = ReclusteringOptions .from_args (args )
24092445 runner = partial (run_reclustering , opt )
24102446 run (runner , opt .general )
2447+ elif args .subcommand == PARTIAL :
2448+ # TODO: Not implemented. Need to refactor to universal options, then minlength, then add composition
2449+ # then make a function to run tnf only
2450+ if args .partial_part == "composition" :
2451+ opt = CompositionOptions .from_args (args )
2452+ runner = partial (run_tnf , opt )
2453+ run (runner , opt )
2454+ else :
2455+ # TODO: Add abundance
2456+ # TODO: Add encoding w. VAE
2457+ # TODO: Add encoding w. VAEVAE
2458+ # TODO: Add clustering
2459+ assert False # no other options
24112460 else :
24122461 # There are no more subcommands
24132462 assert False
0 commit comments