2

I tried to use parallel command in the following way:

cat asm.contig.fasta | parallel -k --block 1k --recstart '>' --pipe 'blat -t=dnax -q=prot - ../swissprot.fasta out{#}.psl -noHead'

but unfortunately I got this error:

mustOpen: Can't open - to read: No such file or directory

What did I do wrong?

2

The error is not from GNU Parallel, so it is from blat. I have not used blat for years, so I am not 100% sure of the following.

My guess is that you cannot use use - to denote STDIN for the database in blat.

There are several ways of tickling blat. Use /dev/stdin which will give the standard input as a fifo on many systems:

cat asm.contig.fasta | parallel -k --block 1k --recstart '>' --pipe 'blat -t=dnax -q=prot /dev/stdin ../swissprot.fasta out{#}.psl -noHead'

Use --fifo which will make a fifo/named pipe which will give the standard in put as a fifo on all supported systems. After the command is completed the fifo will be removed:

cat asm.contig.fasta | parallel --fifo -k --block 1k --recstart '>' --pipe 'blat -t=dnax -q=prot {} ../swissprot.fasta out{#}.psl -noHead'

Use --cat which will make a regular file containing the 1k block of data. After the command is completed the file will be removed.

cat asm.contig.fasta | parallel --cat -k --block 1k --recstart '>' --pipe 'blat -t=dnax -q=prot {} ../swissprot.fasta out{#}.psl -noHead'

--cat is generally the slowest (for --block 1k expect an additional 1 ms per job), but almost guaranteed to work.

Let us know which one worked.

  • The first command complained about Expecting '>' line 1 of /dev/stdin. The second command produced only 100 commands. The third command works fine. Thank you – user977828 Sep 7 '16 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.