[Bioperl-l] CommandExts and arrays
Mark A. Jensen
maj at fortinbras.us
Tue May 25 17:14:24 UTC 2010
Don't think you want 'no strict'; the error's saying something about syntax to
you.
In the snippet, I see a missing opening single quote for output_file.bam.
The asterisk means "expect an array ref", so that's ok.
----- Original Message -----
From: "Ben Bimber" <bbimber at gmail.com>
To: "bioperl-l" <bioperl-l at lists.open-bio.org>
Sent: Friday, May 21, 2010 9:58 AM
Subject: [Bioperl-l] CommandExts and arrays
>I am getting an error when trying to pass an array as a param with
> command exts. I hope there is something obvious i'm missing, but I
> cant seem to figure this out.
>
> I am trying to run the merge two BAM files using
> Bio::Tools::Run::Samtools using something like this:
>
> my $new_bam = Bio::Tools::Run::Samtools->new(
> -command => 'merge',
> -program_dir => '/usr/bin/samtools/',
> )->run(
> -obm => output_file.bam',
> -ibm => ['file1.bam', 'file2.bam'],
> );
>
> When i use an array for the -ibm param, I get an error saying 'cannot
> use string 'file1' as an arrayref while strict refs in place'. The
> error comes from this code in CommandExts.pm, around line 989. adding
> 'no strict' right before the final line stops the error:
>
> # expand arrayrefs
> my $l = $#files;
> for (0..$l) {
> if (ref($files[$_]) eq 'ARRAY') {
> splice(@files, $_, 1, @{$files[$_]});
> #error thrown from this line
> splice(@switches, $_, 1, ($switches[$_]) x @{$files[$_]});
> }
>
>
> Thanks for the help.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
More information about the Bioperl-l
mailing list