sort error: expansion of \t character in system call?
Hi! On my local galaxy_dist, doing a simple sort on a bed file is failing. I think the culprit is a tab expansion of the system call on line 42 of tools/filters/sorter.py. The Galaxy command that is being run is: python /home/wbiesing/galaxy_dist/tools/filters/sorter.py --input=/home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat --out_file1=/home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat --column=1 --style=alpha --order=DESC 2 num DESC and the stderr output from galaxy is: sort: multi-character tab `$\t' I can repro the system call within python: In [1]: import os In [3]: cmd = "sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat" In [5]: os.system(cmd) sort: multi-character tab `$\t' Out[5]: 512 Running python2.6.5 with recent co of galaxy_dist. Ubuntu 10.04 x86_64. -- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587
One thing to try: see if your shell is 'dash' (which is the default is recent Ubuntus) and switch it to 'bash' . Make sure to change not only your currently running shell, but also the "/bin/sh" link . "dash" does not respect the $'\t' trick . -gordon Jacob Biesinger wrote, On 08/03/2010 06:01 PM:
Hi! On my local galaxy_dist, doing a simple sort on a bed file is failing. I think the culprit is a tab expansion of the system call on line 42 of tools/filters/sorter.py.
The Galaxy command that is being run is: python /home/wbiesing/galaxy_dist/tools/filters/sorter.py --input=/home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat --out_file1=/home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat --column=1 --style=alpha --order=DESC 2 num DESC
and the stderr output from galaxy is: sort: multi-character tab `$\t'
I can repro the system call within python: In [1]: import os In [3]: cmd = "sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat" In [5]: os.system(cmd) sort: multi-character tab `$\t' Out[5]: 512
Running python2.6.5 with recent co of galaxy_dist. Ubuntu 10.04 x86_64.
-- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
No, my default shell (listed in /etc/passwd) is definitely /bin/bash and I can run the sort command just fine from the command line: $ sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat Though running just sh, the command fails: $ sh $ sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat sort: multi-character tab `$\\t' Seems like python's os.system(...) is the weak link. -- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587 On Tue, Aug 3, 2010 at 3:16 PM, Assaf Gordon <gordon@cshl.edu> wrote:
One thing to try:
see if your shell is 'dash' (which is the default is recent Ubuntus) and switch it to 'bash' . Make sure to change not only your currently running shell, but also the "/bin/sh" link .
"dash" does not respect the $'\t' trick .
-gordon
Jacob Biesinger wrote, On 08/03/2010 06:01 PM:
Hi! On my local galaxy_dist, doing a simple sort on a bed file is failing. I think the culprit is a tab expansion of the system call on line 42 of tools/filters/sorter.py.
The Galaxy command that is being run is: python /home/wbiesing/galaxy_dist/tools/filters/sorter.py --input=/home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat --out_file1=/home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat --column=1 --style=alpha --order=DESC 2 num DESC
and the stderr output from galaxy is: sort: multi-character tab `$\t'
I can repro the system call within python: In [1]: import os In [3]: cmd = "sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat" In [5]: os.system(cmd) sort: multi-character tab `$\t' Out[5]: 512
Running python2.6.5 with recent co of galaxy_dist. Ubuntu 10.04 x86_64.
-- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
I don't think so. It actually shows that your "sh" is not "bash". run: $ ls -l /bin/sh and see if you get: /bin/sh -> bash or /bin/sh -> dash Jacob Biesinger wrote, On 08/03/2010 06:27 PM:
No, my default shell (listed in /etc/passwd) is definitely /bin/bash and I can run the sort command just fine from the command line: $ sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat
Though running just sh, the command fails: $ sh $ sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat sort: multi-character tab `$\\t'
Seems like python's os.system(...) is the weak link. -- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587
On Tue, Aug 3, 2010 at 3:16 PM, Assaf Gordon <gordon@cshl.edu> wrote:
One thing to try:
see if your shell is 'dash' (which is the default is recent Ubuntus) and switch it to 'bash' . Make sure to change not only your currently running shell, but also the "/bin/sh" link .
"dash" does not respect the $'\t' trick .
-gordon
Jacob Biesinger wrote, On 08/03/2010 06:01 PM:
Hi! On my local galaxy_dist, doing a simple sort on a bed file is failing. I think the culprit is a tab expansion of the system call on line 42 of tools/filters/sorter.py.
The Galaxy command that is being run is: python /home/wbiesing/galaxy_dist/tools/filters/sorter.py --input=/home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat --out_file1=/home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat --column=1 --style=alpha --order=DESC 2 num DESC
and the stderr output from galaxy is: sort: multi-character tab `$\t'
I can repro the system call within python: In [1]: import os In [3]: cmd = "sort -f -t $'\t' -k1,1 -k2,2n -o /home/wbiesing/galaxy_dist/database/files/000/dataset_190.dat /home/wbiesing/galaxy_dist/database/files/000/dataset_171.dat" In [5]: os.system(cmd) sort: multi-character tab `$\t' Out[5]: 512
Running python2.6.5 with recent co of galaxy_dist. Ubuntu 10.04 x86_64.
-- Jake Biesinger Graduate Student Xie Lab, UC Irvine (949) 231-7587
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
participants (2)
-
Assaf Gordon
-
Jacob Biesinger