Skip to content

Instantly share code, notes, and snippets.

View fomightez's full-sized avatar

Wayne's Bioinformatics Code Portal fomightez

View GitHub Profile
@fomightez
fomightez / diff.py
Created December 16, 2015 16:09 — forked from jorendorff/diff.py
A primitive `diff` in 50 lines of Python. Explained here: http://pynash.org/2013/02/26/diff-in-50-lines.html
""" Usage: python diff.py FILE1 FILE2
A primitive `diff` in 50 lines of Python.
Explained here: http://pynash.org/2013/02/26/diff-in-50-lines.html
"""
def longest_matching_slice(a, a0, a1, b, b0, b1):
sa, sb, n = a0, b0, 0
runs = {}
@fomightez
fomightez / extract_conserved_from_alignments.py
Last active February 9, 2017 17:48
helping Damian Menning extracting 100% conserved sequences from sequence records in fasta format. VERSION0.2 currently the most developed. The MOST UP-TO-DATE code version and documentation now at https://github.com/fomightez/sequencework/tree/master/Extract_Conserved_from_Aligned .
#! /usr/bin/env python
# extract_conserved_from_alignments.py by Damian Menning and Wayne Decatur
# ver 0.1
#
#*******************************************************************************
# USES Python 2.7
# PURPOSE: Takes a file of aligned sequences in FASTA format and extracts the
# residues that are 100% conserved in all sequences. As it scans the sequences,
# it writes to a file the residue if it is the same or a blank line if it is not.
@fomightez
fomightez / p4339 natMX plasmid from Boone Lab.fa
Created February 17, 2016 20:11
sequence of p4339 natMX plasmid from Boone Lab as described at http://sites.utoronto.ca/boonelab/sga_technology/index.shtml 339-1460 are natMX amplicon insert made from primers 5'-ACATGGAGGCCCAGAATACCC-3' and 5'-CAGTATAGCGACCAGCATTCAC-3' according to Boone Lab
> p4339 natMX plasmid from Boone Lab as described at http://sites.utoronto.ca/boonelab/sga_technology/index.shtml 339-1460 are natMX amplicon insert made from primers 5'-ACATGGAGGCCCAGAATACCC-3' and 5'-CAGTATAGCGACCAGCATTCAC-3' according to Boone Lab
AGCGCCCAATACGCAAACCGCCTCTCCCCGCGCGTTGGCCGATTCATTAATGCAGCTGGCACGACAGGTTTCCCGACTGG
AAAGCGGGCAGTGAGCGCAACGCAATTAATGTGAGTTAGCTCACTCATTAGGCACCCCAGGCTTTACACTTTATGCTTCC
GGCTCGTATGTTGTGTGGAATTGTGAGCGGATAACAATTTCACACAGGAAACAGCTATGACCATGATTACGCCAAGCTAT
TTAGGTGACACTATAGAATACTCAAGCTATGCATCAAGCTTGGTACCGAGCTCGGATCCACTAGTAACGGCCGCCAGTGT
GCTGGAATTCGCCCttaaACATGGAGGCCCAGAATACCCtccttgacagtcttgacgtgcgcagctcaggggcatgatgt
gactgtcgcccgtacatttagcccatacatccccatgtataatcatttgcatccatacattttgatggccgcacggcgcg
aagcaaaaattacggctcctcgctgcagacctgcgagcagggaaacgctcccctcacagacgcgttgaattgtccccacg
ccgcgcccctgtagagaaatataaaaggttaggatttgccactgaggttcttctttcatatacttccttttaaaatcttg
ctaggatacagttctcacatcacatccgaacataaacaaccatgggtaccactcttgacgacacggcttaccggtaccgc
@fomightez
fomightez / bio_align.py
Created June 6, 2016 13:56 — forked from JoaoRodrigues/bio_align.py
Sequence-based structure alignment of protein structures with Biopython
#!/usr/bin/env python
"""
Sequence-based structural alignment of two proteins.
"""
from __future__ import print_function, division
import argparse
import os
@fomightez
fomightez / link to live plot.md
Last active February 18, 2020 22:34
plotly plot for standard curve of yeast growth that is part of cell density estimator
@fomightez
fomightez / zNote_about_resources_used.md
Last active March 26, 2017 18:39
files for illustrating the Launching VPython Binder Gist

Resources used in making Launching VPython Binder.md simply for Wayne's own reference

Bottom of here for how to add a bunch of images quickly to a gist.

the question here illustrates a way that works always to place images into markdown gists, follow the link through to here to see it in action. Note that the full link extracted from the url seen when viewing the 'raw' image for a gist, a.k.a., "the hard way" on that page, is the only way that really works.

For adding small icons and symbols use advice here to add things like play button [►], etc. and [here](http://jrgraphix.net/r/Unicode/25A0

@fomightez
fomightez / How-to for Launching VPython Binder.md
Last active March 26, 2017 18:15
How-to for Launching VPython Binder
  • Go to VPython.org in your browser. The landing page will look like below.

zvpythonDOTorg.png

  • Click on Binder package link on that page. That link is near the very bottom of the part of the page that is showing above; it is just below Demo Programs.

  • A notebook will then launch. (Sometimes first times they hang, just hit reload in your browser.)
    After it loads fully it will look like below with a URL different from what you see but similar.
    zexample_VPython_launch.png

@fomightez
fomightez / Fixing calculation of A260 when using less than ml in spec.ipynb
Created September 27, 2016 15:30
Calculating A260 units for loading polysome gradients
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fomightez
fomightez / Launch VPython Binder with Seaborn Support.md
Last active July 6, 2017 03:29
Launch VPython Binder with Seaborn Support
  • Go to my fork of the VPython Binder repository in your browser.

  • Click on the Binder on the bottom of that page.

  • That will take you to a new page and trigger deploying version of the jupyter notebook environment from the correct repository. You shouldn't need to do anything as this takes place; you can watch the progress bar roughly in the middle of the screen, just below the Launch button. It may take about a minute. After it boots up, it should bring you to the dashboard that will look like below

zexample_dashboard.png

@fomightez
fomightez / venn3_demo_for_Jupyter_notebook_cell.py
Last active June 20, 2019 17:15
venn3 demo that will work in a cell of a Jupyter notebook --- try `%matplotlib inline`as first line instead if using JupyterLab Binder end of 2016
%matplotlib notebook
from matplotlib import pyplot as plt
from matplotlib_venn import venn3, venn3_circles
#**REQUIRES `matplotlib_venn` ADDED TO `REQUIREMENTS.TXT` FOR BINDER, or run `%pip install matplotlib_venn` first**
#**One already set like that can be launched from https://github.com/fomightez/vpython-jupyter ***
# NOTE: I corrected the Subset labels according to info I posted at
# http://matthiaseisen.com/pp/patterns/p0145/ , which is
# where this code was adapted from
# Subset sizes