Skip to content

Instantly share code, notes, and snippets.

@mlovci
mlovci / serpentine.py
Created July 9, 2017 20:54
A code poem.
def serpentine(n_max):
# \ /
# Y
# #
# #
# #
# #
@mlovci
mlovci / OLO.py
Last active October 19, 2020 08:52
Classy Optimal Leaf Ordering - with code taken from seaborn and markak. Does not plot anything by default, but provides `obj.ordered_data` that can be sent to seaborn.heatmap
import pandas as pd
import numpy as np
from scipy.spatial.distance import squareform, pdist
from scipy.cluster import hierarchy
from scipy.spatial import distance
from scipy.cluster.hierarchy import linkage
import itertools
import matplotlib.pyplot as plt
import seaborn
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>NewPlugins</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@mlovci
mlovci / Figure 2.html
Created October 7, 2015 09:03
Interactive post-translational modifications of SRSF, ELAVL and HNRNP proteins.
This file has been truncated, but you can view the full file.
<h2> Instructions </h2>
<h3>Use this plot to browse post-translational modifications from Uniprot.</h3>
<br>
<p>
The buttons at the bottom left allow viewport scaling.
Use the magnifying glass to zoom, the arrows to pan and the home button to return to the original view.
</p>
<p>
Mouse over modifications and domains to see their descriptions.
chr1 249132529 249132530 6425 0 +
FROM bgruening/galaxy-stable:dev
EXPOSE 8894
RUN cd /galaxy-central/lib/galaxy/web/proxy/js/ && npm install -g
ADD ./galaxy.ini /galaxy-central/config/galaxy.ini
ADD ./startup /usr/bin/startup
ADD ./clean.sh /usr/bin/clean.sh
RUN chmod 755 /usr/bin/startup && chmod 755 /usr/bin/clean.sh
@mlovci
mlovci / Dockerfile
Created December 16, 2014 17:35
minimal galaxy + ipython /docker (v2)
FROM bgruening/galaxy-stable:dev
ADD ./startup /usr/bin/startup
ADD ./clean.sh /usr/bin/clean.sh
RUN chmod 755 /usr/bin/startup && chmod 755 /usr/bin/clean.sh
@mlovci
mlovci / Dockerfile
Last active August 29, 2015 14:11
Minimal for Galaxy(docker) + IPython(docker)
FROM bgruening/galaxy-stable:dev
RUN git clone https://github.com/bgruening/galaxy-ipython.git config/plugins/visualizations/ipython
ADD ./startup /usr/bin/startup
ADD ./clean.sh /usr/bin/clean.sh
RUN chmod 755 /usr/bin/startup && chmod 755 /usr/bin/clean.sh
RUN sudo apt-get install -y apache2
ADD ./apache_conf /apache_conf
RUN cat /apache_conf >> /etc/apache2/apache2.conf
@mlovci
mlovci / css.py
Last active August 29, 2015 14:07
pretty css
sekcss = """
<style>
.rendered_html
{
font-size: 140%;
line-height: 1.1;
margin: 0.5em 0;
}
def muzak(ob):
from IPython.display import HTML
from IPython.display import display
sound_tag = """
<audio controls autoplay>
<source src="http://k007.kiwi6.com/hotlink/9edy0q33fi/jazzy_elevator_music.mp3" type="audio/mpeg">
</audio>
"""
display(HTML(sound_tag))