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
plotRNAcoverage <- function(rs, tx, what=c("transcripts", "exons", "introns"), | |
nsamples=100, main="RNA-seq bias plot", verbose="TRUE") { | |
what <- match.arg(what) | |
if (what=="transcripts") { | |
genes <- exonsBy(txdb, "tx") | |
values(genes) <- NULL | |
} else if (what=="exons") { | |
genes <- exons(txdb) | |
values(genes) <- NULL | |
genes <- split(genes, 1:length(genes)) |
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 | |
""" | |
getimg.py | |
##oh hai dere | |
Gets the current image of the day from NASA and sets it as the | |
background in Gnome. The summary / description text is written | |
to the image. |
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
library(Repitools) | |
library(chipseq) | |
library(BSgenome.Hsapiens.UCSC.hg18) | |
library(rtracklayer) | |
rootdir <- "/home/data/NGS_New" | |
NGS <- read.csv(paste(rootdir, "NGS_Log14.csv", sep="/"), stringsAsFactors=FALSE, header=T) | |
load(paste(NGS$Path[1], NGS$RdataGR[1], sep="/")) |
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
> 2:3 %in% 1:5 | |
[1] TRUE TRUE | |
> !2:3 %in% 1:5 | |
[1] FALSE FALSE |
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 | |
# | |
# script for nagios notify via Jabber / Google Talk Instant Messaging | |
# using XMPP protocol and SASL PLAIN authentication. | |
# | |
# author: Andrew Elwell <[email protected]> | |
# based on work by Thus0 <[email protected]> and David Cox | |
# | |
# released under the terms of the GNU General Public License v2 | |
# Copyright 2007 Andrew Elwell. |
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
cat hg18.fa | awk '{ | |
if (substr($0, 1, 1)==">") {filename=(substr($0,2) ".fa")} | |
print $0 > filename | |
}' |
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/local/bin/Rscript | |
library(twitteR) | |
library(imguR) | |
sess <- initSession("clark_lab_linux", "password") | |
rstats <- searchTwitter("#rstats", sess, n=1000) | |
#filter out junk | |
rstats <- rstats[sapply(sapply(rstats, screenName), length)>0] | |
#make graph | |
posters <- sort(table(sapply(rstats, screenName)), decreasing=TRUE) |
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
imguRupload <- function(filename, title=NULL, caption=NULL, name=basename(filename), apikey="4feb29d00face5bc1b9dae536e15c373") { | |
require(RCurl) | |
require(RJSONIO) | |
if (length(filename)>1) stop("'filename' must be length 1.") | |
if (!file.exists(filename)) stop(filename, "does not exist!") | |
params <- list(key=apikey, image=fileUpload(filename), name=filename) | |
if (!is.null(title)) params[["title"]] <- title | |
if (!is.null(caption)) params[["caption"]] <- caption | |
fromJSON(rawToChar(postForm("http://api.imgur.com/2/upload.json", .params=params)))$upload | |
} |
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
imguRupload <- function(filename, title=NULL, caption=NULL, name=basename(filename), apikey="4feb29d00face5bc1b9dae536e15c373") { | |
require(RCurl) | |
require(RJSONIO) | |
if (length(filename)>1) stop("'filename' must be length 1.") | |
if (!file.exists(filename)) stop(filename, "does not exist!") | |
params <- list(key=apikey, image=fileUpload(filename), name=filename) | |
if (!is.null(title)) params[["title"]] <- title | |
if (!is.null(caption)) params[["caption"]] <- caption | |
fromJSON(rawToChar(postForm("http://api.imgur.com/2/upload.json", .params=params)))$upload | |
} |
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
library(rjson) | |
options(scipen=10000) | |
if (file.exists("IAMA.db")) file.remove("IAMA.db") | |
system("sqlite3 IAMA.db < IAMA_scraper.schema;") | |
while (TRUE) { | |
bigTab <- NULL | |
after <- "" | |
baseURL <- "http://www.reddit.com/r/iama/.json?sort=new&limit=100" |
NewerOlder