码迷,mamicode.com
首页 > 其他好文 > 详细

Run a local BLAST

时间:2014-10-17 00:02:03      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:http   os   ar   for   sp   on   html   ad   ef   

In this context, ‘local’ means you are running BLAST on your own server, not at NCBI or anyone else’s server. This gives you the flexibility of comparing your query either against precomputed databases (like NR, Swissprot, trEMBL, etc.) or against a customized database, containing a specific set of sequences.

 

Query Sequence Set: contigs.supercontigs.filtered_012808.fasta

Reference Database: all_gene-CDS-111313.txt 

(Hint: choose among: BLASTP, BLASTN, BLASTX, TBLASTN, TBLASTX)

BLAST Reference: http://www.ncbi.nlm.nih.gov/BLAST/blast_program.shtml

 

Generate a customized search database

$ makeblastdb -dbtype nucl -in contigs.supercontigs.filtered_012808.fasta

 

BLAST the all_gene-CDS-111313.txt 

$ blastn -query all_gene-CDS-111313.txt -db contigs.supercontigs.filtered_012808.fasta-outfmt 6 -out gene.blastn

 

Wait until it finishes then take a look at the output:

$ less gene.blastn

 

BLAST tabular format (as specified in -outfmt 6) has multiple columns, and is the easiest output format to work with. http://www.pangloss.com/wiki/Blast

 

Cout the column (-f 2):

$ cut -f 2 gene.blastn | sort -u > hits.ids

 

How many unique hits did we get? This equals to the number of lines in the file:

$ wc -l hits.ids

 

It appears we are getting lots of hits. We may need to go back to the BLAST command to add an E-value cutoff to be more stringent. How to add E-value cutoff? Let’s look at the help for tblastn

$ blastn -help

 

Now run BLAST with more stringent settings (E-value cutoff: 1e-20):

$ blastn -query all_gene-CDS-111313.txt -db contigs.supercontigs.filtered_012808.fasta -outfmt 6 -out gene.blastn -evalue 1e-20

$ cut -f 2 gene.blastn| sort -u > hits.ids

 

Extract sequences from contigs.supercontigs.filtered_012808.fasta

The command faSomeRecords can be used to extract multiple sequences, now let’s get all the BLAST hits to retrieve a gene family.

$ faSomeRecords contigs.supercontigs.filtered_012808.fasta hits.ids hits.fasta

Run a local BLAST

标签:http   os   ar   for   sp   on   html   ad   ef   

原文地址:http://www.cnblogs.com/skylinelzy/p/4029939.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!