我正在解析一個大的EMBL文件(> 1G)並將其轉換爲gff文件。它有一些條目與傳統的embl格式不匹配,從而導致bioperl模塊拋出異常。我的問題是,因爲有錯誤的條目只是整個序列的一小部分,我想繼續使用該腳本,現在就忽略該異常。但是perl腳本總是被異常停止。Perl如何捕獲一次拋出兩個異常
我是一個Linux下的操作系統和與Perl版本5.8.8
我的Perl腳本
use strict;
use Bio::SeqIO;
use Bio::Tools::GFF;
use warnings;
use Try::Tiny;
open (E ,">","emblError.txt");
if (@ARGV != 1) { die "USAGE: embl2gff.pl > outputfile.\n"; }
my $in = Bio::SeqIO->new(-file=>$ARGV[0],-format=>'EMBL');
eval {
while (my $seq = $in->next_seq) {
for my $feat ($seq->top_SeqFeatures) {
my $gffio = Bio::Tools::GFF->new(-gff_version => 3);
print $feat->gff_string($gffio)."\n";
}
}
};
if ([email protected]) {
warn "Oh no! [[email protected]]\n";
}
我
Name "main::E" used only once: possible typo at embl2GFF3.pl line 7.
--------------------- WARNING ---------------------
MSG: exception while parsing location line [join(9174..9343,14214..14303)complement(9268..9363),complement(9140..9198),complement(8965..9034),complement(8751..8884),complement(8419..8535),complement(8232..8337),complement(7952..8149),complement(7256..7332),complement(7051..7175),complement(6769..6877),complement(6601..6659),complement(4690..6530))] in reading EMBL/GenBank/SwissProt, ignoring feature mRNA (seqid=XcouVSXmac70forkSpecies.Scaffold1050.final):
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Bad operator 1: had multiple locations 2, should be SplitLocationI
STACK: Error::throw
STACK: Bio::Root::Root::throw /usr/lib/perl5/site_perl/5.8.8/Bio/Root/Root.pm:472
STACK: Bio::Factory::FTLocationFactory::from_string /usr/lib/perl5/site_perl/5.8.8/Bio/Factory/FTLocationFactory.pm:210
STACK: Bio::Factory::FTLocationFactory::from_string /usr/lib/perl5/site_perl/5.8.8/Bio/Factory/FTLocationFactory.pm:204
STACK: Bio::SeqIO::FTHelper::_generic_seqfeature /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/FTHelper.pm:133
STACK: Bio::SeqIO::embl::next_seq /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/embl.pm:403
STACK: embl2GFF3.pl:14
-----------------------------------------------------------
---------------------------------------------------
--------------------- WARNING ---------------------
MSG: exception while parsing location line [join(14219..14303,14368..14513)complement(9140..9198),complement(8965..9034),complement(8751..8884),complement(8419..8535),complement(8232..8337),complement(7952..8149),complement(7256..7332),complement(7051..7175),complement(6769..6877),complement(6601..6659),complement(6461..6530))] in reading EMBL/GenBank/SwissProt, ignoring feature CDS (seqid=XcouVSXmac70forkSpecies.Scaffold1050.final):
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Bad operator 1: had multiple locations 2, should be SplitLocationI
STACK: Error::throw
STACK: Bio::Root::Root::throw /usr/lib/perl5/site_perl/5.8.8/Bio/Root/Root.pm:472
STACK: Bio::Factory::FTLocationFactory::from_string /usr/lib/perl5/site_perl/5.8.8/Bio/Factory/FTLocationFactory.pm:210
STACK: Bio::Factory::FTLocationFactory::from_string /usr/lib/perl5/site_perl/5.8.8/Bio/Factory/FTLocationFactory.pm:204
STACK: Bio::SeqIO::FTHelper::_generic_seqfeature /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/FTHelper.pm:133
STACK: Bio::SeqIO::embl::next_seq /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/embl.pm:403
STACK: embl2GFF3.pl:14
-----------------------------------------------------------
---------------------------------------------------
Oh no! [Can't call method "isa" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/Bio/Seq.pm line 1142, <GEN0> line 538764.
]
注意的錯誤:我沒有貼例外兩次,它只是以這種方式發生,只有一個例外似乎被捕獲。
這是embl文件的塊造成的問題。 mRNA條目導致第一個異常,CDS導致第二個異常。
FT mRNA join(9174..9343,14214..14303)
FT complement(9268..9363),complement(9140..9198),
FT complement(8965..9034),complement(8751..8884),
FT complement(8419..8535),complement(8232..8337),
FT complement(7952..8149),complement(7256..7332),
FT complement(7051..7175),complement(6769..6877),
FT complement(6601..6659),complement(4690..6530))
FT /gene="ENSXMAG00000014948"
FT /note="transcript_id=ENSXMAT00000015030"
FT CDS join(14219..14303,14368..14513)
FT complement(9140..9198),complement(8965..9034),
FT complement(8751..8884),complement(8419..8535),
FT complement(8232..8337),complement(7952..8149),
FT complement(7256..7332),complement(7051..7175),
FT complement(6769..6877),complement(6601..6659),
FT complement(6461..6530))
FT /gene="ENSXMAG00000014948"
FT /protein_id="ENSXMAP00000015010"
FT /note="transcript_id=ENSXMAT00000015030"
FT /db_xref="HGNC_transcript_name:ENO3-201"
您將需要向我們顯示代碼。 – kjprice
對不起,我碰到了錯誤的底部,腳本和excpetions列出 – user2241994