Skip to content

Commit

Permalink
Add original location to the variant/marker search fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
laceysanderson committed Apr 1, 2020
1 parent 999271b commit f58679a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion includes/GeneticMarkerSearch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class GeneticMarkerSearch extends KPSEARCH {
'type' => [
'title' => 'Marker Type',
],
'original_loc' => [
'title' => 'Original Location',
],
'species' => [
'title' => 'Source Species',
'entity_link' => [
Expand Down Expand Up @@ -240,9 +243,15 @@ class GeneticMarkerSearch extends KPSEARCH {
// @debug dpm($filter_results, '$filter_results');

$query = "
SELECT marker.feature_id, marker.name as name, type.value as type, o.organism_id, o.genus||' '||o.species as species
SELECT
marker.feature_id, marker.name as name,
type.value as type,
olocparent.name||':'||original_loc.fmin||'..'||original_loc.fmax as original_loc,
o.organism_id, o.genus||' '||o.species as species
FROM {feature} marker
LEFT JOIN {organism} o ON o.organism_id=marker.organism_id
LEFT JOIN {featureloc} original_loc ON original_loc.feature_id = marker.feature_id AND original_loc.locgroup=0
LEFT JOIN {feature} olocparent ON olocparent.feature_id=original_loc.srcfeature_id
LEFT JOIN {featureprop} type ON type.feature_id = marker.feature_id
AND type.type_id IN
(SELECT cvterm_id FROM chado.cvterm WHERE name='additionalType') ";
Expand Down
11 changes: 10 additions & 1 deletion includes/SequenceVariantSearch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class SequenceVariantSearch extends KPSEARCH {
'type' => [
'title' => 'Variant Type',
],
'original_loc' => [
'title' => 'Original Location',
],
'species' => [
'title' => 'Source Species',
'entity_link' => [
Expand Down Expand Up @@ -240,9 +243,15 @@ class SequenceVariantSearch extends KPSEARCH {
// @debug dpm($filter_results, '$filter_results');

$query = "
SELECT variant.feature_id, variant.name as name, type.value as type, o.organism_id, o.genus||' '||o.species as species
SELECT
variant.feature_id, variant.name as name,
type.value as type,
olocparent.name||':'||original_loc.fmin||'..'||original_loc.fmax as original_loc,
o.organism_id, o.genus||' '||o.species as species
FROM {feature} variant
LEFT JOIN {organism} o ON o.organism_id=variant.organism_id
LEFT JOIN {featureloc} original_loc ON original_loc.feature_id = variant.feature_id AND original_loc.locgroup=0
LEFT JOIN {feature} olocparent ON olocparent.feature_id=original_loc.srcfeature_id
LEFT JOIN {featureprop} type ON type.feature_id = variant.feature_id
AND type.type_id IN
(SELECT cvterm_id FROM chado.cvterm WHERE name='additionalType') ";
Expand Down

0 comments on commit f58679a

Please sign in to comment.