Skip to content

Instantly share code, notes, and snippets.

View mfcovington's full-sized avatar

Mike Covington mfcovington

View GitHub Profile
@mfcovington
mfcovington / plot-compost-map.R
Last active December 18, 2015 21:09
Plot Composite Map
PlotCompositeMap <- function(bins.file, par1 = "par1", par2 = "par2",
col1 = "sky blue", colh = "black", col2 = "orange", plot.file = "composite-map.png",
plot = FALSE, save = TRUE, chr.text.size = 7, chr.text.angle = 0, ggtitle = "Composite Genotype Map",
...) {
library(ggplot2)
library(plyr)
library(reshape)
bins <- read.table(bins.file, header = T, sep = "\t")
@mfcovington
mfcovington / convert-README-from-md-to-rst.py
Created December 8, 2015 05:49
Convert README.md into reStructuredText
# From: https://bitbucket.org/pypa/pypi/issues/148/support-markdown-for-readmes#comment-23875412
import setuptools
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
setuptools.setup(
name='example',
version=find_version('example.py'),
long_description=long_description,
@mfcovington
mfcovington / plot-timecourse.r
Last active January 21, 2016 20:51
time course plotting function
timecourse <- readRDS('timecourse.rds')
plot.timecourse <- function(gene.list, east.color='orange', west.color='forestgreen', double.plot=FALSE, side.by.side=FALSE) {
library(ggplot2)
timecourse.subset <- timecourse[timecourse$gene %in% gene.list, ]
timecourse.subset$gene <- as.character(timecourse.subset$gene)
if (double.plot) {
timecourse.subset.copy <- timecourse.subset
timecourse.subset.copy$hour <- timecourse.subset.copy$hour + 48

CDS and Peptide Reference Sequences

Solanum lycopersicum:

  • Ensemble

    • CDS: ftp://ftp.solgenomics.net/genomes/Solanum_lycopersicum/annotation/ITAG2.4_release/ITAG2.4_cds.fasta
    • PEP: ftp://ftp.solgenomics.net/genomes/Solanum_lycopersicum/annotation/ITAG2.4_release/ITAG2.4_proteins_full_desc.fasta
  • SolGenomics

###############
# settings.py #
###############
RELATIONSHIPS = [
('alerts', 'insurers'),
('alerts', 'producers'),
('alerts', 'vendors'),
]
import abc
class Greet(object):
__metaclass__ = abc.ABCMeta
def __init__(self, name):
self.name = name
@abc.abstractmethod
@mfcovington
mfcovington / settings.py
Created May 1, 2015 21:06
Testing CMS_PLACEHOLDER_CONF
CMS_PLACEHOLDER_CONF = {
'research interests': {
'default_plugins': [
{
'plugin_type': 'TextPlugin',
'values': {
'body':'<p>Research: Lorem ipsum dolor sit amet...</p>',
},
},
],
@mfcovington
mfcovington / extract-seqs-from-cds-and-translate.sh
Last active August 29, 2015 14:15
Extract sequences from a CDS FASTA file and translate them
# Required files:
# - from https://github.com/mfcovington/extract_genotype_specific_seq (commit 0867551092)
# - parse_fasta-lite.pl
# - from https://github.com/mfcovington/fasta-manipulation (v0.1.4)
# - amino_acid_translation.pm
# - translate_cds_fasta.pl
FASTA_DIR= # Directory w/ FASTA files
SPECIES_LIST= # A file w/ species IDs to extract one ID per line
OUT_DIR= # Output directory
@mfcovington
mfcovington / get-hits-and-misses.R
Last active August 29, 2015 14:14
Matching Seq IDs with different suffixes
###############
# APPROACH #1 #
###############
library(hash)
CreateIdHash <- function(seq_ids) {
# Takes an array of full sequence IDs and returns a hash
# with shortened IDs as keys and full IDs as values
ids <- data.frame(full=seq_ids)

Regarding the permanence of GitHub:

GitHub, aimed at all programmers from independent developers to collaborative groups to corporate enterprises, is the world's largest code host with 18.7 million code repositories from 8.2 million users and hundreds of thousands of organizations. In addition to hosting open-source codebases and websites from tech industry giants such as Google, Microsoft, Facebook, Twitter, Netflix, and Amazon, GitHub is also used by more than 400 government organizations including The National Cancer Informatics Program at NIH's National Cancer Institute, The DOE Joint Genome Institute, [Los Alamos National Laboratory](https://github.com/LANL, https://github.com/LANL-Bioinformatics), NASA, [Th