in reply to tblastn unix

Hello Nicpetbio23!,

I would like to add a few points to your question My main question is how do I change my unix command so that I can go through a list of query and genome sequences and return the tblastn results for each?. I would start by saying do not use system, why? Simply written in the documentation, I quote:

This is not what you want to use to capture the output from a command +; for that you should use merely backticks or qx//, as described in ` +STRING` in perlop.

So back to your question, I assume that you want to capture the output of your command through a loop as the fellow monk 1nickt replied to your question already.

So in conclusion, I spend a small amount of time to install the blast on my linuxOS following this great tutorial Bioinformatics: introduction to using BLAST with Ubuntu.

After completing the installation and creating the db for testing purposes, I created a small script to demonstrate how to use backticks with tblastn.

#!usr/bin/perl use say; use strict; use warnings; my $dir_before = `ls -la`; chomp $dir_before; say $dir_before; # execute your linux command with backticks `blastn -query example.fa -db /home/tinyos/blast_db/refseq_rna.00 -out + results.txt`; my $dir_after = `ls -la`; chomp $dir_after; say $dir_after; __END__ $ perl bio.pl total 20 drwxr-xr-x 2 tinyos tinyos 4096 Jun 28 00:30 . drwxr-xr-x 7 tinyos tinyos 4096 Jun 28 00:19 .. -rw-r--r-- 1 tinyos tinyos 279 Jun 28 00:30 bio.pl -rw-r--r-- 1 tinyos tinyos 0 Jun 28 00:21 bio.pl~ -rw-r--r-- 1 tinyos tinyos 459 Jun 28 00:04 example.fa -rw-r--r-- 1 tinyos tinyos 458 Jun 28 00:04 example.fa~ total 32 drwxr-xr-x 2 tinyos tinyos 4096 Jun 28 00:30 . drwxr-xr-x 7 tinyos tinyos 4096 Jun 28 00:19 .. -rw-r--r-- 1 tinyos tinyos 279 Jun 28 00:30 bio.pl -rw-r--r-- 1 tinyos tinyos 0 Jun 28 00:21 bio.pl~ -rw-r--r-- 1 tinyos tinyos 459 Jun 28 00:04 example.fa -rw-r--r-- 1 tinyos tinyos 458 Jun 28 00:04 example.fa~ -rw-r--r-- 1 tinyos tinyos 10739 Jun 28 00:30 results.txt

Since the blastn does not return anything I check my directory again. I assume your command is returning something? If this is the case then backticks, if not create a loop as the fellow monk 1nickt pointed out and use system every time to check if your command was correct. Then find a way to open the output and do something with the file. So voila you are done :D

Hope this helps, BR

Seeking for Perl wisdom...on the process of learning...not there...yet!