Skip to content

Commit

Permalink
Store annotation_file_curator for modifications
Browse files Browse the repository at this point in the history
Refs #1013
  • Loading branch information
kimrutherford committed Oct 25, 2023
1 parent a4d8426 commit ee9ab3b
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions lib/PomBase/Import/Modification.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ with 'PomBase::Role::XrefStorer';
with 'PomBase::Role::CvtermCreator';
with 'PomBase::Role::FeatureCvtermCreator';

with 'PomBase::Importer';

has verbose => (is => 'ro');
has options => (is => 'ro', isa => 'ArrayRef');
has organism_taxonid => (is => 'rw', init_arg => undef);
Expand All @@ -85,24 +87,31 @@ sub load {
my $self = shift;
my $fh = shift;

my $file_name = $self->file_name_of_fh($fh);

my $chado = $self->chado();

my $tsv = Text::CSV->new({ sep_char => "\t" });

while (my $columns_ref = $tsv->getline($fh)) {
my ($systematic_id, $gene_name, $psi_mod_term_id, $evidence_code, $residue, $extension, $pubmedid, $taxonid, $date) =
my ($first_value, $gene_name, $psi_mod_term_id, $evidence_code, $residue, $extension, $pubmedid, $taxonid, $date) =
map { trim($_) || undef } @$columns_ref;

if ($systematic_id =~ /^#/) {


if ($first_value =~ /^#/) {
$self->parse_submitter_line($first_value);
# skip comments
next;
}

if ($systematic_id =~ /^#?(systematic|Gene systematic)/i) {
if ($first_value =~ /^#?(systematic|Gene systematic)/i) {
# skip header
next;
}

my $systematic_id = $first_value;

if (!defined $systematic_id) {
die qq(mandatory column value for systematic ID missing at line $.\n);
}
Expand Down Expand Up @@ -154,6 +163,8 @@ sub load {
}
my $pub = $self->find_or_create_pub($pubmedid);

$self->record_pub_object($pubmedid, $pub);

my $feature_cvterm =
$self->create_feature_cvterm($feature, $mod_cvterm, $pub, 0);

Expand Down Expand Up @@ -181,6 +192,12 @@ sub load {
warn "failed to load line $.:\n$_";
}
}

$self->increment_ref_annotation_count($pubmedid);
}

if (defined $file_name) {
$self->store_annotation_file_curator($file_name, 'qualitative_gene_expression');
}
}

Expand Down

0 comments on commit ee9ab3b

Please sign in to comment.