Develop DNA methylation plot and table API endpoints using the database schema and tables built in #69.
Following is a brief introduction on how to develop the DNA methylation plot and table API endpoints. The implementation of these procedures may require further discussions and modifications, to coordinate with #69 and the MTP web page design and development.
For each type of DNA methylation plot designed by @afarrel, a plot API endpoint and a table API endpoint need to be developed. The endpoints and R functions can take any appropriate names that are not taken by existing endpoints or functions. Following are the steps to add example gene_disease_dna_methylation plot and table endpoints:
Install additionally required ubuntu and R packages in Dockerfile.
Add src/get_dna_methylation_tbl.R to define a function, get_dna_methylation_tbl(ensg_id, efo_id), to retrieve a dataframe like object from the database.
src/get_gene_tpm_boxplot_tbl.R can be used as a reference for designing and implementing get_dna_methylation_tbl.
Query should be sent to the schema and table built in #69. If required data are absent, add a comment in #69 to describe what data are required.
Add src/get_dna_methylation_plot.R to define a function, get_dna_methylation_plot(dna_methylation_table), to use the table returned by get_dna_methylation_tbl to generate a plot, which will be transferred to MTP.
Add src/get_dna_methylation_summary_table.R to define a function, get_dna_methylation_summary_table(dna_methylation_table), to use the table returned by get_dna_methylation_tbl to generate a summary table, which will be transferred to MTP.
Add the following code to main.R to source the defined functions in API HTTP server R runtime:
Develop DNA methylation plot and table API endpoints using the database schema and tables built in #69.
Following is a brief introduction on how to develop the DNA methylation plot and table API endpoints. The implementation of these procedures may require further discussions and modifications, to coordinate with #69 and the MTP web page design and development.
For each type of DNA methylation plot designed by @afarrel, a plot API endpoint and a table API endpoint need to be developed. The endpoints and R functions can take any appropriate names that are not taken by existing endpoints or functions. Following are the steps to add example
gene_disease_dna_methylation
plot and table endpoints:Install additionally required ubuntu and R packages in
Dockerfile
.Add
src/get_dna_methylation_tbl.R
to define a function,get_dna_methylation_tbl(ensg_id, efo_id)
, to retrieve a dataframe like object from the database.src/get_gene_tpm_boxplot_tbl.R
can be used as a reference for designing and implementingget_dna_methylation_tbl
.Add
src/get_dna_methylation_plot.R
to define a function,get_dna_methylation_plot(dna_methylation_table)
, to use the table returned byget_dna_methylation_tbl
to generate a plot, which will be transferred to MTP.Add
src/get_dna_methylation_summary_table.R
to define a function,get_dna_methylation_summary_table(dna_methylation_table)
, to use the table returned byget_dna_methylation_tbl
to generate a summary table, which will be transferred to MTP.Add the following code to
main.R
tosource
the defined functions in API HTTP server R runtime:Add the following code in
src/plumber.R
to define a plot endpoint and a table endpoint.Add the following code to
tests/r_test_scripts/test_endpoint_http.R
to add tests to the new endpoints:The newly added endpoints can be tested following the procedures described in
README.md
.cc @afarrel @ewafula @chinwallaa