This page outlines how to access the source code for the SpatialMap Vignettes and for other notebooks and reports contained in the Analysis Toolkit.

SpatialMap vignettes

The SpatialMap vignettes are available to you as a data asset on Code Ocean. To access this data on Code Ocean, first you must create a compute capsule. This capsule should be configured with a starter image that includes SpatialMap, as described in this page.

Once you have a capsule, there are multiple ways to attach a data asset. One way is to go to the /data folder in the left sidebar and click Manage Data Assets

Untitled

This will open a modal that will allow you to select any data assets you want to be available in this capsule.

Untitled

Once the vignette data asset is attached (link here to the data asset), the source code for the vignettes as well as a readme file will be available in folders under /data in any compute sessions launched with the capsule.

Untitled

<aside> 💡 As with all data assets on Code Ocean, this folder will be read only.

This data asset is synced to an external folder in AWS S3, which will be automatically updated as the package is improved. If you would like to build reproducible workflows with these notebooks, you should move them to /code.

</aside>

Within this folder, the vignettes are organized into two groups: spatialmap_analysis_guides and spatialmap_advanced_tutorials.

If you're looking for a more in-depth guide to SpatialMap and the power of R for analysis of spatial biology data, check out the "Analysis Guide" vignettes! These will walk you through the essential steps to get started with SpatialMap, and also provide some code templates that you can copy as a jumping-off point for analysis of your own data. The files created by each notebook in this workflow are saved in the spatialmap_analysis_guides folder as well, so you can pick up the guides at any point in the workflow.

If you are already familiar with analysis of spatial biology data in R, the Quickstart Guide (in the advanced tutorials folder) is a good first stop! It gives a brief overview of the functionality of the SpatialMap package. The other advanced tutorials go into deeper dives on the inner workings of the package and on how SpatialMap facilitates integration of analysis on Workbench with the Enable Medicine Portal.

Additional Notebooks and Reports

Whereas the code for the SpatialMap vignettes is available as a data asset, the code for other Notebooks and Reports is not. To access source code for these other workflows, first, navigate to a notebook of interest in the Analysis Toolkit. Next, click on the download button present on the notebook card to download the source code in .ipynb or .rmd format. To use the notebook, upload the source code file to Code Ocean using the upload button in RStudio or JupyterLab or the file uploading in the Code Ocean capsule UI on the left sidebar.

<aside> 💡 Code Ocean recommends saving code notebooks into the /code directory in your capsule.

Most of these notebooks were originally written for use on Posit, and while we have made efforts to ensure that they will function smoothly on Code Ocean there may be some rough spots. We recommend ensuring that all data reads are reading from /data or /scratch, and that data writes are writing to /scratch or /results (see our guide to data management for more information). If you encounter any other difficulties using these notebooks on Code Ocean, please don’t hesitate to reach out to [email protected].

</aside>

If a notebook is missing the download button, it’s either a SpatialMap Vignette, or an example report without source code available.

Please note that some notebooks available for download in the analysis toolkit cannot be used on Workbench, but we still provide access to the source code for use off of the Platform. These notebooks will have clear messaging at the top.

Return to Home Directory