view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::getcwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bible/Reference.pm view on Meta::CPAN
When you call this method with good input, it will save the new Bible and
internally call C<bible()> to set the new Bible as active.
You may optionally provide an additional arrayref of arrayrefs containing the
maximum verse number for each chapter of a book. This is useful only if you
need to call C<expand_ranges>. If you don't pass this data, a best-guess of the
data will be used.
=head2 expand_ranges
This is a helper method. It's called automatically if C<add_detail> is set to a
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Biblio/Citation/Parser/Citebase.pm view on Meta::CPAN
$cite->find_jnl_name();
return 1
};
if ($cite->guess_vol_no_pg()) {
$cite->find_jnl_name();
return 1;
};
if ($cite->find_vol_no() or
lib/Biblio/Citation/Parser/Citebase.pm view on Meta::CPAN
$cite->find_year();
return 1;
};
if ($cite->guess_vol_pg()) {
$cite->find_year();
$cite->find_jnl_name();
return 1;
};
if ($cite->guess_vol_year()) {
$cite->find_page();
$cite->find_jnl_name();
return 1;
lib/Biblio/Citation/Parser/Citebase.pm view on Meta::CPAN
return 0;
}
# Apt'e, C., et al. ACM Transactions on Information Systems 12, 3, 233-251
sub guess_vol_no_pg {
my $cite = shift;
return 1 if ($cite->{'volume'} and $cite->{'issue'} and
$cite->{'spage'});
return 0 if ($cite->{'num_of_fig'} < 3);
lib/Biblio/Citation/Parser/Citebase.pm view on Meta::CPAN
}
# '15:190' (15A:190-195, 14-15:190-180, or "Astrophys. J. 8, 103");
# Called this after '{find_vol_{no}_pg_year}' failed.
sub guess_vol_pg {
my $cite = shift;
return 1 if ($cite->{'volume'} and $cite->{'spage'});
return 0 if ($cite->{'num_of_fig'} < 2);
my $Text = $cite->{'rest_text'};
lib/Biblio/Citation/Parser/Citebase.pm view on Meta::CPAN
#
# G. Smith and H. Gray; Pub. Astron. Soc. Japan, 2000, vol. 52
# To find $cite->{'jnl_epos'} currectly. Note that '2000' may be
# regarded as the journal name (by subroutine find_vol).
sub guess_vol_year {
my $cite = shift;
return 0 if ($cite->{'num_of_fig'} < 2);
my $Text = $cite->{'rest_text'};
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::getcwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Biblio/Thesaurus/SQLite.pm view on Meta::CPAN
##
# Does the same thing as the previous method, but outputs the data in an
# ISO Thesaurus format
# @param .....
# @param guess w00t ?
sub getTermAsISOthe {
my $termo = shift or die;
my $dbfile = shift or die;
# connect to the database
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5.pm view on Meta::CPAN
if ( $condition && ... ) { print "Hello\n" };
There are some cases where Perl can't immediately tell the difference between an
expression and a statement. For instance, the syntax for a block and an anonymous
hash reference constructor look the same unless there's something in the braces that
give Perl a hint. The yada yada is a syntax error if Perl doesn't guess that the
{ ... } is a block. In that case, it doesn't think the ... is the yada yada because
it's expecting an expression instead of a statement:
my @transformed = map { ... } @input; # syntax error
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5HKSCS.pm view on Meta::CPAN
if ( $condition && ... ) { print "Hello\n" };
There are some cases where Perl can't immediately tell the difference between an
expression and a statement. For instance, the syntax for a block and an anonymous
hash reference constructor look the same unless there's something in the braces that
give Perl a hint. The yada yada is a syntax error if Perl doesn't guess that the
{ ... } is a block. In that case, it doesn't think the ... is the yada yada because
it's expecting an expression instead of a statement:
my @transformed = map { ... } @input; # syntax error
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bigtop/Docs/TentRef.pod view on Meta::CPAN
=back
In addition to the statements that affect the whole controller, there
are methods in it. Methods come in seven types, shown below.
There are two statements they all understand: no_gen (take a guess)
and extra_args. Any extra_args -- and you can have as many as you like --
are added to the argument list in the generated routine. Be sure to
include full perl variables, including sigils:
$id
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BingoX/Argon.pm view on Meta::CPAN
=item C<data_class> ( )
Static method returns data class defined for application subclass.
If none is assigned, guess. :-)
=cut
sub data_class {
my $self = shift;
my $class = ref($self) || $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/AGP/LowLevel.pm view on Meta::CPAN
$r{is_gap} = 0;
@r{qw(ident cstart cend orient)} = @fields;
if($opt{validate_identifiers}) {
my $comp_type = identifier_namespace($r{ident})
or parse_error("cannot guess type of '$r{ident}'");
} else {
$r{ident} or parse_error("invalid identifier '$r{ident}'");
}
str_in($r{orient},qw/+ - 0 na/)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Affymetrix/CHP.pm view on Meta::CPAN
=head2 smooth_factor
Arg [1] : float $smooth_factor (optional)
Example : my $smooth_factor=$chp->smooth_factor();
Description: Get/set the smooth factor. Your guess is as good as
mine as to what this actually is, although it is used in calculating
the background. Not available in MAS5 files.
Returntype : float
Exceptions : none
Caller : general
lib/Bio/Affymetrix/CHP.pm view on Meta::CPAN
Example : my @background_zones=@{$chp->background_zones()};
# Print "X", "Y", "Background Value" for background zone 0
print $background_zones[0]->[0],$background_zones[0]->[1],$background_zones[0]->[2];
Description: Get/set an array of background zones. Again, your guess is as good as
mine as to what this actually is, although it is used in calculating
the background. Not available in MAS5 files.
Returns an arrayref to an arrayref. Each zone has an array three
values long, which are X,Y and background value respectively.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Align/Subset.pm view on Meta::CPAN
such as abi (ABI) and scf. There are many more, for a complete listing
see the SeqIO HOWTO (L<http://bioperl.open-bio.org/wiki/HOWTO:SeqIO>).
If no format is specified and a filename is given then the module will
attempt to deduce the format from the filename suffix. If there is no
suffix that Bioperl understands then it will attempt to guess the
format based on file content. If this is unsuccessful then SeqIO will
throw a fatal error.
The format name is case-insensitive: 'FASTA', 'Fasta' and 'fasta' are
all valid.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/AlignIO/stockholm.pm view on Meta::CPAN
-file => '>file');
Function: Initialize a new L<Bio::AlignIO::stockholm> reader or writer
Returns : L<Bio::AlignIO> object
Args : -line_length : length of the line for the alignment block
-alphabet : symbol alphabet to set the sequences to. If not set,
the parser will try to guess based on the alignment
accession (if present), defaulting to 'dna'.
-spaces : (optional, def = 1) boolean to add a space in between
the "# STOCKHOLM 1.0" header and the annotation and
the annotation and the alignment.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/BLAST/Database.pm view on Meta::CPAN
my $self = $class->SUPER::new(\%args);
$self->full_file_basename or croak 'must provide a full_file_basename';
unless( $self->type ) {
$self->type( $self->_guess_type )
or croak 'type not provided, and could not guess it';
}
if( $self->write ) {
$self->create_dirs || -d dirname( $self->full_file_basename )
or croak 'either directory must exist, or create_dirs must be set true';
lib/Bio/BLAST/Database.pm view on Meta::CPAN
my $indexed = (any {/sd$/} @files) && (any {/si$/} @files);
### set our data
$self->type( $self->_guess_type )
or confess 'could not determine db type';
### type: $self->type
$self->format_time( _parse_datestr($datestr) ); #< will die on failure
$title =~ s/\s+$//;
$self->title( $title );
$self->_indexed_seqs( $indexed );
$self->sequences_count( $seq_cnt );
}
sub _guess_type {
my ($self) = @_;
my $saved_type = $self->type;
foreach my $guess (qw( protein nucleotide )) {
$self->type( $guess );
if( $self->files_are_complete ) {
$self->type( $saved_type );
return $guess;
}
}
$self->type( $saved_type );
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/BPWrapper/AlnManipulations.pm view on Meta::CPAN
# my $in_format = $opts{"input"} || $default_format;
# my $in_format;
# use IO::Scalar;
# my $s;
# my ($guesser);
# if ($file eq "STDIN") {
# my $line_ct = 0;
# my $lines;
# while(<>) { $lines .= $_; $line_ct++; last if $line_ct >= 100 } # read the first 100 lines
# $guesser = Bio::Tools::GuessSeqFormat->new( -text => $lines );
# } else {
# open $ifh, "<", $file or die $!;
# $guesser = Bio::Tools::GuessSeqFormat->new( -file => $file );
# }
# $in_format = $guesser->guess();
# die "unknown file format. Try specify with -i flag.\n" unless $in_format;
# seek (STDIN, 0, 0);
# warn "$in_format\n";
my $in_format = $opts{'input'} || 'clustalw';
if ($opts{"concat"}) {
# foreach my $file (glob @ARGV) {
while ($file = shift @ARGV) {
# warn "reading $file\n";
# $guesser = Bio::Tools::GuessSeqFormat->new( -file => $file);
# $in_format = $guesser->guess;
$in = Bio::AlignIO->new(-file => $file, -format => $in_format);
while ($aln=$in->next_aln()) { push @alns, $aln }
}
} else {
$file = shift @ARGV || "STDIN"; # If no more arguments were given on the command line
if ($in_format && $in_format =~ /blast/) { # guess blastoutput as "phylip", so -i 'blast' is needed
# if ($opts{"input"} && $opts{"input"} =~ /blast/) { # "blastxml" (-outfmt 5 ) preferred
my $searchio = Bio::SearchIO->new( -format => 'blast', ($file eq "STDIN")? (-fh => \*STDIN) : (-file => $file)); # works for regular blast output
# my $searchio = Bio::SearchIO->new( -format => 'blast', -fh => $ifh);
while ( my $result = $searchio->next_result() ) {
while( my $hit = $result->next_hit ) {
my $hsp = $hit->next_hsp; # get first hit; others ignored
$aln = $hsp->get_aln();
}
}
} else { # would throw error if format guessed wrong
# $in = Bio::AlignIO->new(-format => $in_format, ($file eq "STDIN")? (-fh => \*STDIN) : (-file => $file));
# $in = Bio::AlignIO->new(-format => $in_format, -fh => $ifh);
$in = Bio::AlignIO->new(-format=>$in_format, ($file eq "STDIN")? (-fh => \*STDIN) : (-file => $file) );
$aln = $in->next_aln()
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Biblio.pm view on Meta::CPAN
} else {
my %param = @args;
@param { map { lc $_ } keys %param } = values %param; # lowercase keys
my $access =
$param {'-access'} ||
$class->_guess_access ( $param {'-location'} ) ||
'soap';
$access = "\L$access"; # normalize capitalization to lower case
# load module with the real implementation - as defined in $access
return unless (&_load_access_module ($access));
lib/Bio/Biblio.pm view on Meta::CPAN
# this is kept here for the future when more access protocols
# (e.g. CORBA) may be available for accessing bibliographic query
# services
sub _guess_access {
# my ($class, $location) = @_;
return 'soap';
}
1;
lib/Bio/Biblio.pm view on Meta::CPAN
require Bio::DB::Biblio::$access
It prints an error on STDERR if it fails to find and load the module
(for example, because of the compilation errors in the module).
=head2 _guess_access
Usage : $class->_guess_access ($location)
Returns : string with a guessed access protocol (e.g. 'soap')
Args : 'location' defines where to find a bibliographic service
in a protocol-dependent manner (e.g. for SOAP it is
a URL of a bibliographic WebService)
It makes an expert guess what kind of access/transport protocol should
be used based on the I<location> of the service (e.g. if the
I<location> looks like an IOR then the access protocol is probably
CORBA).
=head1 OVERVIEW OF CLASSES AND PACKAGES
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Cluster/ClusterFactory.pm view on Meta::CPAN
=head1 SYNOPSIS
use Bio::Cluster::ClusterFactory;
# if you don't provide a default type, the factory will try
# some guesswork based on display_id and namespace
my $factory = Bio::Cluster::ClusterFactory->new(-type => 'Bio::Cluster::UniGene');
my $clu = $factory->create_object(-description => 'NAT',
-display_id => 'Hs.2');
lib/Bio/Cluster/ClusterFactory.pm view on Meta::CPAN
Title : new
Usage : my $obj = Bio::Cluster::ClusterFactory->new();
Function: Builds a new Bio::Cluster::ClusterFactory object
Returns : Bio::Cluster::ClusterFactory
Args : -type => string, name of a ClusterI derived class.
If not provided, the factory will have to guess
from ID and namespace, which may or may not be
successful.
=cut
lib/Bio/Cluster/ClusterFactory.pm view on Meta::CPAN
sub create_object {
my ($self,@args) = @_;
my $type = $self->type();
if(! $type) {
# we need to guess this
$type = $self->_guess_type(@args);
$self->throw("No cluster type set and unable to guess.") unless $type;
$self->type($type);
}
return $type->new(-verbose => $self->verbose, @args);
}
=head2 _guess_type
Title : _guess_type
Usage :
Function: Guesses the right type of L<Bio::ClusterI> implementation
based on initialization parameters for the prospective
object.
Example :
lib/Bio/Cluster/ClusterFactory.pm view on Meta::CPAN
cluster object
=cut
sub _guess_type{
my ($self,@args) = @_;
my $type;
# we can only guess from a certain number of arguments
my ($dispid, $ns, $members) =
$self->_rearrange([qw(DISPLAY_ID
NAMESPACE
MEMBERS
)], @args);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Community/IO.pm view on Meta::CPAN
# These all come from the same base, Moose::Object, so this is fine
my $params = $real_class->BUILDARGS(@args);
my $format = delete $params->{'-format'};
if (not defined $format) {
# Try to guess format
my $guesser = Bio::Community::IO::FormatGuesser->new();
if ($params->{'-file'}) {
$guesser->file( $params->{'-file'} );
} elsif ($params->{'-fh'}) {
$guesser->fh( $params->{'-fh'} );
}
$format = $guesser->guess;
}
if (not defined $format) {
$real_class->throw("Could not automatically detect input format.");
}
view all matches for this distribution
view release on metacpan or search on metacpan
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/Das/Chado.pm view on Meta::CPAN
if(ref($arg) eq 'HASH'){
return $self->{'name2term'} = $arg;
} elsif($arg) {
return $self->{'name2term'}{$arg};
#rather than trying to guess what a caller wants, the caller will have
#deal with what comes... (ie, a scalar or a hash).
# my $val= $self->{'name2term'}{$arg};
# if(ref($val)) {
# #? use $cvnames scalar here to pick which cv?
# my @val= @$val;
# foreach $val (@val) {
# my $cv= $self->{'termcvs'}{$val};
# return $val if($cv =~ /^(SO|sequence)/i); # want sofa_id
# }
# return $val[0]; #? 1st is best guess
# }
# return $val;
} else {
return $self->{'name2term'};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/GFF/Adaptor/biofetch.pm view on Meta::CPAN
);
# now load each feature in turn
my ($transcript_version,$mRNA_version) = (0,0);
for my $feat ($seq->all_SeqFeatures) {
my $attributes = $self->get_attributes($feat);
my $name = $self->guess_name($attributes);
my $location = $feat->location;
my @segments = map {[$_->start,$_->end,$_->seq_id]}
$location->can('sub_Location') ? $location->sub_Location : $location;
lib/Bio/DB/GFF/Adaptor/biofetch.pm view on Meta::CPAN
}
}
\@result;
}
sub guess_name {
my $self = shift;
my $attributes = shift;
# remove this fix when Lincoln fixes it properly
return ["Misc" => "Misc"] unless ($attributes); # these are arbitrary, and possibly destructive defaults
my @ordered_attributes = sort {($self->_preferred_tags->{$a->[0]} || 0) <=> ($self->_preferred_tags->{$b->[0]} || 0)} @$attributes;
view all matches for this distribution
view release on metacpan or search on metacpan
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Das/ProServer/SourceHydra/dbi.pm view on Meta::CPAN
=head1 SUBROUTINES/METHODS
=head2 sources : DBI sources
Effectively returns the results of a SHOW TABLES LIKE '$basename%'
query. In Oracle I guess this would need changing to table_name from
all_tables where like '$basename%' or something.
my @sources = $dbihydra->sources();
$basename comes from $self->config->{'basename'};
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::getcwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
bin/bp_genbank_ref_extractor view on Meta::CPAN
sub file_extension_for {
## TODO in some cases, extension changes whether it's protein or DNA or whatever
## and this should be supported
## XXX there must be a more elegant to handle the formats on this scripts
## to update this list, look in the _guess_format method, inside SeqIO.pm of bioperl
for ($_[0]) {
if (/embl/i) {return '.embl';}
elsif (/entrezgene/i) {return '.asn';}
elsif (/fasta/i) {return '.fasta';} # fasta|fast|fas|seq|fa|fsa|nt|aa|fna|faa
elsif (/fastq/i) {return '.fastq';}
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
if (-f $themakefile) {
my $grepres = `$^X -ne 'print if /^(X_\\w+LIBS|LIBS|XLIB)\\b/' $themakefile`; warn $grepres . "\n";
} else {
warn "$themakefile (file not found)\n".
"Can not find EMBOSS source to guess XLIB and LIBS\n".
"Use parameter EMB_SRC_ROOT to set EMBOSS source location\n\n";
}
}
$EMB_LIBS = join (" ", map { "-L$EMB_ROOT/$_" } @lib_search_dirs) . " " .
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm view on Meta::CPAN
} elsif ($stable_id =~ /.*P\d+(\.\d+)?$/) {
$id_type = "Translation";
} elsif ($stable_id =~ /.*E\d+(\.\d+)?$/) {
$id_type = "Exon";
# if guessing fails, look in db
} else {
my $sql = qq(
SELECT type from stable_id_event
WHERE old_stable_id = ?
OR new_stable_id = ?
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/FeatureIO.pm view on Meta::CPAN
my %param = @args;
@param{ map { lc $_ } keys %param } = values %param; # lowercase keys
my $format = $param{'-format'} ||
$class->_guess_format( $param{-file} || $ARGV[0] );
if( ! $format ) {
if ($param{-file}) {
$format = $class->_guess_format($param{-file});
} elsif ($param{-fh}) {
$format = $class->_guess_format(undef);
}
}
$format = "\L$format"; # normalize capitalization to lower case
return unless( $class->_load_format_module($format) );
return "Bio::FeatureIO::$format"->new(@args);
lib/Bio/FeatureIO.pm view on Meta::CPAN
sub _filehandle {
my ($self,@args) = @_;
return $self->_fh(@args);
}
=head2 _guess_format
Title : _guess_format
Usage : $obj->_guess_format($filename)
Function: guess format based on file suffix
Example :
Returns : guessed format of filename (lower case)
Args :
Notes : See "SUPPORTED FORMATS"
=cut
sub _guess_format {
my $class = shift;
return unless $_ = shift;
return 'gff' if /\.gff3?$/i;
return 'gff' if /\.gtf$/i;
return 'bed' if /\.bed$/i;
view all matches for this distribution