@@ -889,6 +889,7 @@ elif args.command == "util":
889
889
qs_parser .add_argument ("-l" , "--lineagefile" , action = "store" )
890
890
qs_parser .add_argument ("-b" , "--stopby" , action = "store" , default = None )
891
891
qs_parser .add_argument ("-a" , "--selecttaxa" , action = "store" , default = "" )
892
+ qs_parser .add_argument ("--config-file" , dest = "configfile" , action = "store" , default = "data/config.yaml" )
892
893
qs_parser .add_argument ("--quiet" , action = "store_true" , default = False )
893
894
qs_args = qs_parser .parse_args (args .arguments )
894
895
if qs_args .help :
@@ -904,10 +905,34 @@ elif args.command == "util":
904
905
sys .exit (1 )
905
906
elif qs_args .intrees == "all" :
906
907
print (now (), "Will compare all trees, this expects phylociraptor mltree and/or speciestree to be finished." )
907
- iqtree_trees = glob .glob ("results/phylogeny-*/iqtree/*/concat.contree" )
908
- raxml_trees = glob .glob ("results/phylogeny-*/raxml/*/raxmlng.raxml.support" )
909
- astral_trees = glob .glob ("results/phylogeny-*/astral/*/species_tree.tre" )
910
- all_trees = "," .join (iqtree_trees + raxml_trees + astral_trees )
908
+ print (now (), "Calculating analysis hashes for mltree, this may take a few seconds..." )
909
+ hashes = {}
910
+ hashes ["mltree" ] = collect_hashes ("mltree" , parse_config_file (qs_args .configfile ), qs_args .configfile , debug = qs_args .debug , wd = os .getcwd ())
911
+ print (now (), "Calculating analysis hashes for speciestree, this may take a few seconds..." )
912
+ hashes ["speciestree" ] = collect_hashes ("speciestree" , parse_config_file (qs_args .configfile ), qs_args .configfile , debug = qs_args .debug , wd = os .getcwd ())
913
+ combinations = []
914
+ #first calculate all possible combinations:
915
+ for bs in hashes ["mltree" ]["mltree" ]["per" ]:
916
+ for treeprog in hashes ["mltree" ]["mltree" ]["per" ][bs ]:
917
+ for trimmer in hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ]:
918
+ for aligner in hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ]:
919
+ if treeprog == "iqtree" :
920
+ filename = "concat.contree"
921
+ elif treeprog == "raxml" :
922
+ filename = "raxmlng.raxml.support"
923
+ combinations .append ("results/phylogeny/" + treeprog + "/bootstrap-cutoff-" + bs + "/" + aligner + "-" + trimmer + "." + hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ][aligner ] + "/" + filename )
924
+ for bs in hashes ["speciestree" ]["speciestree" ]["per" ]:
925
+ for treeprog in hashes ["speciestree" ]["speciestree" ]["per" ][bs ]:
926
+ for trimmer in hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ]:
927
+ for aligner in hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ]:
928
+ combinations .append ("results/phylogeny/" + treeprog + "/bootstrap-cutoff-" + bs + "/" + aligner + "-" + trimmer + "." + hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ][aligner ] + "/species_tree.tre" )
929
+ # now check which files are there in the file system:
930
+ iqtree_trees = glob .glob ("results/phylogeny/iqtree/bootstrap-cutoff-*/*/concat.contree" )
931
+ raxml_trees = glob .glob ("results/phylogeny/raxml/bootstrap-cutoff-*/*/raxmlng.raxml.support" )
932
+ astral_trees = glob .glob ("results/phylogeny/astral/bootstrap-cutoff-*/*/species_tree.tre" )
933
+ all_trees = iqtree_trees + raxml_trees + astral_trees
934
+ all_trees = [tree for tree in all_trees if tree in combinations ] #keep only files which are specified in config file.
935
+ all_trees = "," .join (all_trees )
911
936
else :
912
937
all_trees = qs_args .intrees
913
938
cmd = ["singularity" , "exec" , "-B" , os .getcwd (), "docker://reslp/phylopy:2" , "python" , "bin/estimate_conflict.py" , "-i" , all_trees , "-o" , qs_args .outfile , "-s" , qs_args .seed , "-t" , qs_args .threads ]
@@ -937,6 +962,7 @@ elif args.command == "util":
937
962
qs_parser .add_argument ("-l" , "--lineagefile" , action = "store" , default = "none" )
938
963
qs_parser .add_argument ("-e" , "--level" , action = "store" , default = "none" )
939
964
qs_parser .add_argument ("-s" , "--seed" , action = "store" , default = "random" )
965
+ qs_parser .add_argument ("--config-file" , dest = "configfile" , action = "store" , default = "data/config.yaml" )
940
966
qs_parser .add_argument ("--quiet" , action = "store_true" , default = False )
941
967
qs_parser .add_argument ("--single" , action = "store_true" , default = False )
942
968
qs_args = qs_parser .parse_args (args .arguments )
@@ -949,10 +975,34 @@ elif args.command == "util":
949
975
sys .exit (1 )
950
976
elif qs_args .intrees == "all" :
951
977
print (now (), "Will compare all trees, this expects phylociraptor mltree and/or speciestree to be finished." )
952
- iqtree_trees = glob .glob ("results/phylogeny-*/iqtree/*/concat.contree" )
953
- raxml_trees = glob .glob ("results/phylogeny-*/raxml/*/raxmlng.raxml.support" )
954
- astral_trees = glob .glob ("results/phylogeny-*/astral/*/species_tree.tre" )
955
- all_trees = "," .join (iqtree_trees + raxml_trees + astral_trees )
978
+ print (now (), "Calculating analysis hashes for mltree, this may take a few seconds..." )
979
+ hashes = {}
980
+ hashes ["mltree" ] = collect_hashes ("mltree" , parse_config_file (qs_args .configfile ), qs_args .configfile , debug = qs_args .debug , wd = os .getcwd ())
981
+ print (now (), "Calculating analysis hashes for speciestree, this may take a few seconds..." )
982
+ hashes ["speciestree" ] = collect_hashes ("speciestree" , parse_config_file (qs_args .configfile ), qs_args .configfile , debug = qs_args .debug , wd = os .getcwd ())
983
+ combinations = []
984
+ #first calculate all possible combinations:
985
+ for bs in hashes ["mltree" ]["mltree" ]["per" ]:
986
+ for treeprog in hashes ["mltree" ]["mltree" ]["per" ][bs ]:
987
+ for trimmer in hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ]:
988
+ for aligner in hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ]:
989
+ if treeprog == "iqtree" :
990
+ filename = "concat.contree"
991
+ elif treeprog == "raxml" :
992
+ filename = "raxmlng.raxml.support"
993
+ combinations .append ("results/phylogeny/" + treeprog + "/bootstrap-cutoff-" + bs + "/" + aligner + "-" + trimmer + "." + hashes ["mltree" ]["mltree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ][aligner ] + "/" + filename )
994
+ for bs in hashes ["speciestree" ]["speciestree" ]["per" ]:
995
+ for treeprog in hashes ["speciestree" ]["speciestree" ]["per" ][bs ]:
996
+ for trimmer in hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ]:
997
+ for aligner in hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ]:
998
+ combinations .append ("results/phylogeny/" + treeprog + "/bootstrap-cutoff-" + bs + "/" + aligner + "-" + trimmer + "." + hashes ["speciestree" ]["speciestree" ]["per" ][bs ][treeprog ]["iqtree" ][trimmer ][aligner ] + "/species_tree.tre" )
999
+ # now check which files are there in the file system:
1000
+ iqtree_trees = glob .glob ("results/phylogeny/iqtree/bootstrap-cutoff-*/*/concat.contree" )
1001
+ raxml_trees = glob .glob ("results/phylogeny/raxml/bootstrap-cutoff-*/*/raxmlng.raxml.support" )
1002
+ astral_trees = glob .glob ("results/phylogeny/astral/bootstrap-cutoff-*/*/species_tree.tre" )
1003
+ all_trees = iqtree_trees + raxml_trees + astral_trees
1004
+ all_trees = [tree for tree in all_trees if tree in combinations ] #keep only files which are specified in config file.
1005
+ all_trees = "," .join (all_trees )
956
1006
else :
957
1007
all_trees = qs_args .intrees
958
1008
if qs_args .single :
0 commit comments