Skip to content

Instantly share code, notes, and snippets.

View fransua's full-sized avatar
🐜
epigenomiking

Francois Serra fransua

🐜
epigenomiking
  • Computational Biology - BSC
  • Barcelona, Spain
  • 01:49 (UTC +02:00)
  • X @fransua_serra
View GitHub Profile
@fransua
fransua / shuffling trees.ipynb
Created November 28, 2021 11:19
Computing Nearest neighbor interchange (NNI)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
"""
import sys
from random import random, seed
table={"TTT": "F", "TTC": "F", "TTA": "L", "TTG": "L",
"TCT": "S", "TCC": "S", "TCA": "S", "TCG": "S",
"TAT": "Y", "TAC": "Y", "TGT": "C", "TGC": "C",
"TGG": "W", "CTT": "L", "CTC": "L", "CTA": "L",
@fransua
fransua / Basemap.ipynb
Created March 13, 2020 23:11
Graph-and-Stats/Basemap.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fransua
fransua / Heatmap.ipynb
Last active September 23, 2022 10:15
from a matrix, performs hierarchical clustering clustering.find best number of clusters, and plot it
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fransua
fransua / kimchi.py
Created January 26, 2020 21:43 — forked from rebeccabilbro/kimchi.py
For converting Python 2 pickles to Python 3
# kimchi.py
# For converting Python 2 pickles to Python 3
import os
import dill
import pickle
import argparse
def convert(old_pkl):
@fransua
fransua / notebook_mem_usage.py
Created June 27, 2019 12:57 — forked from aiguofer/README.md
Find out how much memory each of the jupyter notebooks running on a server is using. Helpful for knowing which ones to shut down. Original code from http://stackoverflow.com/questions/34685825/jupyter-notebook-memory-usage-for-each-notebook
import argparse
import re
import subprocess
import pandas as pd
import psutil
import requests
import tabulate
kernel_regex = re.compile(r".+kernel-(.+)\.json")
@fransua
fransua / Explain Genome.ipynb
Created June 26, 2019 14:40
Tutorials/Courses/Generic/Explain Genome.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fransua
fransua / Gene_track.ipynb
Last active April 26, 2021 16:31
Simple Gene track plot from Ensembl mart export
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fransua
fransua / DNA-helix.py
Last active May 20, 2019 14:26
Simple Gene track plot from Ensembl mart export
from matplotlib.collections import LineCollection
from matplotlib.colors import to_rgb
from matplotlib import pyplot as plt
import numpy as np
def draw_DNA_helix(bp=50, major_groove=22, minor_groove=12, bp_per_turn=10.5,
fig_height=1.5, colors=('red', 'black'), savefig=None, fig_format='png'):
"""
@fransua
fransua / plot_eteTree.py
Last active April 25, 2024 03:43
use matplotlib to draw phylogenetic trees from ETE3
from itertools import chain
from matplotlib.collections import LineCollection
from matplotlib import markers
from matplotlib.path import Path
import numpy as np
from ete3 import Tree, NodeStyle