[Bioperl-l] Re: [Bioperl-guts-l] bioperl commit

Sally Li sallyli97 at yahoo.com
Sun Jun 8 20:18:56 EDT 2003


Hi, there,

Bioperl makes  us - the bioinformatics programmers,
more productive. But if there is a way to call perl
modules from java. The power of the bioperl will be
more explored. I wonder if any way that I can use to
call bioperl in java program?

Thank you in advance.

Sally
--- Donald Jackson <djackson at pub.open-bio.org> wrote:
> 
> djackson
> Sun Jun  8 21:14:13 EDT 2003
> Update of
> /home/repository/bioperl/bioperl-run/Bio/Tools/Run
> In directory pub.open-bio.org:/tmp/cvs-serv23101
> 
> Modified Files:
> 	Mdust.pm 
> Log Message:
> Modified to inherit Bio::Tools::Run::WrapperBase,
> use Bio::Root::IO to build up paths
> 
> bioperl-run/Bio/Tools/Run Mdust.pm,1.3,1.4
>
===================================================================
> RCS file:
>
/home/repository/bioperl/bioperl-run/Bio/Tools/Run/Mdust.pm,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> ---
>
/home/repository/bioperl/bioperl-run/Bio/Tools/Run/Mdust.pm
> 2003/06/04 01:36:10	1.3
> +++
>
/home/repository/bioperl/bioperl-run/Bio/Tools/Run/Mdust.pm
> 2003/06/09 01:14:13	1.4
> @@ -87,16 +87,15 @@
>  use Bio::SeqIO;
>  use Bio::SeqFeature::Generic;
>  use Bio::Root::Root;
> +use Bio::Root::IO;
> +use Bio::Tools::Run::WrapperBase;
>  
>  use vars qw($AUTOLOAD);
>  
> -our @ISA = qw(Bio::Root::Root);
> +our @ISA = qw(Bio::Root::Root
> Bio::Tools::Run::WrapperBase);
>  
>  our $VERSION = '0.01';
>  
> -our $MDUST_EXE = $ENV{'MDUSTDIR'} . '/mdust'; #
> path to mdust executable
> -our $TMPDIR = '.'; 
> -
>  our @ARGNAMES = qw(TARGET WSIZE CUTOFF MASKCHAR
> COORDS TMPDIR DEBUG);
>  
>  
> @@ -137,7 +136,7 @@
>      $self->{'cutoff'} = $args{'CUTOFF'} || 28;
>      $self->{'maskchar'} = $args{'MASKCHAR'} || 'N';
>      $self->{'coords'} = $args{'COORDS'} || 0;
> -    $self->{'tmpdir'} = $args{'TMPDIR'} ||
> $ENV{'TMPDIR'} || $ENV{'TMP'} || '';
> +    $self->{'tmpdir'} = $args{'TMPDIR'} ||
> $ENV{'TMPDIR'} || $ENV{'TMP'} || '.';
>      # set debugging
>      $self->{'debug'} = $args{'DEBUG'} || 0;
>  
> @@ -164,20 +163,38 @@
>      return $self->_run_mdust;
>  }
>  
> +sub program_dir {
> +        return
> Bio::Root::IO->catfile($ENV{MDUSTDIR}) if
> $ENV{MDUSTDIR};
> +}
> +
> +
> +sub program_name {
> +    return 'mdust';
> +}
> +    
> +sub tmpdir {
> +    my ($self, $tmpdir) = @_;
> +
> +    if ($tmpdir) {
> +	$self->{'tmpdir'} = $tmpdir;
> +    }
> +    else {
> +	return $self->{'tmpdir'};
> +    }
> +}
> +
>  sub _run_mdust {
>      # open a pipe to the mdust command.  Pass in
> sequence(s?) as fasta 
>      # files on STDIN, recover filtered seqs on
> STDOUT
>      my ($self) = @_;
> -
> +    
>      my $target = $self->target or warn "No target
> sequence specified\n" && return undef;
>  
>      # make sure program is available 
> -    unless (-e $MDUST_EXE) {
> -	$self->throw( "Unable to find mdust executable
> (path: $MDUST_EXE).  Did you set the environment
> variable MDUSTDIR?");
> -    } 
> +    my $executable = $self->executable('mdust', 1);
>  
>      # add options
> -    my $mdust_cmd = $MDUST_EXE;
> +    my $mdust_cmd = $executable;
>      $mdust_cmd .= " -w " . $self->wsize;
>      $mdust_cmd .= " -v " . $self->cutoff;
>      $mdust_cmd .= " -m " . $self->maskchar;
> @@ -252,14 +269,14 @@
>  
>  sub _maskedfile {
>      my ($self, $file) = @_;
> -    my $tmpdir = $self->tmpdir || $TMPDIR;
> +    my $tmpdir = $self->tmpdir;
>  
>      if ($file) {
>  	$self->{'maskedfile'} = $file;
>  	# add some sanity chex for writability?
>      }
>      elsif (!$self->{'maskedfile'}) {
> -	$self->{'maskedfile'} = $tmpdir . '/' .
> int(rand(1000000)) . '.tfa';
> +	$self->{'maskedfile'} =
> Bio::Root::IO->catfile($tmpdir, int(rand(1000000)) .
> '.tfa');
>      }
>      return $self->{'maskedfile'};
>  
> 
> _______________________________________________
> Bioperl-guts-l mailing list
> Bioperl-guts-l at portal.open-bio.org
>
http://portal.open-bio.org/mailman/listinfo/bioperl-guts-l


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com


More information about the Bioperl-l mailing list