Skip to content

Commit

Permalink
Handle PHAF files with severity and cond. changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Feb 28, 2023
1 parent f506aed commit 32db3d3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/PomBase/Import/PhenotypeAnnotation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ sub _store_annotation {
my @conditions = split /\s*,\s*/, $conditions;
for (my $i = 0; $i < @conditions; $i++) {
my $condition = $conditions[$i];

if ($condition =~ /^(\w+:\d+)(?:\((.*)\))/) {
my $condition_termid = $1;
my $condition_detail = $2;

$condition = $condition_termid;
}

$self->add_feature_cvtermprop($feature_cvterm, 'condition', $condition, $i);
}

Expand Down Expand Up @@ -204,9 +212,8 @@ sub load {
parental_strain strain_background genotype_description
gene_name allele_name allele_synonym allele_type
evidence conditions penetrance severity extension
reference taxon date ploidy
temperature chemical_or_agent chemical_or_agent_dose
phenotype_score phenotype_score_units illegal_extra_column));
reference taxon date ploidy allele_variant
illegal_extra_column));


while (my $columns_ref = $csv->getline_hr($fh)) {
Expand Down Expand Up @@ -322,6 +329,8 @@ sub load {
}
}

$severity =~ s/^\w+\([^\)]+\)$//;

if (length $severity > 0) {
my $severity_cvterm = $self->find_cvterm_by_term_id($severity);

Expand Down

0 comments on commit 32db3d3

Please sign in to comment.