RPS-BLAST
ただの備忘録
blast+ 2.2.28でrps-blast用のpssmデータベースの作成
% wget ftp://ftp.ncbi.nih.gov/pub/mmdb/cdd/cdd.tar.gz
% tar zxfv cdd.tar.gz
% ls | grep "KOG" | grep "smp" > KOG.pn
KOG*.smpからtitleだけパース
<code>
#!/usr/env/bin perl
use strict;
use warnings;
my $foo = "";
my $hoge = 1;
open my $fh, "<", shift;
while( <$fh> ) {
if( $_=~ /descr/ && $hoge == 1) {
$hoge=0;
}
elsif( $_ =~ /\}\,$/ && $hoge == 0) {
$foo .= $_;
$hoge = 1;
$foo =~ s/\n//g;
$foo =~ s/title//;
$foo =~ s/[\"\}\,]//g;
$foo =~ s/^\s+//;
print $foo."\n";
$foo = "";
}
elsif ( $hoge == 0 ) {
$foo .= $_;
}
}
</code>
# % makeprofiledb -in foo.pn
% rpsblast -query /path/to/query.fa -db foo.pn -out test_rps_blast.txt -outfmt '6 qseqid stitle pident length mismatch gapopen qstart qend sstart send evalue bitscore'