From c49c4dd84d2824921cf9589a259d4d86701fe78e Mon Sep 17 00:00:00 2001 From: Jiu9Shen Date: Thu, 19 Mar 2020 16:37:50 -0600 Subject: [PATCH 1/3] make infraspecific names null when not exist --- includes/TripalImporter/GermplasmAccessionImporter.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/TripalImporter/GermplasmAccessionImporter.inc b/includes/TripalImporter/GermplasmAccessionImporter.inc index f0234c4..6218ee7 100644 --- a/includes/TripalImporter/GermplasmAccessionImporter.inc +++ b/includes/TripalImporter/GermplasmAccessionImporter.inc @@ -350,6 +350,9 @@ if ($one_accession['subtaxa']){ $match['infraspecific_name'] = $one_accession['subtaxa']; } + else { + $match['infraspecific_name'] = NULL; + } $results = chado_select_record('organism', ['organism_id'], $match); if (count($results) > 1){ $this->logMessage('ERROR: The genus, !genus, species, !species, has more than one matched organism in chado.organism.',['!genus' => $genus, '!species' => $one_accession['germplasm_species']], TRIPAL_WARNING); From d3daf50fe1188d75122285b4ff0004a32256a2c8 Mon Sep 17 00:00:00 2001 From: Jiu9Shen Date: Thu, 19 Mar 2020 20:06:41 -0600 Subject: [PATCH 2/3] include infraspecific name in germplasm select warning message. --- includes/TripalImporter/GermplasmAccessionImporter.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/TripalImporter/GermplasmAccessionImporter.inc b/includes/TripalImporter/GermplasmAccessionImporter.inc index 6218ee7..fb2c19f 100644 --- a/includes/TripalImporter/GermplasmAccessionImporter.inc +++ b/includes/TripalImporter/GermplasmAccessionImporter.inc @@ -347,7 +347,7 @@ 'genus' => $genus, 'species' => $one_accession['germplasm_species'] ); - if ($one_accession['subtaxa']){ + if (!empty($one_accession['subtaxa'])){ $match['infraspecific_name'] = $one_accession['subtaxa']; } else { @@ -355,7 +355,7 @@ } $results = chado_select_record('organism', ['organism_id'], $match); if (count($results) > 1){ - $this->logMessage('ERROR: The genus, !genus, species, !species, has more than one matched organism in chado.organism.',['!genus' => $genus, '!species' => $one_accession['germplasm_species']], TRIPAL_WARNING); + $this->logMessage('ERROR: The genus, !genus, species, !species, infraspecific, !infraspecific, has more than one matched organism in chado.organism.',['!genus' => $genus, '!species' => $one_accession['germplasm_species'], '!infraspecific' => $one_accession['subtaxa']], TRIPAL_WARNING); break; } elseif (count($results) == 1){ @@ -363,7 +363,7 @@ $organism_id = $results[0]->organism_id; } else{ - $this->logMessage('ERROR: The genus, !genus, species, !species, has no matched organism in chado.organism.',['!genus' => $genus, '!species' => $one_accession['germplasm_species']], TRIPAL_WARNING); + $this->logMessage('ERROR: The genus, !genus, species, !species, infraspecific, !infraspecific, has no matched organism in chado.organism.',['!genus' => $genus, '!species' => $one_accession['germplasm_species'], '!infraspecific' => $one_accession['subtaxa']], TRIPAL_WARNING); break; } From 47eb12ccd7ad35e0a17ec7195cd99d03df9fd932 Mon Sep 17 00:00:00 2001 From: Jiu9Shen Date: Fri, 20 Mar 2020 11:07:55 -0600 Subject: [PATCH 3/3] include infraspecific name in cross importer organism list. --- includes/TripalImporter/GermplasmCrossImporter.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/TripalImporter/GermplasmCrossImporter.inc b/includes/TripalImporter/GermplasmCrossImporter.inc index fb02b70..c78f312 100644 --- a/includes/TripalImporter/GermplasmCrossImporter.inc +++ b/includes/TripalImporter/GermplasmCrossImporter.inc @@ -74,7 +74,12 @@ $organisms = array(); $organisms[''] = ''; while ($organism = $org_rset->fetchObject()) { - $organisms[$organism->organism_id] = "$organism->genus $organism->species ($organism->common_name)"; + if ($organism->infraspecific_name){ + $organisms[$organism->organism_id] = "$organism->genus $organism->species $organism->infraspecific_name ($organism->common_name)"; + } + else{ + $organisms[$organism->organism_id] = "$organism->genus $organism->species ($organism->common_name)"; + } } $form['instructions'] = [