Skip to content

Instantly share code, notes, and snippets.

View slavailn's full-sized avatar

slava ilnytskyy slavailn

View GitHub Profile
#! /usr/bin/perl
# This script maps oligonucleotides. (i.e.) restriction site,
# which are normally to short to be mapped by conventional
# methods.
# NOTE, incomplete have to add palindrome
# subroutine
use strict; use warnings;
use Getopt::Long;
library(DESeq2)
library(arrayQualityMetrics)
library(gplots)
library(RColorBrewer)
library(biomaRt)
library(ReportingTools)
library(org.Mm.eg.db)
library(plyr)
library(pathview)
setwd("C:/Users/Yaroslav/Dropbox/Jacobs_project/")
library(DEXSeq)
library(pasilla)
setwd("/path/to/dir")
# Doing the vignette
# Get locations for count files and flattened annotation file in gff formar
inDir = "~/Dropbox/Jacobs_project/relative_exon_usage/exon_counts"
countFiles = list.files(inDir, pattern="exon.txt$", full.names=TRUE)
countFiles
# Go through vignette
library(DiffBind)
library(ChIPpeakAnno)
library(org.Mm.eg.db)
library(KEGG.db)
library(reactome.db)
setwd("~/Projects/grey_miseq/diffbind_analysis/")
# Analyze real samples
setwd("~/Projects/grey_miseq/diffbind_analysis/")
library("topGO")
library("ChIPpeakAnno")
library("org.Mm.eg.db")
library("plyr")
## Get universe ids
x <- org.Mm.egGO
mapped_genes <- mappedkeys(x)
universeIDs <- unique(mapped_genes)
#! /usr/bin/perl
# Grab lines between 2 matches and print them out
# In this case I'm using it to print out read length
# distribution from FastQC's fastqc_data.txt
my $dir = shift; # take directory name
open ( my $reads_file, "<", "$dir/fastqc_data.txt" ) or die "Cannot open original reads file: $!\n";
# Extract number of reads
@slavailn
slavailn / plot_read_length_distr.R
Created April 27, 2016 22:31
Plot length distribution of sequencing reads using ggplot2, scatter plot where every point is mean fraction of reads of certain length
library(edgeR)
library(reshape2)
library(plyr)
# Get library distribution profile
setwd("~/Projects/Champion_smallRNA/length_distr/")
list.files()
d <- readDGE(list.files(), columns = c(1,2))
counts <- d$count
@slavailn
slavailn / heatmap_plots.R
Created April 29, 2016 22:43
Draw a heatmap with side colors using the gene expression matrix
heatmap.2(as.matrix(res), scale = "row", col = redgreen(75),
ColSideColors=color_vector, trace = "none",
margins = c(14, 13), cexRow = 0.7)
@slavailn
slavailn / DESeq2_sRNA_ANOVA.R
Last active May 5, 2016 21:30
ANOVA type differential expression for small RNAs with DESeq2
###########################################################################
## Exploratory analysis
library(edgeR)
library(DESeq2)
library(arrayQualityMetrics)
library(gplots)
library(RColorBrewer)
library(ggplot2)
setwd("~/Projects/Champion_smallRNA/comparisons")
@slavailn
slavailn / GAGE_pathview_visualization.R
Created May 10, 2016 22:30
GAGE analysis for RNA-seq data and pathway visualization with pathview
library(gage)
library(pathview)
library("gageData")
library(biomaRt)
# read variance stabilized expression data
vsd <- read.table("expression_data/expressions_vsd.txt", header = T, row.names = 1)
# Rename samples using descriptive sample names
coldata <- read.table("sample_layout.txt", sep="\t", header=T, row.names=1)