Skip to content

Commit 084f20f

Browse files
committed
Misc small improvements to MCC
1 parent d788191 commit 084f20f

File tree

14 files changed

+123
-37
lines changed

14 files changed

+123
-37
lines changed

mcc/resources/etls/mcc.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<column>date</column>
8787
<column>datatype</column>
8888
<column>sra_accession</column>
89+
<column>total_reads</column>
8990
<column>objectid</column>
9091
</sourceColumns>
9192
</source>

mcc/resources/etls/snprc-datasets.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
<transform id="observations1" type="RemoteQueryTransformStep">
156156
<description>Copy to target</description>
157157
<source remoteSource="SNPRC" schemaName="study" queryName="u24MarmosetStats">
158-
<!-- NOTE: the column orde must be preserved and match expected order in NprcObservationStep -->
158+
<!-- NOTE: the column order must be preserved and match expected order in NprcObservationStep -->
159159
<sourceColumns>
160160
<column>AnimalId</column>
161161
<column>Date</column>

mcc/resources/folderTypes/MCC NIH Dashboard.folderType.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@
7474
</webPart>
7575
</preferredWebParts>
7676
</folderTab>
77+
<folderTab>
78+
<name>geneticsDashboard</name>
79+
<caption>Genetics</caption>
80+
<selectors>
81+
<selector>
82+
<view>genetics</view>
83+
</selector>
84+
</selectors>
85+
<preferredWebParts>
86+
<webPart>
87+
<name>geneticsPlotWebpart</name>
88+
<location>body</location>
89+
</webPart>
90+
</preferredWebParts>
91+
</folderTab>
7792
<folderTab>
7893
<name>requests</name>
7994
<caption>MCC Requests</caption>

mcc/resources/queries/mcc/genomicDatasetsSource.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ SELECT
33
r.subjectid as Id,
44
r.created as date,
55
r.application as datatype,
6-
r.sraRuns as sra_accession
6+
r.sraRuns as sra_accession,
7+
r.totalForwardReads as total_reads
78

89
FROM sequenceanalysis.sequence_readsets r
910

mcc/resources/queries/study/genomicDatasets/.qview.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<column name="date" />
55
<column name="datatype" />
66
<column name="sra_accession" />
7+
<column name="total_reads" />
78
<column name="history" />
89
</columns>
910
<sorts>

mcc/resources/referenceStudy/study/datasets/datasets_metadata.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@
10731073
<column columnName="sra_accession">
10741074
<datatype>varchar</datatype>
10751075
</column>
1076+
<column columnName="total_reads">
1077+
<datatype>integer</datatype>
1078+
</column>
10761079
<column columnName="objectid">
10771080
<datatype>entityid</datatype>
10781081
<propertyURI>urn:ehr.labkey.org/#ObjectId</propertyURI>

mcc/resources/views/mccU24Demographics.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
title: 'MCC Animals',
1313
schemaName: 'study',
1414
queryName: 'demographics',
15-
viewName: LABKEY.ActionURL.getParameter('viewName') ?? 'U24 Assigned'
15+
viewName: LABKEY.ActionURL.getParameter('viewName'),
16+
removeableFilters: [
17+
LABKEY.Filter.create('u24_status', true, LABKEY.Filter.Types.EQUALS)
18+
]
1619
}).render(webpart.wrapperDivId);
1720
});
1821

mcc/src/client/Dashboard/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ export function Dashboard() {
8888
</div>
8989
<div className="col-md-4">
9090
<div className="panel panel-default">
91-
<div className="panel-heading">Center (All Animals)</div>
91+
<div className="panel-heading">Center (Living Animals)</div>
9292
<div className="panel-body">
93-
<PieChart fieldName = "colony" demographics={demographics} cutout = "30%" />
93+
<PieChart fieldName = "colony" demographics={living} cutout = "30%" />
9494
</div>
9595
</div>
9696
</div>

mcc/src/client/GeneticsPlot/GeneticsPlot.tsx

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ import ScatterChart from './ScatterChart';
55
import { Box, Tab, Tabs } from '@mui/material';
66
import KinshipTable from './KinshipTable';
77
import { ErrorBoundary } from '../components/ErrorBoundary';
8+
import SequenceDataTable from './SequenceDataTable';
89

910

10-
function GenomeBrowser(props: {jbrowseId: any}) {
11-
const { jbrowseId } = props;
12-
13-
return (
14-
<div>
15-
<a href={ActionURL.buildURL('jbrowse', 'jbrowse', null, {session: jbrowseId})}>Click here to view Marmoset SNP data in the genome browser</a>
16-
</div>
17-
);
18-
}
19-
2011
export function GeneticsPlot() {
2112
const [pcaData, setPcaData] = useState([]);
2213
const [kinshipData, setKinshipData] = useState([]);
14+
const [sequenceData, setSequenceData] = useState([]);
2315
const [jbrowseId, setJBrowseId] = useState(null);
2416
const [value, setValue] = React.useState(0);
2517

@@ -83,6 +75,29 @@ export function GeneticsPlot() {
8375
},
8476
scope: this
8577
});
78+
79+
Query.selectRows({
80+
containerPath: containerPath,
81+
schemaName: 'study',
82+
queryName: 'genomicDatasets',
83+
columns: 'Id,datatype,sra_accession,total_reads,objectid',
84+
success: function(results) {
85+
setSequenceData(results.rows.map((row) => {
86+
return({
87+
id: row.objectid,
88+
Id: row.Id,
89+
datatype: row.datatype,
90+
sra_accession: row.sra_accession,
91+
total_reads: row.total_reads
92+
})
93+
}))
94+
},
95+
failure: function(response) {
96+
alert('There was an error loading data');
97+
console.log(response);
98+
},
99+
scope: this
100+
});
86101
}, [] /* only run the effect on mount */);
87102

88103
if (!containerPath) {
@@ -113,35 +128,19 @@ export function GeneticsPlot() {
113128
578 marmosets on NCBI's Sequence Read Archive (SRA), we are excited to report that the MCC portal now
114129
houses a call set with single nucleotide variants and short indels for over 800 individuals.
115130
<p/>
116-
The MCC genomic database is extensive, with each individual being genotype at millions of variants
117-
across the genome. One way to summarize a large dataset can be done using Principal Component Analysis
118-
(PCA). PCA is a technique used across disciplines (from astronomy to genomics) that reduces the
119-
information in a multi-dimensional dataset to (fewer) principal components (PC) that retain overall
120-
trends and patterns in the original data. Biologically, this could mean merging together two variants
121-
that are always inherited together into just one PC, making the data easier to analyze while maintaining
122-
its most important patterns. See the **Visualization with PCA** tab below.
123-
<p/>
124-
Although PCA is useful for broad-scale comparisons, it is not very useful when trying to distinguish
125-
whether two individuals are siblings or first-cousins, for instance. For that, we have better statistics
126-
that can describe the genetic relatedness between two individuals. We estimated genetic relatedness for
127-
all pairs of individuals for which we have whole-genome data, and made these available under the
128-
**Kinship** tab. There you will find the inferred relationships between pairs of individuals as well as
129-
the calculated kinship coefficient, which is a quantitative measure of genetic relatedness
130-
(see <a href="https://en.wikipedia.org/wiki/Coefficient_of_relationship#Kinship_coefficient">here</a> for more details).
131-
<p/>
132-
It is possible to explore the full MCC database of variants with a graphical interface by accessing the
133-
**Genome Browser** tab. There you can, for example, visualize all the variants present in your gene of
134-
interest by typing it's name in the search bar.
131+
In addition to the information in the tabs below, you can use the MCC genome browser to view know variants and search by gene.
132+
<a href={ActionURL.buildURL('jbrowse', 'jbrowse', null, {session: jbrowseId})}>Click here to view Marmoset SNP data in the genome browser</a>
135133
<p/>
136134
The genetic analyses described here were performed by Karina Ray (ONPRC), Murillo Rodrigues (ONPRC), and
137135
Ric del Rosario (Broad Institute). Please contact us at <a href="mailto:mcc@ohsu.edu">mcc@ohsu.edu</a> with any
138136
questions.
139137
</div>
138+
140139
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
141140
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
142141
<Tab label="Population Genetic Diversity" {...a11yProps(0)} />
143142
<Tab label="Kinship" {...a11yProps(1)} />
144-
<Tab label="Genetic Variants" {...a11yProps(2)} hidden={jbrowseId == null}/>
143+
<Tab label="Sequence Datasets" {...a11yProps(2)}/>
145144
</Tabs>
146145
</Box>
147146
<div className="row">
@@ -150,7 +149,7 @@ export function GeneticsPlot() {
150149
<div className="panel-body">
151150
{value === 0 && <ScatterChart data={pcaData}/>}
152151
{value === 1 && <KinshipTable data={kinshipData}/>}
153-
{value === 2 && <GenomeBrowser jbrowseId={jbrowseId}/>}
152+
{value === 2 && <SequenceDataTable data={sequenceData}/>}
154153
</div>
155154
</div>
156155
</div>

mcc/src/client/GeneticsPlot/KinshipTable.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ export default function KinshipTable(props: {data: any}) {
1313
]
1414

1515
return (
16+
<>
17+
<div style={{paddingBottom: 20, maxWidth: 1000}}>
18+
Although PCA is useful for broad-scale comparisons, it is not very useful when trying to distinguish
19+
whether two individuals are siblings or first-cousins, for instance. For that, we have better statistics
20+
that can describe the genetic relatedness between two individuals. We estimated genetic relatedness for
21+
all pairs of individuals for which we have whole-genome data, shown in the table below. There you will
22+
find the inferred relationships between pairs of individuals as well as the calculated kinship coefficient,
23+
which is a quantitative measure of genetic relatedness
24+
(see <a href="https://en.wikipedia.org/wiki/Coefficient_of_relationship#Kinship_coefficient">here</a> for more details).
25+
</div>
1626
<DataGrid
1727
autoHeight={true}
1828
columns={columns}
@@ -24,5 +34,6 @@ export default function KinshipTable(props: {data: any}) {
2434
paginationModel={pageModel}
2535
onPaginationModelChange={(model) => setPageModel(model)}
2636
/>
37+
</>
2738
);
2839
}

0 commit comments

Comments
 (0)