None available.
sub run
{ my $self = shift if (defined(caller(1)));
my $source_id = shift;
my $species_id = shift;
my $files = shift;
my $release_file = shift;
my $verbose = shift;
my $file = @{$files}[0];
open (INFILE, "<$file");
my $i=0; my $type = "transcript";
while (my $ln = <INFILE>) {
chomp($ln); $i++;
my ($seqid, $source, $type, $start, $end, $score, $strand, $phase, $attributes) = split("\t",$ln);
if ($strand eq ".") {$strand = 0;}
elsif ($strand eq "?") {$strand = 0;} my %attributes;
unless ($attributes eq ".") {
my @attributes = split(";",$attributes);
foreach my $pair ( @attributes ){
my ($key, $value) = split("=",$pair);
if ($value =~ m/,/i ) { my @values = split(",",$value); foreach my $splitval (@values) {
$splitval =~ s/%59/;/;
$splitval =~ s/%44/,/;
$splitval =~ s/%61/=/;
push (@{$attributes{uc($key)}},$splitval);
}
}
else {
$value =~ s/%59/;/;
$value =~ s/%44/,/;
$value =~ s/%61/=/;
push(@{$attributes{uc($key)}},$value);
}
}
}
if (($seqid eq ".") || ($start eq ".") || ($end eq ".")) {
}
else {
foreach my $name (@{$attributes{"NAME"}}) {
my %xref = ( 'accession' => $name,
'chromosome' => $seqid,
'strand' => $strand,
'txStart' => $start,
'txEnd' => $end,
'cdsStart' => $start,
'cdsEnd' => $end,
'exonStarts' => $start,
'exonEnds' => $end );
print STDERR "$name, $start, $end\n" if($verbose);
$self->add_xref( $source_id, $species_id,\% xref );
}
}
}
print STDERR $i." VB GFF3 xrefs succesfully parsed\n" if($verbose);
close(INFILE);
return 0;
}
1; } |