None available.
sub run
{
my $self = shift if (defined(caller(1)));
my $source_id = shift;
my $species_id = shift;
my $files_ref = shift;
my $rel_file = shift;
my $verbose = shift;
my $file_name = @{$files_ref}[0];
my $file_io = $self->get_filehandle($file_name);
if ( !defined $file_io ) {
return 1; }
my @xrefs;
while ( defined( my $line = $file_io->getline() ) ) {
chomp $line;
if ( substr( $line, 0, 1 ) eq '>' ) {
substr( $line, 0, 1, '' );
my ( $vega_id, $vega_alphabet ) =
( $line =~ /^(\S+)\s([^:]+):/ );
my %xref = (
'ACCESSION' => $vega_id,
'LABEL' => $vega_id,
'DESCRIPTION' => $line,
'SEQUENCE' => '',
'SOURCE_ID' => $source_id,
'SPECIES_ID' => $species_id,
'SEQUENCE_TYPE' =>
( $vega_alphabet eq 'pep' ? 'peptide' : 'dna' ),
'STATUS' => 'experimental'
);
push @xrefs,\% xref;
} else {
$xrefs[-1]->{'SEQUENCE'} .= $line;
}
}
$self->upload_xref_object_graphs(\@ xrefs );
print scalar(@xrefs) . " Vega Fasta Xrefs successfully parsed\n" if($verbose);
return 0; }
1; } |