This file contains hidden or 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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:b5d9c057e15441865c84a9422297988c0e93d5961f3da2e00ebd3be695766282" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
This file contains hidden or 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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:dd3f380620371d7def93011e81b190a7a8f796fba0551a284b06626a6757a641" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
This file contains hidden or 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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:dd3f380620371d7def93011e81b190a7a8f796fba0551a284b06626a6757a641" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
This file contains hidden or 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
| 1995 1 | |
| 1996 3 | |
| 1999 4 | |
| 1998 1 | |
| 2002 13 | |
| 2003 10 | |
| 2000 31 | |
| 2001 2 | |
| 2006 21 |
This file contains hidden or 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
| 1996 2 | |
| 1999 1 | |
| 2001 1 | |
| 2002 4 | |
| 2003 13 | |
| 2004 3 | |
| 2005 2 | |
| 2006 9 | |
| 2007 59 | |
| 2008 37 |
This file contains hidden or 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
| install.packages('ggplot2') | |
| library(ggplot2) | |
| ## simple histogram | |
| data <- read.delim("path/to/data") | |
| ggplot(data, aes(x = data$V1)) + geom_histogram(binwidth = 30000) | |
| ## more complex - with axis labels and custom scaling - more info http://www.cookbook-r.com/Graphs/Plotting_distributions_(ggplot2)/ |
This file contains hidden or 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 plot_heat_tree(heatmap_file, tree_file, output_file=None): | |
| ''' | |
| Plot heatmap next to a tree. The order of the heatmap **MUST** be the same, | |
| as order of the leafs on the tree. The tree must be in the Newick format. If | |
| *output_file* is specified, then heat-tree will be rendered as a PNG, | |
| otherwise interactive browser will pop-up with your heat-tree. | |
| Parameters | |
| ---------- | |
| heatmap_file: str |
This file contains hidden or 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(ggplot2) | |
| library(RPostgreSQL) | |
| drv <- dbDriver("PostgreSQL") | |
| con = dbConnect(drv, dbname = 'dbname', host = 'postgres', user = 'user', password = 'password') | |
| query <- 'select * from your_table' | |
| res <- dbSendQuery(con, query) | |
| data_from_db <- fetch(res, n = -1) # n = -1 means all results will be returned |
This file contains hidden or 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(reshape) | |
| library(ape) | |
| # read in the data | |
| f <- read.delim("~/Dropbox/mash_project/2015.09.23.all_vs_all.txt", header=F) | |
| # use reshape's cast function to change to matrix | |
| m <- cast(f, V1 ~ V2) | |
| # set the row names | |
| rownames(m) <- m[,1] | |
| # get rid of a couple of rows |
This file contains hidden or 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
| import ftplib | |
| # ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR038/ERR038787/ERR038787_1.fastq.gz | |
| todo_list = ['ERR024633'] # ERR accessions | |
| target_dir = '/where/you/want/the/data' | |
| def download_from_ena(todo_list, target_dir): | |
| ftp = ftplib.FTP('ftp.sra.ebi.ac.uk') | |
| ftp.login() | |
| ftp.cwd('vol1') |
OlderNewer