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(edgeR) | |
setwd(<dir>) | |
files <- list.files("/tag_counts/", full.names = T) # tab delimited file with sequenca tags and raw counts | |
files | |
d <- readDGE(files, columns = c(1,2)) | |
counts <- d$counts | |
sampleFile <- <sampleFile> | |
sampleInfo <- read.table(sampleFile, sep = "\t", header = T, stringsAsFactors = F) |
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
#! /bin/bash | |
echo -e "Samplename\tTotal_reads\tMapped_reads\tUnmapped_reads\tMAPQ20_reads\tPercent_mapped\tPercent_MAPQ20_reads" | |
for file in ./*bam | |
do | |
filename=`basename $file` | |
samplename=${filename%.bam} | |
total_reads=`samtools view -c $file` | |
mapped_reads=`samtools view -c -F 4 $file` |
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(GenomicRanges) | |
library(ChIPpeakAnno) | |
library(genomation) | |
library(biomaRt) | |
library(ChIPseeker) | |
library(org.Mm.eg.db) | |
library(ReactomePA) | |
library(clusterProfiler) | |
setwd("<project_dir>") |
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(ChIPseeker) | |
library(TxDb.Hsapiens.UCSC.hg19.knownGene) | |
library(clusterProfiler) | |
# Gene data from UCSC hg19 | |
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene | |
# Peak file in bed format (these are MACS files) | |
files <- getSampleFiles() | |
files |
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(GenomicDataCommons) | |
library(DESeq2) | |
library(ggplot2) | |
setwd("~/Projects/MYT1L_TCGA_project/") | |
############################################################################################### | |
# Vignette examples | |
# Check connectivity and functionality | |
GenomicDataCommons::status() |
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(GenomicRanges) | |
library(ggbio) | |
library(ChIPpeakAnno) | |
gr <- GRanges(seqnames = "NC_035082.1", IRanges(55355800, 55355870), strand = "*") | |
# Get methylation percents from metilene input and convert to GRanges object | |
input <- read.table("metilene_Control_Treated.input", sep = "\t", header = T, stringsAsFactors = F) | |
names(input)[1] <- "chr" | |
names(input)[2] <- "start" |
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(GenomicRanges) | |
library(ggbio) | |
library(IRanges) | |
set.seed(1) | |
N <- 1000 | |
gr <- GRanges(seqnames = | |
sample(c("chr1", "chr2", "chr3"), | |
size = N, replace = TRUE), | |
IRanges( |
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(Rsamtools) | |
library(rtracklayer) | |
library(Sushi) | |
# Draw raw alignment track for each bam file | |
setwd("~/Projects/Wiseman_Trout_RRBS/") | |
list.files("bam") | |
# Create TxDb object from GFF | |
chromInfo <- read.table("~/GENOMES/Rainbow_trout/GCF_002163495.1_Omyk_1.0_genomic.fa.fai", header = F, |
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(BSgenome) | |
## Create seed file with the following lines | |
# Package: BSgenome.Omykiss.NCBI.Omyk1 | |
# Title: Full genome sequences for Oncorhynchus mykiss (NCBI RefSeq version Omyk_1.0) | |
# Description: Full genome sequences for Oncorhynchus mykiss (Rainbow trout) as provided by MCBI (Omyk_1.0, 2017-6-2) and stored in Biostrings objects. | |
# Version: 1.0 | |
# organism: Oncorhynchus mykiss | |
# common_name: Rainbow trout | |
# provider: NCBI |
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(GenomicFeatures) | |
# Get chromInfo file | |
chromInfo <- read.table("~/GENOMES/Rainbow_trout/GCF_002163495.1_Omyk_1.0_genomic.fa.fai", header = F, | |
stringsAsFactors = F, sep = "\t") | |
head(chromInfo) | |
chromInfo <- chromInfo[,c(1,2)] | |
names(chromInfo) <- c("chrom", "length") | |
is_circular <- rep(FALSE, dim(chromInfo)[1]) |