Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
function [range, chr] = gene2range(gene, varargin)
%GENE2RANGE find the chromosome location of a gene.
%
% [range, chr] = GENE2RANGE(GENE, ...), returns the coordinates of the gene
% GENE according to reference genome hg19. The chromosome name or
% number of the chromosome containing the gene is also returned.
% Optionally, the coordinates can be extended to a flanking region
% to the left and right of the gene.
%
function [rsids, chromStart, chromEnd, chrom] = gene2snps(gene, varargin)
%GENE2SNPS find all SNPs lying within a given human gene.
%
% [rsids, chromStart, chromEnd, chrom] = GENE2SNPS(GENE, ...), returns the
% RSIDs of all SNPs lying within the human gene given by GENE,
% according to reference genome hg38 and SNP database snp146. The
% returned variable RSIDS is a cell array of strings specifying the
% SNPs. Bounds for the chromosome locations of the returned SNPs are
% returned in the variables CHROMSTART and CHROMEND. The chromosome on
% which the gene lies is returned in the variable CHROM.
function [k, theta, t, pval] = sgamfit(xs)
%SGAMFIT fits a shifted GAMMA distribution to a provided set of
% observations. It uses a smart initialization for the MATLAB
% constrained optimizer FMINCON to find the ML fit.
%
% [K, THETA, T, PVAL] = SGAMFIT(XS), returns ML parameters for a
% shifted GAMMA distribution fit to XS, along with the P-value for a
% KS-test of the goodness of fit.
%
% Inputs:
perl edit files in place:
perl -pi.orig -e 's/DATE/localtime/e'
Install a python script in your home directory using install.py:
easy_install --install-dir=$HOME/lib/