Skip to content

Instantly share code, notes, and snippets.

@jtpio
Last active July 22, 2021 07:09
Show Gist options
  • Save jtpio/844ab4e85ae84f230cbcb0e56a59c88e to your computer and use it in GitHub Desktop.
Save jtpio/844ab4e85ae84f230cbcb0e56a59c88e to your computer and use it in GitHub Desktop.
JupyterLab Renderers with JupyterLab 3.1.0rc2

JupyterLab Renderers with JupyterLab 3.1.0rc2

Binder

Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
},
"kernelspec": {
"name": "python",
"display_name": "Pyolite",
"language": "python"
}
},
"nbformat_minor": 4,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": [
"# JupyterLab Renderers"
],
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"## FASTA"
],
"metadata": {}
},
{
"cell_type": "code",
"source": [
"def Fasta(data=''):\n",
" bundle = {}\n",
" bundle['application/vnd.fasta.fasta'] = data\n",
" bundle['text/plain'] = data\n",
" display(bundle, raw=True)\n",
"\n",
"Fasta(\"\"\">SEQUENCE_1\n",
"MTEITAAMVKELRESTGAGMMDCKNALSETNGDFDKAVQLLREKGLGKAAKKADRLAAEG\n",
"LVSVKVSDDFTIAAMRPSYLSYEDLDMTFVENEYKALVAELEKENEERRRLKDPNKPEHK\n",
"IPQFASRKQLSDAILKEAEEKIKEELKAQGKPEKIWDNIIPGKMNSFIADNSQLDSKLTL\n",
"MGQFYVMDDKKTVEQVIAEKEKEFGGKIKIVEFICFEVGEGLEKKTEDFAAEVAAQL\n",
">SEQUENCE_2\n",
"SATVSEINSETDFVAKNDQFIALTKDTTAHIQSNSLQSVEELHSSTINGVKFEEYLKSQI\n",
"ATIGENLVVRRFATLKAGANGVVNGYIHTNGRVGVVIAAACDSAEVASKSRDLLRQICMH\"\"\")"
],
"metadata": {
"trusted": true
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## GeoJSON"
],
"metadata": {}
},
{
"cell_type": "code",
"source": [
"def GeoJSON(data):\n",
" bundle = {}\n",
" bundle['application/geo+json'] = data\n",
" bundle['text/plain'] = data\n",
" display(bundle, raw=True)\n",
" \n",
"GeoJSON({\n",
" \"type\": \"Feature\",\n",
" \"geometry\": {\n",
" \"type\": \"Point\",\n",
" \"coordinates\": [125.6, 10.1]\n",
" },\n",
" \"properties\": {\n",
" \"name\": \"Dinagat Islands\"\n",
" }\n",
"})"
],
"metadata": {
"trusted": true
},
"execution_count": null,
"outputs": []
}
]
}
jupyterlab==3.1.0rc2
jupyterlab-fasta
jupyterlab-geojson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment