Skip to content

Commit 0fc29ef

Browse files
committed
Add linked schemas for PMR and mGAP
1 parent 60b3291 commit 0fc29ef

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SELECT
2+
d.Id,
3+
d.date,
4+
d.gender,
5+
d.species,
6+
d.geographic_origin,
7+
d.birth,
8+
d.death,
9+
d.calculated_status,
10+
d.Id.parents.dam as dam,
11+
d.Id.parents.sire as sire
12+
13+
FROM study.demographics d
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<templateSchema sourceSchemaName="study" xmlns="http://labkey.org/data/xml/externalSchema" xmlns:cv="http://labkey.org/data/xml/queryCustomView">
2+
<tables>
3+
<tableName>exportedDemographics</tableName>
4+
</tables>
5+
<metadata>
6+
<tables xmlns="http://labkey.org/data/xml">
7+
<table tableName="exportedDemographics" tableDbType="NOT_IN_DB">
8+
<tableTitle>Demographics</tableTitle>
9+
</table>
10+
</tables>
11+
</metadata>
12+
</templateSchema>

mGAP/resources/queries/mGAP/subjectsSource.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ SELECT
1212
d.status as status,
1313
m.subjectname as originalId,
1414
p1.externalAlias as sire,
15-
coalesce(s.Id.parents.sire, d.sire) as originalSire,
15+
coalesce(s.sire, d.sire) as originalSire,
1616
p2.externalAlias as dam,
17-
coalesce(s.Id.parents.dam, d.dam) as originalDam,
17+
coalesce(s.dam, d.dam) as originalDam,
1818

1919
FROM mgap.animalMapping m
20-
LEFT JOIN "/Internal/PMR/".study.demographics s ON (m.subjectname = s.Id)
20+
LEFT JOIN PMR_Data.exportedDemographics s ON (m.subjectname = s.Id)
2121
LEFT JOIN mgap.demographics d ON (m.subjectname = d.subjectname)
22-
LEFT JOIN mgap.animalMapping p1 ON (p1.subjectname = coalesce(s.Id.parents.sire, d.sire))
23-
LEFT JOIN mgap.animalMapping p2 ON (p2.subjectname = coalesce(s.Id.parents.dam, d.dam))
22+
LEFT JOIN mgap.animalMapping p1 ON (p1.subjectname = coalesce(s.sire, d.sire))
23+
LEFT JOIN mgap.animalMapping p2 ON (p2.subjectname = coalesce(s.dam, d.dam))
2424
WHERE (s.Id IS NOT NULL OR d.subjectname IS NOT NULL)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<templateSchema sourceSchemaName="mGAP" xmlns="http://labkey.org/data/xml/externalSchema" xmlns:cv="http://labkey.org/data/xml/queryCustomView">
2+
<tables>
3+
<tableName>subjectsSource</tableName>
4+
<tableName>sequenceDatasetsSource</tableName>
5+
</tables>
6+
</templateSchema>

0 commit comments

Comments
 (0)