[Bio] / Sprout / Contigs.pl Repository:
ViewVC logotype

Annotation of /Sprout/Contigs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :     use strict;
3 :    
4 :     use ERDB;
5 :    
6 :     my $erdb = ERDB::GetDatabase('Sprout');
7 :     my $genomeID = shift @ARGV;
8 :     my $qh = $erdb->Get('Genome HasContig Contig', "Genome(id) = ?", [$genomeID]);
9 :     while (my $contig = $qh->Fetch()) {
10 :     my $contigID = $contig->PrimaryValue('Contig(id)');
11 :     my $seq = &GetContigSeq($erdb, $contigID);
12 :     my $len = length($seq);
13 :     my $prefix = substr($seq, 0, 50);
14 :     print "$contigID\t$len\t$prefix\n";
15 :     }
16 :    
17 :     sub GetContigSeq {
18 :     my ($erdb, $contigID) = @_;
19 :     my $retVal = join("", $erdb->GetFlat("Contig IsMadeUpOf Sequence", "Contig(id) = ? ORDER BY IsMadeUpOf(start-position)",
20 :     [$contigID], "Sequence(sequence)"));
21 :     return $retVal;
22 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3