Skip to content

Commit

Permalink
Improve references file handling
Browse files Browse the repository at this point in the history
Authors are now stored in the "authors" pubprop rather than
"pubmed_authors", abstract now in "abstract" rather than "pubmed_abstract".
We do this so that the authors and abstract sources are clear in Chado.

Parsing is now slightly more strict and the ID can be "pb_ref_id" or
"ref_id".

Refs geneontology/go-site#1762
  • Loading branch information
kimrutherford committed Jan 14, 2022
1 parent 5ff18b3 commit 433c44a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/PomBase/Import/ReferencesFile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ sub _store {
$pub->pyear($year) if $year;
$pub->update();

$self->create_pubprop($pub, 'pubmed_authors', $authors) if $authors;
$self->create_pubprop($pub, 'pubmed_abstract', $abstract) if $abstract;
$self->create_pubprop($pub, 'authors', $authors) if $authors;
$self->create_pubprop($pub, 'abstract', $abstract) if $abstract;
}

sub load {
Expand All @@ -86,7 +86,9 @@ sub load {

chomp $_;

if (/pb_ref_id:\s*(.*)/) {
s/^\s+//;

if (/^(?:pb_)?ref_id:\s*(.*)/) {
if ($uniquename) {
$self->_store($uniquename, $title, $authors, $year, $abstract);
$uniquename = undef;
Expand All @@ -98,16 +100,16 @@ sub load {
$uniquename = $1;
}

if (/title:\s*(.*)/) {
if (/^title:\s*(.*)/) {
$title = $1;
}
if (/authors:\s*(.*)/) {
if (/^authors:\s*(.*)/) {
$authors = $1;
}
if (/year:\s*(.*)/) {
if (/^year:\s*(.*)/) {
$year = $1;
}
if (/abstract:\s*(.*)/) {
if (/^abstract:\s*(.*)/) {
$abstract = $1;
}
}
Expand Down

0 comments on commit 433c44a

Please sign in to comment.