Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bioperl/bioperl-live
Browse files Browse the repository at this point in the history
Conflicts:
	Bio/Tools/Protparam.pm
  • Loading branch information
Heikki Lehvaslaiho authored and Heikki Lehvaslaiho committed Sep 21, 2011
2 parents 644673c + ecbb594 commit 9b3cbb3
Show file tree
Hide file tree
Showing 37 changed files with 996 additions and 636 deletions.
14 changes: 14 additions & 0 deletions Bio/AlignIO.pm
Expand Up @@ -375,6 +375,20 @@ sub fh {
return $s;
}


=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the alignment format
Returns : alignment format
Args : none
=cut

# format() method inherited from Bio::Root::IO


# _initialize is where the heavy stuff will happen when new is called

sub _initialize {
Expand Down
13 changes: 13 additions & 0 deletions Bio/Assembly/IO.pm
Expand Up @@ -141,6 +141,19 @@ sub new {
}


=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the assembly format
Returns : assembly format
Args : none
=cut

# format() method inherited from Bio::Root::IO


# _initialize is chained for all SeqIO classes
sub _initialize {
my($self, @args) = @_;
Expand Down
14 changes: 2 additions & 12 deletions Bio/Assembly/IO/ace.pm
Expand Up @@ -814,25 +814,15 @@ sub write_footer {
=head2 variant
Title : variant
Usage : $format = $obj->variant();
Usage : $variant = $ass_io->variant();
Function: Get and set method for the assembly variant. This is important since
not all assemblers respect the reference ACE format.
Returns : string
Args : string: 'consed' (default) or '454'
=cut

sub variant {
my ($self, $enc) = @_;
if (defined $enc) {
$enc = lc $enc;
if (not exists $variant{$enc}) {
$self->throw('Not a valid ACE variant format');
}
$self->{variant} = $enc;
}
return $self->{variant};
}
# variant() method inherited from Bio::Root::IO


=head2 _write_read
Expand Down
12 changes: 12 additions & 0 deletions Bio/ClusterIO.pm
Expand Up @@ -186,6 +186,18 @@ sub new {
}
}

=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the cluster format
Returns : cluster format
Args : none
=cut

# format() method inherited from Bio::Root::IO


# _initialize is chained for all ClusterIO classes

Expand Down
6 changes: 5 additions & 1 deletion Bio/DB/CUTG.pm
Expand Up @@ -46,6 +46,11 @@ reference variable.
I intend at a later date to allow retrieval of multiple codon tables
e.g., from a wildcard search.
Examples URLs:
L<http://www.kazusa.or.jp/codon/cgi-bin/spsearch.cgi?species=Pan+troglodytes&c=s>
L<http://www.kazusa.or.jp/codon/cgi-bin/showcodon.cgi?species=37011&aa=1&style=GCG>
=head1 SEE ALSO
L<Bio::Tools::CodonTable>,
Expand All @@ -57,7 +62,6 @@ L<Bio::CodonUsage::IO>
=head2 Mailing Lists
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to one
of the Bioperl mailing lists. Your participation is much appreciated.
Expand Down
2 changes: 1 addition & 1 deletion Bio/DB/Fasta.pm
Expand Up @@ -60,7 +60,7 @@ sequences without bringing the entire sequence into memory.
When you initialize the module, you point it at a single fasta file or
a directory of multiple such files. The first time it is run, the
module generates an index of the contents of the file or directory
using the AnyDBM module (Berkeley DB* preferred, followed by GDBM_File,
using the AnyDBM_File module (BerkeleyDB preferred, followed by GDBM_File,
NDBM_File, and SDBM_File). Thereafter it uses the index file to find
the file and offset for any requested sequence. If one of the source
fasta files is updated, the module reindexes just that one file. (You
Expand Down
2 changes: 1 addition & 1 deletion Bio/DB/SeqFeature/Store/DBI/mysql.pm
Expand Up @@ -566,7 +566,7 @@ sub _finish_bulk_update {
my $fh = $self->dump_filehandle($table);
my $path = $self->dump_path($table);
$fh->close;
print STDERR "$path\n";
#print STDERR "$path\n";

$dbh->do("LOAD DATA LOCAL INFILE '$path' REPLACE INTO TABLE $table FIELDS OPTIONALLY ENCLOSED BY '\\''")
or $self->throw($dbh->errstr);
Expand Down
13 changes: 13 additions & 0 deletions Bio/FeatureIO.pm
Expand Up @@ -342,6 +342,19 @@ sub fh {
return $s;
}

=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the feature format
Returns : feature format
Args : none
=cut

# format() method inherited from Bio::Root::IO


# _initialize is chained for all FeatureIO classes

sub _initialize {
Expand Down
14 changes: 14 additions & 0 deletions Bio/MapIO.pm
Expand Up @@ -120,6 +120,20 @@ sub new {

}


=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the map format
Returns : map format
Args : none
=cut

# format() method inherited from Bio::Root::IO


=head2 Bio::Factory::MapFactoryI methods
=cut
Expand Down
15 changes: 14 additions & 1 deletion Bio/Matrix/IO.pm
Expand Up @@ -19,7 +19,7 @@ Bio::Matrix::IO - A factory for Matrix parsing
use Bio::Matrix::IO;
my $parser = Bio::Matrix::IO->new(-format => 'scoring',
-file => 'BLOSUMN50');
-file => 'BLOSUMN50');
my $matrix = $parser->next_matrix;
Expand Down Expand Up @@ -159,6 +159,19 @@ sub fh {
}


=head2 format
Title : format
Usage : $format = $obj->format()
Function: Get the matrix format
Returns : matrix format
Args : none
=cut

# format() method inherited from Bio::Root::IO


=head2 next_matrix
Title : next_matrix
Expand Down
16 changes: 15 additions & 1 deletion Bio/OntologyIO.pm
Expand Up @@ -111,7 +111,7 @@ my %format_driver_map = (
"interpro" => "InterProParser",
"interprosax" => "Handlers::InterPro_BioSQL_Handler",
"evoc" => "simplehierarchy",
"obo" => "obo"
"obo" => "obo"
);

=head2 new
Expand Down Expand Up @@ -185,6 +185,20 @@ sub new {

}


=head2 format
Title : format
Usage : $format = $parser->format()
Function: Get the ontology format
Returns : ontology format
Args : none
=cut

# format() method inherited from Bio::Root::IO


sub _initialize {
my($self, @args) = @_;

Expand Down
18 changes: 16 additions & 2 deletions Bio/PopGen/IO.pm
Expand Up @@ -16,10 +16,10 @@
Bio::PopGen::IO - Input individual,marker,allele information
=head1 SYNOPSIS
use Bio::PopGen::IO;
my $io = Bio::PopGen::IO->new(-format => 'csv',
-file => 'data.csv');
-file => 'data.csv');
# Some IO might support reading in a population at a time
Expand Down Expand Up @@ -126,6 +126,20 @@ sub new {
}
}


=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the PopGen format
Returns : PopGen format
Args : none
=cut

# format() method inherited from Bio::Root::IO


# _initialize is chained for all PopGen::IO classes

sub _initialize {
Expand Down
13 changes: 13 additions & 0 deletions Bio/Restriction/IO.pm
Expand Up @@ -160,6 +160,19 @@ sub new {
}


=head2 format
Title : format
Usage : $format = $stream->format()
Function: Get the restriction format
Returns : restriction format
Args : none
=cut

# format() method inherited from Bio::Root::IO


sub _load_format_module {
my ($class, $format) = @_;
my $module = "Bio::Restriction::IO::" . $format;
Expand Down
57 changes: 57 additions & 0 deletions Bio/Root/IO.pm
Expand Up @@ -374,6 +374,7 @@ sub _initialize_io {
return 1;
}


=head2 _fh
Title : _fh
Expand All @@ -393,6 +394,7 @@ sub _fh {
return $obj->{'_filehandle'};
}


=head2 mode
Title : mode
Expand Down Expand Up @@ -441,6 +443,7 @@ sub mode {
return $obj->{'_mode'};
}


=head2 file
Title : file
Expand All @@ -460,6 +463,60 @@ sub file {
return $obj->{'_file'};
}


=head2 format
Title : format
Usage : $self->format($newval)
Function: Get the format of a Bio::Root::IO sequence file or filehandle. Every
object inheriting Bio::Root::IO is guaranteed to have a format.
Returns : format of the file or filehandle, e.g. fasta, fastq, genbank, embl.
Args : none
=cut

sub format {
my ($self) = @_;
my $format = (split '::', ref($self))[-1];
return $format;
}


=head2 variant
Title : format
Usage : $self->format($newval)
Function: Get the variant of a Bio::Root::IO sequence file or filehandle.
The format variant depends on the specific format used. Note that not
all formats have variants
Returns : variant of the file or filehandle, e.g. sanger, solexa or illumina for
the fastq format, or undef for formats that do not have variants.
Args : none
Note : The Bio::Root::IO-implementing modules that require access to variants
need to define a global hash that has the allowed variants as its keys.
=cut

sub variant {
my ($self, $variant) = @_;
if (defined $variant) {
$variant = lc $variant;
my $var_name = '%'.ref($self).'::variant';
my %ok_variants = eval $var_name; # e.g. %Bio::Assembly::IO::ace::variant
if (scalar keys %ok_variants == 0) {
$self->throw('Cannot check for validity of variant because global '.
"variant $var_name is not set or is empty\n");
}
if (not exists $ok_variants{$variant}) {
$self->throw($variant.' is not a valid variant of the '.$self->format.
' format');
}
$self->{variant} = $variant;
}
return $self->{variant};
}


=head2 _print
Title : _print
Expand Down
14 changes: 14 additions & 0 deletions Bio/SearchIO.pm
Expand Up @@ -288,6 +288,20 @@ sub fh {
return $s;
}


=head2 format
Title : format
Usage : $format = $obj->format()
Function: Get the search format
Returns : search format
Args : none
=cut

# format() method inherited from Bio::Root::IO


=head2 attach_EventHandler
Title : attach_EventHandler
Expand Down

0 comments on commit 9b3cbb3

Please sign in to comment.