ensembl-hive  2.7.0
Bio::EnsEMBL::Utils::ScriptUtils Class Reference

Public Member Functions

public Boolean user_proceed ()
 
public List sort_chromosomes ()
 
protected Values _by_chr_num ()
 
public A commify ()
 
public parse_bytes ()
 
public directory_hash ()
 
public path_append ()
 
public Boolean inject ()
 
public dynamic_use ()
 

Detailed Description

Synopsis

Description

 

Definition at line 11 of file ScriptUtils.pm.

Member Function Documentation

◆ _by_chr_num()

protected Values Bio::EnsEMBL::Utils::ScriptUtils::_by_chr_num ( )
  Example     :
my @sorted = sort _by_chr_num qw(X, 6-COX, 14, 7);
  Description : Subroutine to use in sort for sorting chromosomes. Sorts
                numerically, then alphabetically
  Return type : values to be used by sort
  Exceptions  : none
  Caller      : internal ($self->sort_chromosomes)
 
Code:
click to view

◆ commify()

public A Bio::EnsEMBL::Utils::ScriptUtils::commify ( )
  Arg[1]      : Int $num - a number to commify
  Example     :
print "An easy to read number: ".$self->commify(100000000);
@section autotoc_md38 will print 100,000,000
  Description : put commas into a number to make it easier to read
  Return type : a string representing the commified number
  Exceptions  : none
  Caller      : general
  Status      : stable
 
Code:
click to view

◆ directory_hash()

public Bio::EnsEMBL::Utils::ScriptUtils::directory_hash ( )

Undocumented method

Code:
click to view

◆ dynamic_use()

public Bio::EnsEMBL::Utils::ScriptUtils::dynamic_use ( )

Undocumented method

Code:
click to view

◆ inject()

public Boolean Bio::EnsEMBL::Utils::ScriptUtils::inject ( )
  Arg [1]    : String $classname - The name of the class to require/import
  Example    :
$self->inject('Bio::EnsEMBL::DBSQL::DBAdaptor');
  Description: Requires and imports the methods for the classname provided,
               checks the symbol table so that it doesnot re-require modules
               that have already been required.
  Returntype : true on success
  Exceptions : Warns to standard error if module fails to compile
  Caller     : internal
 
Code:
click to view

◆ parse_bytes()

public Bio::EnsEMBL::Utils::ScriptUtils::parse_bytes ( )

Undocumented method

Code:
click to view

◆ path_append()

public Bio::EnsEMBL::Utils::ScriptUtils::path_append ( )

Undocumented method

Code:
click to view

◆ sort_chromosomes()

public List Bio::EnsEMBL::Utils::ScriptUtils::sort_chromosomes ( )
  Arg[1]      : (optional) Hashref $chr_hashref - Hashref with chr_name as keys
  Example     :
my $chr = { '6-COX' => 1, '1' => 1, 'X' => 1 };
my @sorted = $support->sort_chromosomes($chr);
  Description : Sorts chromosomes in an intuitive way (numerically, then
                alphabetically). If no chromosome hashref is passed, it's
                retrieve by calling $self->get_chrlength()
  Return type : List - sorted chromosome names
  Exceptions  : thrown if no hashref is provided
  Caller      : general
 
Code:
click to view

◆ user_proceed()

public Boolean Bio::EnsEMBL::Utils::ScriptUtils::user_proceed ( )
  Arg[1]      : (optional) String $text - notification text to present to user
  Example     :
# run a code snipped conditionally
if ($support->user_proceed("Run the next code snipped?")) {
@section autotoc_md36 run some code
}
@section autotoc_md37 exit if requested by user
exit unless ($support->user_proceed("Want to continue?"));
  Description : If running interactively, the user is asked if he wants to
                perform a script action. If he doesn't, this section is skipped
                and the script proceeds with the code. When running
                non-interactively, the section is run by default.
  Return type : TRUE to proceed, FALSE to skip.
  Exceptions  : none
  Caller      : general
 
Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Utils::ScriptUtils::path_append
public path_append()
Bio::EnsEMBL::Utils::ScriptUtils::parse_bytes
public parse_bytes()
Bio::EnsEMBL::Utils::ScriptUtils::dynamic_use
public dynamic_use()
Bio::EnsEMBL::Utils::ScriptUtils::user_proceed
public Boolean user_proceed()
Bio::EnsEMBL::Utils::ScriptUtils::_by_chr_num
protected Values _by_chr_num()
Bio::EnsEMBL::Utils::ScriptUtils::directory_hash
public directory_hash()
Bio::EnsEMBL::Utils::ScriptUtils::inject
public Boolean inject()
run
public run()
Bio::EnsEMBL::Utils::ScriptUtils::sort_chromosomes
public List sort_chromosomes()
Bio::EnsEMBL::Utils::ScriptUtils::commify
public A commify()