[BioC] using Blat in R

J.delasHeras at ed.ac.uk J.delasHeras at ed.ac.uk
Tue Apr 13 11:35:33 CEST 2010


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.



More information about the Bioconductor mailing list