Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved Pise-related examples over to bioperl-pise

svn path=/bioperl-pise/trunk/; revision=15357
  • Loading branch information...
commit bed478b3d149c8a674a4aad40f534b219a43ed98 1 parent 96a6d31
cjfields authored
View
36 examples/blast-kun.pl
@@ -0,0 +1,36 @@
+#
+# This example runs a blast2 on genpept and parse the results.
+# (and shows how to save results)
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::SeqIO;
+use Bio::SearchIO;
+
+$_in_seq = Bio::SeqIO->newFh (-file => $ARGV[0],
+ -format => "fasta");
+my $seq = <$_in_seq>;
+
+$factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
+my $blast2 = $factory->program('blast2',
+ -location => 'http://kun.homelinux.com/cgi-bin/Pise/5.a/blast2.pl');
+
+$blast2->blast2('blastp');
+$blast2->protein_db('genpept');
+
+my $job = $blast2->run( -query => $seq);
+print STDERR "Job id: (",$job->jobid,")\n";
+
+# You can save the blast output in a file:
+#my $parser_file = $job->save('blast2.txt');
+#print STDERR "Blast result saved in: $parser_file\n";
+
+my $blast_report = new Bio::SearchIO ('-format' => 'blast',
+ '-fh' => $job->fh('blast2.txt'));
+my $result = $blast_report->next_result;
+while( my $hit = $result->next_hit()) {
+ print "hit name: ", $hit->name(), "\n";
+ while( my $hsp = $hit->next_hsp()) {
+ print "\tE: ", $hsp->evalue(), " frac_identical: ",
+ $hsp->frac_identical(), "\n";
+ }
+}
View
35 examples/blast2.pl
@@ -0,0 +1,35 @@
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::SeqIO;
+use Bio::SearchIO;
+
+$_in_seq = Bio::SeqIO->newFh (-file => $ARGV[0],
+ -format => "fasta");
+my $seq = <$_in_seq>;
+
+# email is optional (although useful)
+#$factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+$factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
+
+my $blast2 = $factory->program('blast2');
+
+$blast2->blast2('blastp');
+$blast2->protein_db('swissprot');
+
+my $job = $blast2->run( -query => $seq);
+sleep 5;
+
+my $parser_file = $job->save('blast2.txt');
+print STDERR "Blast result saved in: $parser_file (",$job->jobid,")\n";
+
+my $blast_report = new Bio::SearchIO ('-format' => 'blast',
+ '-fh' => $job->fh('blast2.txt'));
+my $result = $blast_report->next_result;
+while( my $hit = $result->next_hit()) {
+ print "\thit name: ", $hit->name(), "\n";
+ while( my $hsp = $hit->next_hsp()) {
+ print "E: ", $hsp->evalue(), "frac_identical: ",
+ $hsp->frac_identical(), "\n";
+ }
+}
+
View
20 examples/clustalw.pl
@@ -0,0 +1,20 @@
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::AlignIO;
+
+$in = Bio::AlignIO->new('-file' => $ARGV[0]);
+$aln = $in->next_aln();
+
+#my $email = $ENV{USER} . "\@pasteur.fr"; # your email
+$factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+my $clustalw = $factory->program('clustalw');
+
+my $job = $clustalw->run( -infile => $aln);
+if ($job->error) {
+ print $job->error_message, "\n";
+}
+
+print STDERR "jobid: ", $job->jobid, "\n";
+
+
+
View
32 examples/dnadist.data
@@ -0,0 +1,32 @@
+ 7 232
+Bovine CCAAACCTGT CCCCACCATC TAACACCAAC CCACATATAC AAGCTAAACC AAAAATACCA
+Mouse CCAAAAAAAC ATCCAAACAC CAACCCCAGC CCTTACGCAA TAGCCATACA AAGAATATTA
+Gibbon CTATACCCAC CCAACTCGAC CTACACCAAT CCCCACATAG CACACAGACC AACAACCTCC
+Orang CCCCACCCGT CTACACCAGC CAACACCAAC CCCCACCTAC TATACCAACC AATAACCTCT
+Gorilla CCCCATTTAT CCATAAAAAC CAACACCAAC CCCCATCTAA CACACAAACT AATGACCCCC
+Chimp CCCCATCCAC CCATACAAAC CAACATTACC CTCCATCCAA TATACAAACT AACAACCTCC
+Human CCCCACTCAC CCATACAAAC CAACACCACT CTCCACCTAA TATACAAATT AATAACCTCC
+
+ TACTACTAAA AACTCAAATT AACTCTTTAA TCTTTATACA ACATTCCACC AACCTATCCA
+ TACAACCATA AATAAGACTA ATCTATTAAA ATAACCCATT ACGATACAAA ATCCCTTTCG
+ CACCTTCCAT ACCAAGCCCC GACTTTACCG CCAACGCACC TCATCAAAAC ATACCTACAA
+ CAACCCCTAA ACCAAACACT ATCCCCAAAA CCAACACACT CTACCAAAAT ACACCCCCAA
+ CACCCTCAAA GCCAAACACC AACCCTATAA TCAATACGCC TTATCAAAAC ACACCCCCAA
+ CACTCTTCAG ACCGAACACC AATCTCACAA CCAACACGCC CCGTCAAAAC ACCCCTTCAG
+ CACCTTCAGA ACTGAACGCC AATCTCATAA CCAACACACC CCATCAAAGC ACCCCTCCAA
+
+ CACAAAAAAA CTCATATTTA TCTAAATACG AACTTCACAC AACCTTAACA CATAAACATA
+ TCTAGATACA AACCACAACA CACAATTAAT ACACACCACA ATTACAATAC TAAACTCCCA
+ CACAAACAAA TGCCCCCCCA CCCTCCTTCT TCAAGCCCAC TAGACCATCC TACCTTCCTA
+ TTCACATCCG CACACCCCCA CCCCCCCTGC CCACGTCCAT CCCATCACCC TCTCCTCCCA
+ CATAAACCCA CGCACCCCCA CCCCTTCCGC CCATGCTCAC CACATCATCT CTCCCCTTCA
+ CACAAATTCA TACACCCCTA CCTTTCCTAC CCACGTTCAC CACATCATCC CCCCCTCTCA
+ CACAAACCCG CACACCTCCA CCCCCCTCGT CTACGCTTAC CACGTCATCC CTCCCTCTCA
+
+ CCCCAGCCCA ACACCCTTCC ACAAATCCTT AATATACGCA CCATAAATAA CA
+ TCCCACCAAA TCACCCTCCA TCAAATCCAC AAATTACACA ACCATTAACC CA
+ GCACGCCAAG CTCTCTACCA TCAAACGCAC AACTTACACA TACAGAACCA CA
+ ACACCCTAAG CCACCTTCCT CAAAATCCAA AACCCACACA ACCGAAACAA CA
+ ACACCTCAAT CCACCTCCCC CCAAATACAC AATTCACACA AACAATACCA CA
+ ACATCTTGAC TCGCCTCTCT CCAAACACAC AATTCACGCA AACAACGCCA CA
+ ACACCTTAAC TCACCTTCTC CCAAACGCAC AATTCGCACA CACAACGCCA CA
View
29 examples/dnadist.pl
@@ -0,0 +1,29 @@
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+
+# email is optional (although useful)
+#my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
+
+my $dnadist = $factory->program('dnadist');
+my $job = $dnadist->run(-infile => $ARGV[0]); # see dnadist.data
+
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+
+print STDERR "jobid: ", $job->jobid, "\n";
+print $job->content('outfile');
+
+my $neighbor = $factory->program('neighbor',
+ -infile => $job->fh('outfile'));
+my $job = $neighbor->run;
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+
+print $job->content('outtree');
+
+
View
36 examples/genscan.pl
@@ -0,0 +1,36 @@
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::SeqIO;
+use Bio::Tools::Genscan;
+
+$_in_seq = Bio::SeqIO->newFh (-file => $ARGV[0],
+ -format => "fasta");
+my $seq = <$_in_seq>;
+
+# email is optional (although useful)
+# my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
+
+my $genscan = $factory->program('genscan',
+ # other values: Arabidopsis.smat, Maize.smat
+ -parameter_file => "HumanIso.smat"
+ );
+$genscan->seq($seq); # see t/data/Genscan.FastA
+my $job = $genscan->run();
+
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+
+#print STDERR $job->content('genscan.out');
+
+my $parser_file = $job->save('genscan.out');
+$parser = Bio::Tools::Genscan->new(-file => $parser_file);
+while(my $gene = $parser->next_prediction()) {
+ my $prot = $gene->predicted_protein;
+ print "protein (", ref($prot), ") :\n", $prot->seq, "\n\n";
+}
+
+print STDERR "jobid: ", $job->jobid, "\n";
+
View
23 examples/needle.pl
@@ -0,0 +1,23 @@
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+
+#my $email = $ENV{USER} . "\@pasteur.fr"; # put your email
+
+my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+
+my $needle = $factory->program('needle');
+
+my $job = $needle->run(-sequencea => $ARGV[0],
+ -seqall => $ARGV[1],
+ -gapopen => 5,
+ -gapextend => 1);
+
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+
+print STDERR "jobid: ", $job->jobid, "\n";
+print $job->content('outfile.align');
+
+
View
33 examples/phylo-kun.pl
@@ -0,0 +1,33 @@
+#
+# This example will run a dnadist on an alignment, save the
+# matrix in a file dnadist.outfile, the run a neighbor-joining
+# on this distance matrix and print the tree file on standard output.
+#
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::AlignIO;
+
+$in = Bio::AlignIO->new('-file' => $ARGV[0]);
+$aln = $in->next_aln();
+
+$factory = Bio::Tools::Run::AnalysisFactory::Pise->new(
+ -location => 'http://kun.homelinux.com/cgi-bin/Pise/5.a/');
+my $dnadist = $factory->program('dnadist');
+my $job = $dnadist->run(-infile => $aln);
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+print STDERR "Job id: (",$job->jobid,")\n";
+
+my $matrix = $job->lookup_piped_file('phylip_dist');
+my $matrixfile = $job->save($matrix, 'dnadist.outfile');
+
+my $neighbor = $factory->program('neighbor');
+my $job = $neighbor->run(-infile => $matrixfile);
+if ($job->error) {
+ print ".............error: ",$job->error_message,".............\n";
+ exit;
+}
+print $job->content('outtree');
+
View
28 examples/toppred.pl
@@ -0,0 +1,28 @@
+#
+# This example needs the Toppred parser developped by K. Schuerer
+# for the XML output of the Toppred2 implementation by E. Deveaud
+# and K. Schuerer (ftp://ftp.pasteur.fr/pub/GenSoft/unix/protein/toppred/)
+#
+
+use Bio::Tools::Run::AnalysisFactory::Pise;
+use Bio::SeqIO;
+use Toppred;
+
+#my $email = $ENV{USER} . "\@pasteur.fr";
+my $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+
+my $toppred = $factory->program('toppred',
+ -query => $ARGV[0],
+ -outformat => "xml");
+my $job = $toppred->run();
+print STDERR "jobid: ", $job->jobid, "\n";
+
+my $xml_file = $job->save('toppred.out');
+my $top = new Toppred ( -file => $xml_file);
+my $out = newFh Bio::SeqIO ( -fh => \*STDOUT,
+ -format => 'swiss');
+while(my $pred = $top->next_prediction()) {
+ print $out $pred;
+}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.