# BioMirror/Swiss.pm =head1 NAME BioMirror::Swiss -- BioMirror::Data packages for SwissProt/ExPASY databanks =cut package BioMirror::SwissProt; @ISA = qw( BioMirror::Data ); sub new { my $class= shift; my $self = $class->SUPER::new( srsdb => 'SWISSPROT', name => 'SWISS-PROT', makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, mirror_dir => '$zpath/swissprot/', expanded_dir => '$dpath/swissprot/', dosummary => 1, source => { home => 'ExPASy', comment => 'Annotated protein sequence database', url => 'ftp://expasy.hcuge.ch/databases/swiss-prot/release_compressed/', web => 'http://www.expasy.ch/sprot/', get_patt => '(README|sprot.*\.dat\.Z$|userman\.txt\.Z|relnotes\.txt\.Z)', local_ignore => '+Readme|update|new-seq.dat|log$', recursive => 'false', }, data => [ ## ? need data_pat => or such for data file regex patterns ? '(sprot[0-9]+.dat)=seq.dat', ], docs => [ ## don't confuse w/ seq data - do we need these unexpanded? 'relnotes.txt', 'userman.txt', ], @_ ); return $self; } sub getRelease { # SWISS-PROT RELEASE 36.0 RELEASE NOTES my $self= shift; my $rel= undef; my $df= BioMirror::replaceVars( $self->expanded_dir . 'relnotes.txt'); # my @df= $self->getDataPathnames(); # my $df= $df[0] . $df[1]; my $buf= $self->readChunk($df); if ($buf =~ m/SWISS-PROT RELEASE ([0-9\.]+)/) { $rel= "$1"; } return $rel; } #------------- package BioMirror::SwissProtNew; @ISA = qw( BioMirror::SwissProt ); sub new { my $class= shift; my $self = $class->SUPER::new( srsdb => 'SWISSNEW', name => 'SwissProt New data', makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, mirror_dir => '$zpath/swissprot/updates/', expanded_dir => '$dpath/swissnew/', dosummary => 0, source => { comment => 'SwissProt new data from ExPASy', url => 'ftp://expasy.hcuge.ch/databases/swiss-prot/updates_compressed/', web => 'http://www.expasy.ch/sprot/', get_patt => '(new_seq\.dat\.Z$)', local_ignore => '+Readme|update|new-seq.dat|log$', recursive => 'false', }, data => [ 'new_seq.dat', ], docs => [], @_ ); return $self; } #------------- # ## moved to EBI package to get their version of sp_tr_nrdb # package BioMirror::TrEMBL; # @ISA = qw( BioMirror::SwissProt ); # # sub new { # my $class= shift; # my $self = $class->SUPER::new( # srsdb => 'TREMBL', # name => 'TrEMBL', # makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, # mirror_dir => '$zpath/trembl/', # expanded_dir => '$dpath/trembl/', # # source => { # comment => 'TrEMBL from ExPASy', # url => 'ftp://expasy.hcuge.ch/databases/sp_tr_nrdb/', # web => 'http://www.expasy.ch/sprot/', # get_patt => '(README|trembl.*\.dat\.Z$|nrdb.txt|userman.txt.Z|relnotes.txt.Z)', # local_ignore => '+Readme|update|log$', # exclude_patt => '+|fasta', # recursive => 'false', # }, # # data => [ 'trembl.dat', ], # docs => [], # @_ ); # return $self; # } # # # sub getRelease { # # ??? # my $self= shift; # my $rel= undef; # my $df= BioMirror::replaceVars( $self->expanded_dir . ${$self->data}[0]); # # my @df= $self->getDataPathnames(1); # # my $df= $df[0] . $df[1]; # my $buf= $self->readChunk($df); # # #if ($buf =~ m/SWISS-PROT RELEASE ([0-9\.]+)/) { # # $rel= "$1"; # # } # return $rel; # } # # #------------- # # package BioMirror::TrEMBLNew; # @ISA = qw( BioMirror::TrEMBL ); # # sub new { # my $class= shift; # my $self = $class->SUPER::new( # srsdb => 'TREMBLNEW', # name => 'TrEMBL new data', # makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, # # sourceflags => $BioMirror::Data::kSuperSource, # data => [ 'trembl_new.dat', ], # @_ ); # return $self; # } #------------- package BioMirror::Enzyme; @ISA = qw( BioMirror::Data ); sub new { my $class= shift; my $self = $class->SUPER::new( srsdb => 'ENZYME', name => 'Enzyme', makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, dosummary => 1, source => { home => 'ExPASy', comment => 'Enzyme nomenclature database', url => 'ftp://expasy.hcuge.ch/databases/enzyme/', web => 'http://www.expasy.ch/enzyme/', }, mirror_dir => '$zpath/enzyme/', expanded_dir => '$dpath/enzyme/', data => [ 'enzyme.dat' ], @_ ); return $self; } ## for enzyme|prosite|prositedoc sub getRelease { ##CC Release 24.0 of January 1999 ##CC Release 15.0 of July 1998 ## Release : 15.0 of July 1998 my $self= shift; my $rel= undef; my $df= BioMirror::replaceVars( $self->expanded_dir . ${$self->data}[0]); my $buf= $self->readChunk($df); if ($buf =~ m/Release[\s:]+([0-9\.]+) of ([0-9A-z ]+)/) { $rel= "$1, $2"; } return $rel; } #------------- package BioMirror::Prosite; @ISA = qw( BioMirror::Enzyme ); sub new { my $class= shift; my $self = $class->SUPER::new( srsdb => 'PROSITE', name => 'Prosite', makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, dosummary => 1, source => { home => 'ExPASy', comment => 'Database of protein families and domains', url => 'ftp://expasy.hcuge.ch/databases/prosite/', web => 'http://www.expasy.ch/prosite/', }, mirror_dir => '$zpath/prosite/release_with_updates', expanded_dir => '$dpath/prosite/', data => [ 'prosite.dat', ], @_ ); return $self; } #---------------- package BioMirror::PrositeDoc; @ISA = qw( BioMirror::Prosite ); sub new { my $class= shift; my $self = $class->SUPER::new( srsdb => 'PROSITEDOC', name => 'PrositeDoc', makeflags => $BioMirror::Data::kFromArchive|$BioMirror::Data::kDoSrsIndex, dosummary => 0, ## no need to ftp source separate from Prosite... sourceflags => $BioMirror::Data::kSuperSource, data => [ 'prosite.doc', ], @_ ); return $self; } #---------------- 1;