Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piped commands not correctly recognised by Bio::SeqIO->new -file option #153

Closed
RoyChaudhuri opened this issue May 31, 2016 · 3 comments
Closed

Comments

@RoyChaudhuri
Copy link
Contributor

When a -file option with a leading pipe character is supplied to SeqIO->new, the SeqIO object incorrectly attempts to read rather than write. This seems to be due to a bug in the Bio::Root::IO::cleanfile regex, which does not recognise a leading pipe character.

See mailing list discussion:
http://mailman.open-bio.org/pipermail/bioperl-l/2016-May/089175.html

@cjfields cjfields mentioned this issue Jun 18, 2016
13 tasks
@cjfields
Copy link
Member

cjfields commented Jul 6, 2016

May push this off until after release

@cjfields
Copy link
Member

cjfields commented Aug 1, 2016

Won't fix this. The -file option is explicitly used for files, not file handles (which is -fh). We would expect a pipe to be added as a file handle, so using -file is wrong.

The error that occurs:

[cjfields@Chriss-MacBook-Air 153]$ perl test.pl

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Could not read file '| /Users/cjfields/bin/bgzip -c >  foo.fa.gz': No such file or directory
STACK: Error::throw
STACK: Bio::Root::Root::throw /Users/cjfields/bioperl/bioperl-live/Bio/Root/Root.pm:447
STACK: Bio::Root::IO::_initialize_io /Users/cjfields/bioperl/bioperl-live/Bio/Root/IO.pm:265
STACK: Bio::SeqIO::_initialize /Users/cjfields/bioperl/bioperl-live/Bio/SeqIO.pm:499
STACK: Bio::SeqIO::fasta::_initialize /Users/cjfields/bioperl/bioperl-live/Bio/SeqIO/fasta.pm:87
STACK: Bio::SeqIO::new /Users/cjfields/bioperl/bioperl-live/Bio/SeqIO.pm:375
STACK: Bio::SeqIO::new /Users/cjfields/bioperl/bioperl-live/Bio/SeqIO.pm:421
STACK: Bio::SeqIO::newFh /Users/cjfields/bioperl/bioperl-live/Bio/SeqIO.pm:443
STACK: test.pl:18
-----------------------------------------------------------

Is actually correct, it can't find a file literally named '| /Users/cjfields/bin/bgzip -c > foo.fa.gz'

@cjfields cjfields closed this as completed Aug 1, 2016
@RoyChaudhuri
Copy link
Contributor Author

Hi Chris,

I agree that it would be better to deal with this using the -fh option. The problem is that currently the SeqIO docs specifically state that -file can handle a piped command. I've updated the docs and will put in a pull request.

Cheers,
Roy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants