Skip to content

Instantly share code, notes, and snippets.

View VasLem's full-sized avatar

Vassilis Lemonidis VasLem

  • UAntwerp
  • Antwerp, Belgium
View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 3, 2025 13:10
set -e, -u, -o, -x pipefail explanation
@rwightman
rwightman / median_pool.py
Last active August 13, 2024 10:57
PyTorch MedianPool (MedianFilter)
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.
@chapmanb
chapmanb / gist:727625
Created December 3, 2010 21:57
retrieve_gene.py
from Bio import Entrez
def fetch_gene_coordinates(search_term):
handle = Entrez.esearch(db="gene", term=search_term)
rec = Entrez.read(handle)
gene_id = rec["IdList"][0] # assuming best match works
handle = Entrez.efetch(db="gene", id=gene_id, retmode="xml")
rec = Entrez.read(handle)[0]
gene_locus = rec["Entrezgene_locus"][0]