Repository navigation
2to3
The package 2to3 will be automatically installed with Python3.
It can be used as a first test to see if your Python2 scripts will
run in Python3. From the command line type:
2to3 script_name.py
(optional: use the -w parameter to apply the changes; this automatically
creates a script_name.py.bak backup file.
The output should show which modifications are needed to make
the script Python3 compatible. String issues are frequently missed.
In Galaxy changes made to python or bash shell scripts can be tested
immediately; changes made to .xml files require Galaxy to be restarted.
Most Galaxy related errors when converting py2 to py3 are caused
by the fact that py3 has made a strict separation between strings
and binary data. py2 vs py3:
string.maketrans() --> str.maketrans()
adminlogfile.write("output " + function) --> str(function)
adminlogfile.write("output" + out) --> str(out) #string
adminlogfile.write("output" + out) --> out.decode() #bytes
delimiter=args.delimiter.decode('string_escape') -->
delimiter=bytes(args.delimiter, "utf-8").decode('unicode_escape')
A single function (or consecutive functions in a python script) can have
different types of output (string or bytes), which in python2 could be fed
to adminlogfile.write. This is not allowed in python3; use if else
statement to seperate types (and show type for debugging):
if type(out)==str:
adminlogfile.write("out "+ str(function) + str(type(out)) + " \n" + str(seperation) + "\n" + str(out) + "\n\n")
else:
adminlogfile.write("out "+ str(function) + str(type(out)) + " \n" + str(seperation) + "\n" + out.decode() + "\n\n")\
\

Galaxy notes:
- 2to3
- Activate user
- Backup Repositories
- Blast dbs
- Blast db genbank
- Blast mapping
- Checkout release
- Conda envs
- Cron jobs
- Filemerge and opendiff
- Install Tools
- Galaxy training
- Git stuff
- Make Otu Table
- Merge Reads Flash
- Multi to Singleline fas
- Out of Space
- Restart Galaxy
- Rmate
- Set Locale
- Stdout
- Tool menu
- User statistics
- User statistics 2
- User statistics COMMpare
- Workflows