[Bioperl-l] Bio: :SeqIO::excel

Fields, Christopher J cjfields at illinois.edu
Fri Jan 6 12:14:19 EST 2012


Generally I would say that with any BioPerl module it's a good idea to start with the test suite, but unfortunately Bio::SeqIO::excel doesn't seem to have any test coverage.  That'll have to be rectified...

The 'replacement list' warning is harmless and is fixed in the latest BioPerl on CPAN.  As for using Excel directly, an easy workaround is one could just as easily save this as tab- or comma-delimited format (which Excel can export) and then use something like perl's builtin split() function to create the sequence objects on the fly.  If you are worried about CSV conversion issues, Text::CSV is a very good module and has an XS-based counterpart that is very fast (all well-documented).  

On the BioPerl end, creation of Bio::Seq is covered in the BioPerl HOWTOs.

chris
________________________________________
From: bioperl-l-bounces at lists.open-bio.org [bioperl-l-bounces at lists.open-bio.org] on behalf of Xu, Lizhe - APHIS [Lizhe.Xu at aphis.usda.gov]
Sent: Friday, January 06, 2012 10:42 AM
To: bioperl-l at bioperl.org
Subject: [Bioperl-l] Bio: :SeqIO::excel

Thanks Kevin, I installed the package Spreadsheet::ParseExcel but got new error by running the script.



BioPerl 1.6.1 on XP



Script:

#!C:\Perl\bin -w

use Bio::Seq;

use Bio::SeqIO;



$file="PTV1Primers.xls";



$seqio_obj = Bio::SeqIO->new(-file => $file, -format => 'excel' );





while ($seq_obj = $seqio_obj->next_seq){



    print $seq_obj->seq,"\n";



}

......

Error message:
=========================================================
Replacement list is longer than search list at C:/Perl/site/lib/Bio/Range.pm line 251.
UNIVERSAL->import is deprecated and will be removed in a future perl at C:/Perl/site/lib/Bio/Tree/TreeFunctionsI.pm line 94

Use of uninitialized value $slot in string eq at C:/Perl/site/lib/Bio/Seq/SeqBuilder.pm line 278.
Use of uninitialized value $slot in substr at C:/Perl/site/lib/Bio/Seq/SeqBuilder.pm line 283.
Use of uninitialized value $slot in concatenation (.) or string at C:/Perl/site/lib/Bio/Seq/SeqBuilder.pm line 283.
Use of uninitialized value in print at ReadExcel.pl line 15.
==========================================================

The first two row only displayed when I run the script under Perl v5.12.2. The rest showed on both Perl v5.12.2 and v5.8.8 (different machines) and repeated many times, I guess as many as the row numbers in Excel file.

Please help me to fix the problem or point me a better way to read an excel file with two columns: one for name and one for sequence. Thank you very much.



Lizhe

_______________________________________________
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