Skip to content

Instantly share code, notes, and snippets.

View alexomics's full-sized avatar
🦆
🦆🦆

alex alexomics

🦆
🦆🦆
View GitHub Profile
@flashton2003
flashton2003 / nanopore_costs.py
Created March 22, 2021 15:20
script to calculate costs for nanopore sequencing
import math
from copy import deepcopy
def how_many_packs(number_flow_cells, option1):
# pack_sizes is nanopore flowcell pack sizes, sorted from high to low
pack_sizes = sorted([300, 48, 24, 12, 1], reverse = True)
# pack to buy is the largest pack which is less than or equal to the number we need
pack_to_buy = [x for x in pack_sizes if x <= number_flow_cells][0]
# make a note that we need one of that pack size in the option1 dict
@mmellison
mmellison / grpc_asyncio.py
Last active April 3, 2024 15:48
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):