Python3: lib/galaxy/visualization/

This commit is contained in:
Nicola Soranzo
2016-06-26 12:03:49 -04:00
parent 2c67f1e7e5
commit de99c7efe2
3 changed files with 11 additions and 10 deletions
+1
View File
@@ -57,6 +57,7 @@ lib/galaxy/tools/parser/
lib/galaxy/tools/toolbox/
lib/galaxy/tours/
lib/galaxy/util/
lib/galaxy/visualization/
lib/galaxy/work/
lib/galaxy_ext/
lib/galaxy_utils/
@@ -1,5 +1,5 @@
from __future__ import with_statement
from baseparser import Base_Parser, PhyloTree
from .baseparser import Base_Parser, PhyloTree
import re
@@ -81,7 +81,7 @@ class Newick_Parser(Base_Parser):
start = 0
end = 0
for i in xrange(len(newickString)):
for i in range(len(newickString)):
if newickString[i] == "(" or newickString[i] == ",":
if re.match(r"[,(]", newickString[i + 1:]):
continue
@@ -89,7 +89,7 @@ class Newick_Parser(Base_Parser):
end = i + 1
# i now refers to the starting position of the term to be replaced,
# we will next find j which is the ending pos of the term
for j in xrange(i + 1, len(newickString)):
for j in range(i + 1, len(newickString)):
enclosingSymbol = newickString[j] # the immediate symbol after a common or left bracket which denotes the end of a term
if enclosingSymbol == ")" or enclosingSymbol == ":" or enclosingSymbol == ",":
termToReplace = newickString[end:j]
@@ -124,7 +124,7 @@ class Newick_Parser(Base_Parser):
lenOfPreceedingInternalNodeString = 0
bracketStack = []
for j in xrange(len(string)):
for j in range(len(string)):
if string[j] == "(": # finding the positions of all the open brackets
bracketStack.append(j)
continue
+5 -5
View File
@@ -101,7 +101,7 @@ class Genome( object ):
if num:
num = int( num )
else:
num = sys.maxint
num = sys.maxsize # just a big number
if low:
low = int( low )
@@ -163,14 +163,14 @@ class Genome( object ):
# Set flag to indicate whether there are more chroms after list.
next_chroms = False
try:
len_file_enumerate.next()
next(len_file_enumerate)
next_chroms = True
except:
# No more chroms to read.
pass
to_sort = [{ 'chrom': chrm, 'len': length } for chrm, length in chroms.iteritems()]
to_sort.sort(lambda a, b: cmp( split_by_number(a['chrom']), split_by_number(b['chrom']) ))
to_sort = [{ 'chrom': chrm, 'len': length } for chrm, length in chroms.items()]
to_sort.sort(key=lambda _: split_by_number(_['chrom']))
return {
'id': self.key,
'reference': self.twobit_file is not None,
@@ -232,7 +232,7 @@ class Genomes( object ):
def check_and_reload( self ):
# Check if tables have been modified, if so reload
for table_name, table_version in self._table_versions.iteritems():
for table_name, table_version in self._table_versions.items():
table = self.app.tool_data_tables.get( table_name, None )
if table is not None and not table.is_current_version( table_version ):
return self.reload_genomes()