XrefParser HPAParser
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Inherit
XrefParser::BaseParser
Synopsis
No synopsis!
Description
No description!
Methods
run
No description
Code
Methods description
None available.
Methods code
rundescriptionprevnextTop
sub run {
  my $self = shift if (defined(caller(1)));

  my $source_id = shift;
  my $species_id = shift;
  my $files       = shift;
  my $rel_url   = shift;
  my $verbose       = shift;

  my $filename = @{$files}[0];

    my $file_io = $self->get_filehandle($filename);
    if ( !defined($file_io) ) {
        return 1;
    }

    my $parsed_count = 0;

    $file_io->getline();
    
    while ( defined( my $line = $file_io->getline() ) ) {
 
	$line =~ s/\s*$//;
		

        my ( $antibody, $antibody_id, $ensembl_peptide_id, $link) = split( /,/, $line );

        if ( !defined($antibody) || !defined($ensembl_peptide_id) ) {
            printf( "Line %d contains  has less than two columns.\n",
                    1 + $parsed_count );
            print ("The parsing failed\n");
            return 1;
        }
	
        my $label       = $antibody;
	my $type        = 'translation';
        my $description = '';
        my $version     = '1';

        ++$parsed_count;

        my $xref_id = XrefParser::BaseParser->get_xref( $antibody_id, $source_id, $species_id );

        if ( !defined($xref_id) || $xref_id eq '' ) {
            $xref_id = XrefParser::BaseParser->add_xref($antibody_id, $version, $label, $description, $source_id, $species_id, "DIRECT");
        }
	
	
	XrefParser::BaseParser->add_direct_xref( $xref_id, $ensembl_peptide_id, $type, '');
	
    } ## end while ( defined( my $line...
printf( "%d direct xrefs succesfully parsed\n", $parsed_count ) if($verbose); $file_io->close(); return 0; } ## end sub run
1;
}
General documentation
No general documentation available.