Converting csh and sh scripts to Python
From Bioinformatics.Org Wiki
Background Information
To make BIRCH more portable, we want to replace all shell scripts with Python scripts. On Unix-like systems, there are often incompatibilities in syntax for various commands, as well as differences in how shells interpret commands. Additionally, we would like to be able to eliminate the need for including Cygwin with WinBirch.
In some cases, shell scripts come with 3rd party packages. In many cases, those are older packages that should probably be replaced anyway. In other cases, we may have to write Python wrappers.
In a sense, there are really two goals:
- Using Turtleshell to interpret shell commands within BioLegato
- Converting stand-alone scripts into Python
Which scripts need to be converted
Standalone scripts can be found by searching for .sh or .csh extensions, or for files containing the string "csh" or "sh" or "bash" on the first line. These files are likely to be found in the following directories:
- BIRCHDEV/dat
- shouldn't be any scripts here, but PCD menus may depend on csh or sh scripts, and would be affected if the new Python scripts don't work properly. Searching this directory for the menu files containing the name of a script will tell us which menus depend on that script.
- BIRCHDEV/script
- standalone csh or sh scripts (probably anything in the script directory that does NOT have a .py file extension)
- shell wrappers for things like BioLegato. There should probably be a set of libraries that we can write for BioLegato wrappers so that creating a new wrapper will only require a few lines of code.
- BIRCHDEV/public_html/birchdb
- Actually, not much here. I think just bin/cleanup.sh and tbirchdb.sh
- files in $BIRCH/admin
- newuser
- nobirch
Changes for BIRCH 2.97 - Development version
The following scripts are scheduled for replacement in BIRCH 2.97. They will need to be tested on different platforms before the release. When scripts are working, the old csh or sh scripts are moved into BIRCHDEV/script/deprecated. This directory is excluded when building the framework file.
program |
python script working |
dependencies updated |
csh,sh files moved to
deprecated |
tested on Linux, Solaris,
Mac |
documentation revised |
numseq.py | X |
X |
X |
NA |
|
bachrest.py | X |
X |
X |
NA |
|
hom.py | X |
X |
X |
NA |
|
phom.py | X |
X |
X |
NA |
|
testcode.py | X |
X |
X |
NA |
|
btail.py | X |
X |
X |
X |
|
primer3b.py | X |
X |
X |
NA |
|
primer3brun.py | X |
X |
X |
NA |
|
ruler.py | X |
NA |
X |
X |
|
mrtrans.py | |||||
86.py | |||||
retree.py | |||||
tbirchdb.sh |
|||||
cleanup.sh |
|||||
admin/newuser |
|||||
admin/nobirch |