This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Copyright 2011 | |
# Andrew Redd | |
# 11/23/2011 | |
# | |
# Description of File: | |
# Makefile for knitr compiling | |
# | |
################################################################################ | |
all:pdf # default rule DO NOT EDIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Need plyr | |
require(plyr) | |
## Some fake data | |
foo <- data.frame(a=rep("foo", 3), b=rep("foofoo", 3), c=rep("foobarfoo", 3)) | |
## Replace function, works on vectors | |
fn <- function(x) gsub("foo", "bar", x) | |
## Turn it into a column-wise function; only apply to cols "a" and "b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown) | |
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96. | |
This combination of tools provides an exciting improvement in usability for | |
[reproducible analysis](http://stats.stackexchange.com/a/15006/183). | |
Specifically, this post | |
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96; | |
(2) provides a basic example of producing console output and plots using R Markdown; | |
(3) highlights several code chunk options such as caching and controlling how input and output is displayed; | |
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and | |
(5) discusses the implications of R Markdown. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# split a bam file by read group ID | |
# Sean Davis <seandavi@gmail.com> | |
# March 10, 2012 | |
# | |
import pysam | |
import argparse | |
import logging | |
logging.basicConfig(level=logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Add the read group ID to each read name in a BAM or SAM file. | |
Must output to SAM format to get the header. | |
To directly convert to BAM, pipe to samtools view: | |
python add_rgid_to_qname.py INPUT.sam /dev/stdout | samtools view -Sb /dev/stdin > OUTPUT.bam | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def safe_qsub_run(cmd, jobname, script_header=_script_header, nodes=1, params="", stdout=None, stderr=None, shell=False): | |
"""Run a command via qsub in blocking mode so that the command waits to exit. | |
Requires a header string and a job name. | |
""" | |
scriptfile = tempfile.NamedTemporaryFile() | |
scriptfile.write("%(header)s\n%(command)s\n" % dict(header=script_header, command=cmd)) | |
scriptfile.file.flush() | |
qsub_cmd = "qsub -N %(jobname)s -l nodes=%(nodes)s -W block=true %(params)s" % dict(jobname=jobname, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read .mp3 files from a given directory, compare songs, and play them in order of similarity | |
# To run, source this file, then: | |
# arrangeMusicC(inDirectory = getwd()) | |
library("plyr") | |
library("tuneR") | |
library("seewave") | |
library("compiler") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GGGGCTCCTAGCCTCCGAGGCCTCTGGAAAAAAAAGAGAGAGGCCTCTGAGGCTTAAGAGGCTTAATTAGCAAAAAAGGCAGTATCTAAGGGCAGATCCCAAGGGCGGGAAACTGCAGTATAAAAACCACTCCTTAGTGAGGTAGCTCATTTGCTCCTCTGCTCTTTCTGCAAACTCCTTCTGCATATAGACAAGATGGATTTAGTCCTAAATAGGAAAGAAAGAGAGGCTCTCTGCAAGCTTTTAGAGATTGCTCCTAATTGTTATGGCAACATCCCTCTGATGAAAGCTGCTTTCAAAAGAAGCTGCTTAAAGCATCACCCTGATAAAGGGGGAAATCCTGTTATAATGATGGAATTGAACACCCTTTGGAGCAAATTCCAGCAAAATATCCACAAGCTCAGAAGTGACTTCTCTATGTTTGATGAGGTCAGTACAAAATTTCCTTGGGAAGAATATGGAACTTTAAAGGATTATATGCAAAGTGGATATAATGCTAGATTTTGCAGAGGTCCTGGGTGCATGCTTAAGCAACTTAGAGATTCTAAGTGCGCTTGTATTAGCTGTAAGTTGTCTCGCCAGCATTGTAGTCTAAAAACTTTAAAGCAAAAAAACTGTCTGACGTGGGGAGAGTGTTTTTGCTATCAGTGCTTTATTCTTTGGTTTGGATTTCCTCCTACTTGGGAAAGTTTTGACTGGTGGCAAAAAACTTTAGAAGAAACTGACTACTGCTTACTGCATCTGCACCTTTTCTAGACTCCTACTTCCTTCCTCTGTAAGTATTAGATATGGAAAAGTCTATAAGGCAAAATATCAAAGAAAGGTTATTTATGACAGATTTTCTGTACTTTCCCATCTAGGTTGACGAGGCCCCTATATATGGGACCACTAAATTCAAAGAATGGTGGAGATCAGGAGGATTCAGCTTCGGGAAGGCATACGAATATGGGCCCAATCCACACGGGACCAACTCAAGATCCAGAAAGCCTTCCTCCAATGCATCCAGGGGAGCCCCCAGTGGAAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NIH research festival | |
======================================================== | |
http://researchfestival.nih.gov/2013/posters.cgi | |
chrom-4 | |
Cancer-4 | |
Cancer-5 | |
Molbio-6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# From http://genomics-pubs.princeton.edu/prv/resources/scripts/fastq-filter_extract_reads.pl | |
=head1 NAME | |
fastq-filter_extract_reads.pl - Splits fastq file based on read ids in a list | |
=head1 SYNOPSIS |
OlderNewer