EMBOSS Needle: Read sequences from stdin
3
3
Entering edit mode
10.6 years ago
pld 5.1k

Is it possible to pass sequences through needle via stdin? I have a great deal of all to all runs to make and I don't want to generate an enormous number of files, or make temporary files.

I've tried cat seq1.fasta seq2.fasta | needle -filter... but it throws errors.

unix linux emboss stdin needle • 6.0k views
ADD COMMENT
0
Entering edit mode

Pasted as an answer

ADD REPLY
4
Entering edit mode
10.6 years ago
brentp 24k
needle -filter <(echo -e ">a\nCAAAAAAAAATTAAAAAAAAAAAAAACCCCCCCTTCCA") \
               <(echo -e ">a\nCAAAAGGAAAAATTAAAAAAAAAAAAAACCCCCCCTTCCA")
ADD COMMENT
2
Entering edit mode
10.6 years ago

Perhaps look into using mkfifo to set up named pipes to stream data to placeholder files, which can be used with some tools that do not read streams: http://en.wikipedia.org/wiki/Named_pipe

ADD COMMENT
2
Entering edit mode
10.6 years ago

needle takes two files as input. First file contains sequence to be aligned to the sequence or sequences in the second file. The first file can contain only one sequence and the second file can contain multiple sequences and needle will align the sequence from the first file to every sequence in the second file. Now coming to your question:

"filter" option only lets you to give the first sequence as a standard input. Here you are giving both the sequences as a standard input and as a result needle is not being able to detect the second input.

You can try:

needle "cat seq1.fasta |" "cat seq.2fasta |"
ADD COMMENT
0
Entering edit mode

I just checked the command and its working but you will have to use -auto in the command line to turn off the prompts. For e.g. needle -auto "cat seq1.fasta |" "cat seq.2fasta |"

ADD REPLY

Login before adding your answer.

Traffic: 1924 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6