You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run cutadapt on very simple fasta input, I get an error when taking input from STDIN and using the -f fasta option. When reading input from a file, or not using -f, everything works correctly.
My test input file (test0.fa) contains the following:
perfect
TTTGGGGGGG
I want to test cutadapt taking input from STDIN. With no -f option, it works as expected:
$ cat test0.fa | cutadapt -a GGGGGGGGGGGGGGG -
perfect
TTT
cutadapt version 0.9.4
Command line parameters: -a GGGGGGGGGGGGGGG -
Maximum error rate: 10.00%
Processed reads: 1
Trimmed reads: 1 (100.0%)
Too short reads: 0 ( 0.0% of processed reads)
Too long reads: 0 ( 0.0% of processed reads)
Total time: 0.00 s
Time per read: 0.00 ms
=== Adapter 1 ===
Adapter 'GGGGGGGGGGGGGGG', length 15, was trimmed 1 times.
Histogram of adapter lengths
length count
7 1
However, if I add -f fasta to the options, it stops working:
$ cat test0.fa | cutadapt -f fasta -a GGGGGGGGGGGGGGG -
Traceback (most recent call last):
File "/home/weronika/programs/work_software/cutadapt", line 5, in
pkg_resources.run_script('cutadapt==0.9.4', 'cutadapt')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
execfile(script_filename, namespace, namespace)
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cutadapt", line 595, in
sys.exit(main())
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cutadapt", line 546, in main
for desc, seq, qualities in reader:
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/cutadapt/seqio.py", line 154, in _streaming_iter
for line in self.fp:
IOError: File not open for reading
Just to make sure, if I run it with the -f option but reading input from a file instead of STDIN, it also works as expected:
$ cutadapt -f fasta -a GGGGGGGGGGGGGGG test0.fa
perfect
TTT
cutadapt version 0.9.4
Command line parameters: -f fasta -a GGGGGGGGGGGGGGG test0.fa
Maximum error rate: 10.00%
Processed reads: 1
Trimmed reads: 1 (100.0%)
Too short reads: 0 ( 0.0% of processed reads)
Too long reads: 0 ( 0.0% of processed reads)
Total time: 0.01 s
Time per read: 10.00 ms
=== Adapter 1 ===
Adapter 'GGGGGGGGGGGGGGG', length 15, was trimmed 1 times.
Hi, thanks for the report and sorry for the late reply (due to vacation).
It seems you've stumbled upon an error that I have fixed in the most recent cutadapt version (without putting a note about this in the changelog, sorry).
Please either upgrade to cutadapt 0.9.5 or fix the problem by changing within your file /home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/cutadapt/xopen.py the line
return sys.stdout if 'r' in mode else sys.stdin
to
return sys.stdin if 'r' in mode else sys.stdout
From pat...@gmail.com on August 18, 2011 01:35:31
If I run cutadapt on very simple fasta input, I get an error when taking input from STDIN and using the -f fasta option. When reading input from a file, or not using -f, everything works correctly.
My test input file (test0.fa) contains the following:
I want to test cutadapt taking input from STDIN. With no -f option, it works as expected:
$ cat test0.fa | cutadapt -a GGGGGGGGGGGGGGG -
=== Adapter 1 ===
Adapter 'GGGGGGGGGGGGGGG', length 15, was trimmed 1 times.
Histogram of adapter lengths
length count
7 1
However, if I add -f fasta to the options, it stops working:
$ cat test0.fa | cutadapt -f fasta -a GGGGGGGGGGGGGGG -
Traceback (most recent call last):
File "/home/weronika/programs/work_software/cutadapt", line 5, in
pkg_resources.run_script('cutadapt==0.9.4', 'cutadapt')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
execfile(script_filename, namespace, namespace)
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cutadapt", line 595, in
sys.exit(main())
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cutadapt", line 546, in main
for desc, seq, qualities in reader:
File "/home/weronika/programs/work_software/cutadapt-0.9.4-py2.6-linux-x86_64.egg/cutadapt/seqio.py", line 154, in _streaming_iter
for line in self.fp:
IOError: File not open for reading
Just to make sure, if I run it with the -f option but reading input from a file instead of STDIN, it also works as expected:
$ cutadapt -f fasta -a GGGGGGGGGGGGGGG test0.fa
=== Adapter 1 ===
Adapter 'GGGGGGGGGGGGGGG', length 15, was trimmed 1 times.
Histogram of adapter lengths
length count
7 1
Cutadapt version: cutadapt-0.9.4-py2.6-linux-x86_64.egg
Operating system: Linux, Ubuntu 10.04, 64-bit.
$ uname -a
Linux bleen 2.6.32-32-generic
#62
-Ubuntu SMP Wed Apr 20 21:52:38 UTC 2011 x86_64 GNU/LinuxOriginal issue: http://code.google.com/p/cutadapt/issues/detail?id=28
The text was updated successfully, but these errors were encountered: