[Bio] / FigKernelScripts / find_more_instances_for_veronika.pl Repository:
ViewVC logotype

View of /FigKernelScripts/find_more_instances_for_veronika.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Thu Apr 26 17:05:43 2012 UTC (7 years, 6 months ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2014_0729, mgrast_version_3_2, rast_rel_2014_0912, HEAD
Fangfang tools to support Veronika

use strict;

my $usage = "usage: find_more_instances known_ids MaxSz";
my($ids,$dir,$n);
(
 ($ids = shift @ARGV) &&
 ($dir  = shift @ARGV)
)
    || die $usage;

$n = (@ARGV  > 0) ? $ARGV[0] : 1000000;

mkdir($dir,0777);
&run("svr_fasta -protein -fasta < $ids > $dir/fasta");
&run("svr_align_seqs -l -mafft < $dir/fasta > $dir/ali");
&run("svr_trim_ali -l -c < $dir/ali > $dir/trimmed");
&run("svr_psiblast_search -inc -fast -l -a 8 -u 50 -nq 200 -r $dir/id.report < $dir/trimmed > $dir/hits");
run("svr_align_seqs -l -mafft < $dir/hits > $dir/id.trim");
run("grep included $dir/id.report | head -n $n | cut -f1 | svr_fasta -protein -fasta > $dir/id.full.seqs");
run("svr_align_seqs -l -mafft -z < $dir/id.full.seqs > $dir/id.full.ali");
run("svr_trim_ali -l -c -cd -html $dir/id.full.trim.html < $dir/id.full.ali > $dir/id.full.trim");
run("grep '>' $dir/id.trim | sed 's/>//' | sed 's/[()]//g' | sed 's/\s/\t/' > $dir/id.trim.coords");
run("svr_tree -l < $dir/id.trim > $dir/id.tree");
run("svr_tree_to_html -anno -nc 20 -c role -d $dir/id.trim.coords < $dir/id.tree > $dir/id.tree.html");

sub run {
    my ($cmd) = @_;
    system($cmd) == 0 or die("FAILED: $cmd");
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3