[med-svn] [gubbins] 01/03: New upstream version 2.3.1

Sascha Steinbiss satta at debian.org
Sun Oct 1 11:12:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

satta pushed a commit to branch master
in repository gubbins.

commit c60f7a847aa408a74fa45777e1cda14fbe821638
Author: Sascha Steinbiss <satta at debian.org>
Date:   Sun Oct 1 11:58:51 2017 +0100

    New upstream version 2.3.1
---
 CHANGELOG                                          |  24 +++++++
 GubbinsManual_latest.docx                          | Bin 0 -> 376839 bytes
 INSTALL.md                                         |   8 +++
 README.md                                          |   5 ++
 VERSION                                            |   2 +-
 python/gubbins/RAxMLExecutable.py                  |  10 +--
 python/gubbins/common.py                           |   2 +
 python/gubbins/tests/test_external_dependancies.py |  12 ++--
 python/scripts/gubbins_drawer.py                   |  74 +++++++++------------
 python/scripts/run_gubbins.py                      |  16 ++---
 10 files changed, 94 insertions(+), 59 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 91401a5..8c47364 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,23 @@
+v2.3.1 - 22 Sept 2017
+-----
+Output a tree with the internal nodes labelled.
+
+v2.3.0 - 21 Sept 2017
+-----
+Add helptext to gubbins drawer and require tree as a positional argument rather than an option.
+
+v2.2.3 - 15 Sept 2017
+-----
+Fix default extended help text.
+
+v2.2.2 - 4 Sept 2017
+-----
+Allow the use of RAXML AVX2 binaries. 
+
+v2.2.1 - 20 Feb 2017
+-----
+Remove use of Biopythons sub_features function which has been deprecated.
+
 v2.2.0 - 31 Oct 2016
 ------
 By default dont filter out sequences which are 100% identical.
@@ -14,6 +34,10 @@ Addresses speed issues raised by users.
 RAxML version 8 now required as a minimum.
 Remove pairwise support since RAxML wont support it. Need at least 4 genomes as input.
 
+v1.4.10 - 31 Oct 2016
+------
+Backport a change so that by default dont filter out sequences which are 100% identical.
+
 v1.4.9 - 15 Apr 2016
 ------
 If sequences are 100% identical, filter out duplicates.
diff --git a/GubbinsManual_latest.docx b/GubbinsManual_latest.docx
new file mode 100644
index 0000000..6e96873
Binary files /dev/null and b/GubbinsManual_latest.docx differ
diff --git a/INSTALL.md b/INSTALL.md
index f3de67b..7138573 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -9,6 +9,7 @@ There are a few ways to install Gubbins and its dependancies. The simpliest way
 * Linux - Ubuntu Xenial (16.04) & Debian (unstable)
 * Linux - CentOS 7
 * Linux - CentOS 6
+* OSX/Linux - Bioconda
 * OSX/Linux - from source
 * OSX/Linux/Windows - Virtual Machine
 
@@ -83,6 +84,13 @@ brew install ruby python3
 brew install gubbins
 ```
 
+## OSX/Linux - Bioconda
+Install conda and enable the bioconda channels.
+
+```
+conda install gubbins
+```
+
 ## OSX/Linux - from source
 This is the most difficult method and is only suitable for someone with advanced computing skills. Please consider using HomeBrew/LinuxBrew instead.
 
diff --git a/README.md b/README.md
index 77095e1..9ca04b8 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,11 @@ Do not remove files from intermediate iterations. This option will also keep oth
 
 Change the model used by RAxML. The default it GTRCAT (with -V). You can set it to GTRGAMMA.
     
+Generating Input files
+======================
+Any application which can generate a whole genome multi-FASTA alignment can be used with Gubbins, such as [Snippy](https://github.com/tseemann/snippy).
+    
+    
 Output files    
 ==========
 
diff --git a/VERSION b/VERSION
index ccbccc3..2bf1c1c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.0
+2.3.1
diff --git a/python/gubbins/RAxMLExecutable.py b/python/gubbins/RAxMLExecutable.py
index 2401a32..9b52b29 100644
--- a/python/gubbins/RAxMLExecutable.py
+++ b/python/gubbins/RAxMLExecutable.py
@@ -26,8 +26,8 @@ class RAxMLExecutable(object):
 	def __init__(self, threads, model = 'GTRCAT', verbose = False ):
 		self.verbose = verbose
 		self.threads = threads
-		self.single_threaded_executables = ['raxmlHPC-AVX','raxmlHPC-SSE3','raxmlHPC']
-		self.multi_threaded_executables = ['raxmlHPC-PTHREADS-AVX','raxmlHPC-PTHREADS-SSE3','raxmlHPC-PTHREADS']
+		self.single_threaded_executables = ['raxmlHPC-AVX2','raxmlHPC-AVX','raxmlHPC-SSE3','raxmlHPC']
+		self.multi_threaded_executables = ['raxmlHPC-PTHREADS-AVX2','raxmlHPC-PTHREADS-AVX','raxmlHPC-PTHREADS-SSE3','raxmlHPC-PTHREADS']
 		self.model = model
 		
 		self.raxml_executable = self.select_executable_based_on_threads()
@@ -59,7 +59,9 @@ class RAxMLExecutable(object):
 			
 		for executable in list_of_executables:
 			if os.path.exists('/proc/cpuinfo'):
-				if re.search('AVX', executable) and 'avx' not in flags:
+				if re.search('AVX2', executable) and 'avx2' not in flags:
+					continue
+				elif re.search('AVX', executable) and 'avx' not in flags:
 					continue
 				elif re.search('SSE3', executable) and 'ssse3'  not in flags:
 					continue
@@ -107,5 +109,5 @@ class RAxMLExecutable(object):
 			if multi_threaded_exec != None:
 				return multi_threaded_exec
 			else:
-				sys.exit("No usable version of RAxML could be found, please ensure one of these executables is in your PATH:\nraxmlHPC-PTHREADS-AVX\nraxmlHPC-PTHREADS-SSE3\nraxmlHPC-PTHREADS\n raxmlHPC-AVX\nraxmlHPC-SSE3\nraxmlHPC")
+				sys.exit("No usable version of RAxML could be found, please ensure one of these executables is in your PATH:\nraxmlHPC-PTHREADS-AVX2\nraxmlHPC-PTHREADS-AVX\nraxmlHPC-PTHREADS-SSE3\nraxmlHPC-PTHREADS\nraxmlHPC-AVX2\nraxmlHPC-AVX\nraxmlHPC-SSE3\nraxmlHPC")
 			
diff --git a/python/gubbins/common.py b/python/gubbins/common.py
index c89fd7f..b8a43d6 100644
--- a/python/gubbins/common.py
+++ b/python/gubbins/common.py
@@ -316,6 +316,8 @@ class GubbinsCommon():
     else:
       output_filenames_to_final_filenames = GubbinsCommon.translation_of_fasttree_filenames_to_final_filenames(starting_base_filename, max_iteration - 1,  self.args.prefix)
     GubbinsCommon.rename_files(output_filenames_to_final_filenames)
+	
+    shutil.copyfile(str(self.args.prefix)+".final_tree.tre", str(self.args.prefix)+".node_labelled.final_tree.tre")
     GubbinsCommon.remove_internal_node_labels_from_tree(str(self.args.prefix)+".final_tree.tre", str(self.args.prefix)+".no_internal_labels.final_tree.tre")
     shutil.move(str(self.args.prefix)+".no_internal_labels.final_tree.tre", str(self.args.prefix)+".final_tree.tre")
     
diff --git a/python/gubbins/tests/test_external_dependancies.py b/python/gubbins/tests/test_external_dependancies.py
index 6711d3b..4037c84 100755
--- a/python/gubbins/tests/test_external_dependancies.py
+++ b/python/gubbins/tests/test_external_dependancies.py
@@ -41,7 +41,8 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('different_prefix.recombination_predictions.gff')
     assert os.path.exists('different_prefix.branch_base_reconstruction.embl')
     assert os.path.exists('different_prefix.final_tree.tre')
-
+    assert os.path.exists('different_prefix.node_labelled.final_tree.tre')
+	
     self.cleanup()
   
   def test_rename_final_output(self):
@@ -58,6 +59,7 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('different_prefix.recombination_predictions.gff')
     assert os.path.exists('different_prefix.branch_base_reconstruction.embl')
     assert os.path.exists('different_prefix.final_tree.tre')
+    assert os.path.exists('different_prefix.node_labelled.final_tree.tre')
 
     self.cleanup()
     
@@ -97,6 +99,7 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('ft_prefix.recombination_predictions.gff')
     assert os.path.exists('ft_prefix.branch_base_reconstruction.embl')
     assert os.path.exists('ft_prefix.final_tree.tre')
+    assert os.path.exists('ft_prefix.node_labelled.final_tree.tre')
 
     self.cleanup()
     
@@ -114,6 +117,7 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('hybrid_prefix.recombination_predictions.gff')
     assert os.path.exists('hybrid_prefix.branch_base_reconstruction.embl')
     assert os.path.exists('hybrid_prefix.final_tree.tre')
+    assert os.path.exists('hybrid_prefix.node_labelled.final_tree.tre')
  
     self.cleanup()
     
@@ -131,7 +135,7 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('multiple_recombinations.recombination_predictions.gff')
     assert os.path.exists('multiple_recombinations.branch_base_reconstruction.embl')
     assert os.path.exists('multiple_recombinations.final_tree.tre')
-    #assert os.path.exists('multiple_recombinations.node_labelled.tre')
+    assert os.path.exists('multiple_recombinations.node_labelled.final_tree.tre')
 
     self.cleanup()
 
@@ -149,6 +153,7 @@ class TestExternalDependancies(unittest.TestCase):
     assert os.path.exists('multiple_recombinations.recombination_predictions.gff')
     assert os.path.exists('multiple_recombinations.branch_base_reconstruction.embl')
     assert os.path.exists('multiple_recombinations.final_tree.tre')
+    assert os.path.exists('multiple_recombinations.node_labelled.final_tree.tre')
 
     self.cleanup()
 
@@ -223,5 +228,4 @@ class TestExternalDependancies(unittest.TestCase):
       return parser
          
 if __name__ == "__main__":
-  unittest.main()
-
+  unittest.main()
\ No newline at end of file
diff --git a/python/scripts/gubbins_drawer.py b/python/scripts/gubbins_drawer.py
index 2cfe38c..cacc67e 100755
--- a/python/scripts/gubbins_drawer.py
+++ b/python/scripts/gubbins_drawer.py
@@ -4,7 +4,8 @@
 # Import some necessary modules #
 #################################
 
-from optparse import OptionParser, OptionGroup
+import argparse
+import pkg_resources
 
 from Bio.Nexus import Trees, Nodes
 from Bio.Graphics.GenomeDiagram._Colors import ColorTranslator
@@ -24,17 +25,12 @@ from reportlab.graphics import renderPDF
 
 
 def main():
-	usage = "usage: %prog [options] args"
-	parser = OptionParser(usage=usage)
-	
-	group = OptionGroup(parser, "Output Options")
-	group.add_option("-o", "--output", action="store", dest="outputfile", help="output file name [default= %default]", type="string", metavar="FILE", default="test.pdf")
-	group.add_option("-t", "--tree", action="store", dest="tree", help="tree file to align tab files to", default="")
-	
-	parser.add_option_group(group)
-	
+	parser = argparse.ArgumentParser(description='Gubbins Drawer creates a PDF with a tree on one side and the recombination regions plotted on the reference space on the other side. An interactive version can be found at https://sanger-pathogens.github.io/phandango/',  formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+	parser.add_argument('tree',  help='Tree in Newick format, such as XXXX.final_tree.tre')
+	parser.add_argument('embl_file',     help='EMBL file, such as XXXX.recombination_predictions.embl')
+	parser.add_argument( '-o', '--outputfile', help='Output PDF filename', default = 'gubbins_recombinations.pdf')
 	return parser.parse_args()
-
+	
   ##########################################################
   # Function to read an alignment whichever format it's in #
   ##########################################################
@@ -201,8 +197,9 @@ def add_ordered_embl_to_diagram(record, incfeatures=["CDS", "feature"], emblfile
 		
 		locations=[]
 		
-		locations=iterate_subfeatures(feature, locations)
-		
+
+		locations.append((feature.location.start, feature.location.end))
+
 		if "taxa" in feature.qualifiers:
 			qualifiernames=feature.qualifiers["taxa"][0].replace(", "," ").split()
 			
@@ -652,11 +649,12 @@ class Feature:
 
 if __name__ == "__main__":
 
-	(options, args) = main()
+	options = main()
+	
 	pagesize=pagesizes.A4
 	height, width = pagesize
   
-	if len(args)==0:
+	if len(options.embl_file)==0:
 		print("Found nothing to draw")
 		sys.exit()
 	
@@ -674,33 +672,25 @@ if __name__ == "__main__":
 	track_names={}
 	input_order=[]
 	
-	
-	for arg in args[::-1]:
-		if arg.lower() in ["tree", "list"]:
-			input_order.append(arg.lower())
-			continue
-		if arg.split('.')[-1].lower() in ["plot", "hist", "heat", "bar", "line", "graph", "area","embl", "gb", "tab", "bam", "fas", "fasta", "mfa", "dna", "fst", "phylip", "phy", "nexus", "nxs"]:
-			
-			if arg.split('.')[-1].lower() =="embl":
-				 new_tracks=add_ordered_tab_to_diagram(arg)
-				 
-				 for track in new_tracks:
-				 	newtrack=new_tracks[track]
-				 	newtrack.beginning=0
-				 	newtrack.name=new_tracks[track].name
-				 	name=newtrack.name
-				 	x=1
-				 	while name in my_tracks:
-				 		name=newtrack.name+"_"+str(x)
-				 		x+=1
-				 	if not newtrack.name in track_names:
-				 		track_names[newtrack.name]=[]
-				 	input_order.append(name)
-				 	track_names[newtrack.name].append(name)
-				 	
-				 	track_count+=1
-				 	newtrack.track_height=1
-				 	my_tracks[name]=newtrack
+	new_tracks=add_ordered_tab_to_diagram(options.embl_file)
+	
+	for track in new_tracks:
+		newtrack=new_tracks[track]
+		newtrack.beginning=0
+		newtrack.name=new_tracks[track].name
+		name=newtrack.name
+		x=1
+		while name in my_tracks:
+			name=newtrack.name+"_"+str(x)
+			x+=1
+		if not newtrack.name in track_names:
+			track_names[newtrack.name]=[]
+		input_order.append(name)
+		track_names[newtrack.name].append(name)
+		
+		track_count+=1
+		newtrack.track_height=1
+		my_tracks[name]=newtrack
 	
 	treenames=[]
 	tree_name_to_node={}
diff --git a/python/scripts/run_gubbins.py b/python/scripts/run_gubbins.py
index 809f244..fd9273e 100755
--- a/python/scripts/run_gubbins.py
+++ b/python/scripts/run_gubbins.py
@@ -28,24 +28,24 @@ from gubbins import common
 
 
 
-parser = argparse.ArgumentParser(description='Croucher N. J., Page A. J., Connor T. R., Delaney A. J., Keane J. A., Bentley S. D., Parkhill J., Harris S.R. "Rapid phylogenetic analysis of large samples of recombinant bacterial whole genome sequences using Gubbins". Nucleic Acids Res. 2015 Feb 18;43(3):e15. doi: 10.1093/nar/gku1196 .')
+parser = argparse.ArgumentParser(description='Croucher N. J., Page A. J., Connor T. R., Delaney A. J., Keane J. A., Bentley S. D., Parkhill J., Harris S.R. "Rapid phylogenetic analysis of large samples of recombinant bacterial whole genome sequences using Gubbins". Nucleic Acids Res. 2015 Feb 18;43(3):e15. doi: 10.1093/nar/gku1196 .', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 parser.add_argument('alignment_filename',       help='Multifasta alignment file')
 parser.add_argument('--outgroup',         '-o', help='Outgroup name for rerooting. A list of comma separated names can be used if they form a clade')
 parser.add_argument('--starting_tree',    '-s', help='Starting tree')
 parser.add_argument('--use_time_stamp',   '-u', action='count', help='Use a time stamp in file names', default = 0)
 parser.add_argument('--verbose',          '-v', action='count', help='Turn on debugging', default = 0)
 parser.add_argument('--no_cleanup',       '-n', action='count', help='Dont cleanup intermediate files', default = 0)
-parser.add_argument('--tree_builder',     '-t', help='Application to use for tree building [raxml|fasttree|hybrid], default RAxML', default = "raxml")
-parser.add_argument('--iterations',       '-i', help='Maximum No. of iterations, default is 5', type=int,  default = 5)
-parser.add_argument('--min_snps',         '-m', help='Min SNPs to identify a recombination block, default is 3', type=int,  default = 3)
-parser.add_argument('--filter_percentage','-f', help='Filter out taxa with more than this percentage of gaps, default is 25', type=int,  default = 25)
+parser.add_argument('--tree_builder',     '-t', help='Application to use for tree building [raxml|fasttree|hybrid]', default = "raxml")
+parser.add_argument('--iterations',       '-i', help='Maximum No. of iterations', type=int,  default = 5)
+parser.add_argument('--min_snps',         '-m', help='Min SNPs to identify a recombination block', type=int,  default = 3)
+parser.add_argument('--filter_percentage','-f', help='Filter out taxa with more than this percentage of gaps', type=int,  default = 25)
 parser.add_argument('--prefix',           '-p', help='Add a prefix to the final output filenames')
 parser.add_argument('--threads',          '-c', help='Number of threads to run with RAXML, but only if a PTHREADS version is available', type=int,  default = 1)
 parser.add_argument('--converge_method',  '-z', help='Criteria to use to know when to halt iterations [weighted_robinson_foulds|robinson_foulds|recombination]',  default = 'weighted_robinson_foulds')
 parser.add_argument('--version',                action='version', version=str(pkg_resources.get_distribution("gubbins").version))
-parser.add_argument('--min_window_size',  '-a', help='Minimum window size, default 100', type=int,  default = 100)
-parser.add_argument('--max_window_size',  '-b', help='Maximum window size, default 10000', type=int,  default = 10000)
-parser.add_argument('--raxml_model',      '-r', help='RAxML model [GTRGAMMA|GTRCAT], default GTRCAT',  default = 'GTRCAT')
+parser.add_argument('--min_window_size',  '-a', help='Minimum window size', type=int,  default = 100)
+parser.add_argument('--max_window_size',  '-b', help='Maximum window size', type=int,  default = 10000)
+parser.add_argument('--raxml_model',      '-r', help='RAxML model [GTRGAMMA|GTRCAT]',  default = 'GTRCAT')
 parser.add_argument('--remove_identical_sequences', '-d', action='count', help='Remove identical sequences', default = 0)
 
 gubbins_runner  = common.GubbinsCommon(parser.parse_args())

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gubbins.git



More information about the debian-med-commit mailing list