Skip to content

Instantly share code, notes, and snippets.

View oeway's full-sized avatar

Wei Ouyang oeway

  • Science For Life Laboratory
  • Stockholm
View GitHub Profile
@oeway
oeway / broadcastConnectionOnly.js
Last active May 16, 2021 14:06
Connecting to another ImJoy plugin in the same browser via broadcast channel and webRTC (only works with Chrome and FireFox)
/**
* Contains the routines loaded by the plugin iframe under web-browser
* in case when worker failed to initialize
*
* Initializes the web environment version of the platform-dependent
* connection object for the plugin site
*/
import { connectRPC } from "./pluginCore.js";
import { RPC, API_VERSION } from "./rpc.js";
import { MessageEmitter, randId, normalizeConfig } from "./utils.js";
<body>
<button id="button" onclick="connect()">Connect</button>
<div id="div"></div><input id="chat"></input><br>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script>
var pc = new RTCPeerConnection(), dc, enterPressed = e => e.keyCode == 13;
var connect = () => init(dc = pc.createDataChannel("chat"));
pc.ondatachannel = e => init(dc = e.channel);
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "HPA-UMAP-Nucleolus",
"type": "web-worker",
"tags": [],
"ui": "",

ImJoy Slide Demos


Plotly demo


<docs>
# NGFF image file Loader for ImageJ.JS
[Next-generation file formats](https://ngff.openmicroscopy.org/latest/) is a specification for storing bioimaging data in the cloud.
This plugin enalbes loading NGFF image into ImageJ.JS.
The implementation is adapted from the [OMERO ImJoy](https://github.com/will-moore/omero-imjoy) made by @will-moore
</docs>
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "HPA-UMAP-Studio",
"type": "web-worker",
"tags": [],
"ui": "",
import gzip
# download idmapping.dat.gz from uniprot
# wget ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz
id_mapping_file = './idmapping.dat.gz'
id_mapping = {}
for line in gzip.open(id_mapping_file):
line = line.decode('utf8').strip()
ac, pred, obj = line.split('\t')
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "VueMaterialBackbone",
"type": "window",
"tags": [],
"ui": "",
@oeway
oeway / VizarrFigshare.imjoy.html
Last active March 29, 2021 14:12
Python script for uploading files to figshare
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "VizarrFigshare",
"type": "web-worker",
"tags": [],
"ui": "",
@oeway
oeway / VizarrReferenceStore-Zenodo.imjoy.html
Last active October 19, 2023 03:17
Upload large files to zenodo and serve it as a zarr store (not working yet because zenodo doesn't support range header)
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "VizarrReferenceStore",
"type": "web-worker",
"tags": [],
"ui": "",