Skip to content

Instantly share code, notes, and snippets.

View maclandrol's full-sized avatar

Emmanuel Noutahi maclandrol

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maclandrol
maclandrol / molecule_alignment.ipynb
Last active March 14, 2022 20:03
template alignment
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maclandrol
maclandrol / mdl_extended_parser.ipynb
Last active October 28, 2021 17:21
MDL extended parser (Ketcher flavour)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maclandrol
maclandrol / import_ben_treemap.py
Last active April 15, 2018 21:32
Origin of imported Good in Benin (2016)
from pycountry_convert import country_alpha2_to_continent_code as a2ctc
from pycountry_convert import convert_continent_code_to_continent_name as ctc2ctn
from pycountry_convert import country_alpha3_to_country_alpha2 as a3a2
from pycountry_convert import country_alpha2_to_country_name as a2cn
from functools import partial
from d3IpyPlus import *
# let's keep the following columns only
datafile = "en_profile_country_ben_import_des.csv"
cols = ['year', 'country_origin_id', 'country_destination_id', 'import_val']
@maclandrol
maclandrol / tree_simul.py
Created December 10, 2017 22:47
Tree simulation
#!/usr/bin/env python
from ete3 import Tree
import random
def delete_single_child_internal(t):
"""Utility function that removes internal nodes
with a single child from tree"""
for node in t.traverse("postorder"):
#!/usr/bin/env python
from ete3 import Tree
# pseudo code
# binary rooted tree comparison
def equals(tree1, tree2):
if tree1 == tree2:
return True
# checking only leaf names
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>College made you dumber</title>
<link rel="stylesheet" href="/static/css/reveal.css">
<link rel="stylesheet" href="/static/css/theme/black.css">
# modification of config created here: https://gist.github.com/cscorley/9144544
try:
from urllib.parse import quote # Py 3
except ImportError:
from urllib2 import quote # Py 2
import os
import sys
from settings import template_path, template_file, build_dir, rel_img_path
f = None
for arg in sys.argv:
from ete2 import PhyloNode, TreeStyle
import sys
if(len(sys.argv)<2):
sys.exit("Usage : python disptree.py input output")
else:
inputfile, output = sys.argv[1], sys.argv[2]
t = PhyloNode(inputfile)
ts = TreeStyle()
ts.show_branch_length = True
ts.show_branch_support = True
#!/usr/bin/env python
import argparse
from glob import glob
import os
try:
from Bio.SeqRecord import SeqRecord
from Bio import AlignIO
from Bio.Align import MultipleSeqAlignment
from Bio.Seq import Seq
from Bio.Alphabet import generic_protein