#####Format local databse for blast search

makeblastdb -in input_file.fa -dbtype nucl/prot -out input_file.db

#####Blast short sequences like miRNAs in your database

blastn -query test.fa -db input_file.db -task blastn-short -out test.out \
  -strand plus -num_threads 10 

#####Run psiblast

#file.fasta is a multipe-sequence alignment file generated by clustralw or others
psiblast -in_msa file.fasta -db input_file.db -out file.out -num_iterations 3 -evalue 20000 -matrix PAM30 -comp_based_stats 0

#####Extract sequences in FATSA format for given name

blastdbcmd -entry NP_172083.1 -db nr #A gi number is also accepted for -entry

#####Set your favorite output format

blastp -query file.fasta -db nr -out file.out -num_threads=8 -outfmt=6 
*qseqid sseqid pident length slen evalue*

#####Generate PSSM

The correct usage for 2.2.23+ is (-subject produces an error which is fixed in 2.2.24+):

psiblast -db blastdb -in_msa alignment.fasta -out_ascii_pssm pssm.txt

And for 2.2.24+ supplying a subject FASTA file works

psiblast -subject oneseq.fasta -in_msa alignment.fasta -out_ascii_pssm pssm.txt

For both approaches, it does not matter if there is one sequence in db/subject or any subset of the alignment sequences. PSSM output is exactly the same. Note that the query needs to be supplied with in_msa in order to genereate a PSSM in one step.

Specially, [MyHits](myhits.isb-sib.ch/) can accept multiple sequence alignment profiles instead of PSSM to invoke PSI-BLAST or HMMER3.

#####

http://www.ncbi.nlm.nih.gov/blast/html/sub_matrix.html