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

Diff of /FigKernelScripts/server_paper_example5.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Wed Oct 21 18:17:16 2009 UTC revision 1.2, Thu Oct 29 18:29:51 2009 UTC
# Line 3  Line 3 
3    
4  use FFserver;  use FFserver;
5    
6  # Read FASTA file of contig data from STDIN.  # Parms are FASTA input file name, genus, species.
 # Parms are genus, species.  
7  # Produce geneID, type, contig, begin, strand, len on STDOUT.  # Produce geneID, type, contig, begin, strand, len on STDOUT.
8    
9  my $ffObject = FFserver->new();  my $ffObject = FFserver->new();
10  my ($genus, $species) = @ARGV;  my ($file, $genus, $species) = @ARGV;
11    
12  my @contigs;  open FASTAIN, "<$file";
13  while (<STDIN>) {  my $geneCalls = $ffObject->call_genes(\*FASTAIN);
     if ($_ =~ /^>(\S+)/) {  
         push @contigs, $_;  
     } else {  
         $contigs[$#contigs] .= $_;  
     }  
 }  
   
 my $geneCalls = $ffObject->call_genes(-id_seq => \@contigs);  
14  # We throw away the FASTA string returned by call_genes.  # We throw away the FASTA string returned by call_genes.
15  my (undef, $geneHash) = @$geneCalls;  my (undef, $geneList) = @$geneCalls;
16  for my $gene (sort keys %$geneHash) {  for my $geneData (@$geneList) {
17      my ($contig, $begin, $strand, $len) = $geneHash->{$gene} =~ /(.+)_(\d+)([+-])(\d+)/;      my ($gene, $contig, $begin, $strand, $len) = @$geneData;
18      print join("\t", $gene, 'peg', $contig, $begin, $strand, $len);      print join("\t", $gene, 'peg', $contig, $begin, $strand, $len);
19  }  }
20    close FASTAIN;
21  my $rnaCalls = $ffObject->find_rnas(-id_seq => \@contigs, -genus => $genus,  open FASTAIN, "<$file";
22                                      -species => $species, -domain => 'B');  my $rnaCalls = $ffObject->find_rnas(\*FASTAIN, $genus, $species, 'Bacteria');
23  # We throw away the FASTA string returned by find_rnas.  # We throw away the FASTA string returned by find_rnas.
24  my (undef, $rnaHash) = @$rnaCalls;  my (undef, $rnaList) = @$rnaCalls;
25  for my $rna (sort keys %$rnaHash) {  for my $rnaData (@$rnaList) {
26      my ($contig, $begin, $strand, $len) = $rnaHash->{$rna} =~ /(.+)_(\d+)([+-])(\d+)/;      my ($rna, $contig, $begin, $strand, $len) = @$rnaData;
27      print join("\t", $rna, 'rna', $contig, $begin, $strand, $len);      print join("\t", $rna, 'rna', $contig, $begin, $strand, $len);
28  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3