I am trying to use "blat-blast like alignment tool" in R. I couldn't
find
any package in CRAN or bioconductor. I downloaded the windows
executable
from Jim Kent's (from ucsc) webpage. I am wondering how to use/call
these
functions embedded in these executables. I have some results in R that
would
be input to these executable file and then store and process the
output of
these executable file in R.
I am seeking for some direction or some material that addresses such
problem. I am considering "system()" but I am nor sure how far can I
go with
this.
Help appreciated. Thanks
--
Fahim Mohammad
CECS, univ of Louisville
[[alternative HTML version deleted]]
On Sun, Apr 11, 2010 at 11:45 AM, Fahim Md <fahim.md at="" gmail.com="">
wrote:
> I am trying to use "blat-blast like alignment tool" in R. I couldn't
find
> any package in CRAN or bioconductor. I downloaded the windows
executable
> from Jim Kent's (from ucsc) webpage. I am wondering how to use/call
these
> functions embedded in these executables. I have some results in R
that would
> be input to these executable file and then store and process the
output of
> these executable file in R.
>
> ?I am seeking for some direction or some material that addresses
such
> problem. I am considering "system()" but I am nor sure how far can I
go with
> this.
Hi, Fahim.
I do not think that blat functionality is available directly from R.
The idea, then is to:
1) write the data from R to a fasta file
2) use system() to run blat (or just run blat from the command line)
3) read the results back into R from the resulting blat output file
There isn't anything else tricky, I don't think.
Sean
Quoting Fahim Md <fahim.md at="" gmail.com="">:
> I am trying to use "blat-blast like alignment tool" in R. I couldn't
find
> any package in CRAN or bioconductor. I downloaded the windows
executable
> from Jim Kent's (from ucsc) webpage. I am wondering how to use/call
these
> functions embedded in these executables. I have some results in R
that would
> be input to these executable file and then store and process the
output of
> these executable file in R.
>
> I am seeking for some direction or some material that addresses
such
> problem. I am considering "system()" but I am nor sure how far can I
go with
> this.
>
> Help appreciated. Thanks
I don't think there's a package that does that, but you can call the
program from R using system().
I was looking for an example where I did just that, and I found
another alternative that may not be the most elegant but I can confirm
it worked:
IN this case I run the netblast program, which I downloaded and was
located in my working directory.
1) construct command line, where 'file' was the name of the file
containing fasta sequences, and 'outfile' the name of the desired
output file:
line<-paste("blastcl3.exe -p blastn -d nr -i ",file," -o ",outfile,"
-m 8 -u Homo[organism] -v 1 -b 1",sep="")
2) run it:
scan(pipe(line))
3) read blast output:
readoutput<-read.table(outfile, sep="\t", as.is=T)
Not sure why I used the scan & pipe route (this was done a while ago,
I tend to use Perl for anything dealing with file formatting and
running external programs), I'd have imagined all you need was a call
to system().
I hope it helps a bit...
Jose
--
Dr. Jose I. de las Heras Email: J.delasHeras at
ed.ac.uk
The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131
6507095
Institute for Cell & Molecular Biology Fax: +44 (0)131
6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK
*********************************************
Alternative email: nach.mcnach at gmail.com
*********************************************
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.