From f517d42d7c4fc4080f7a0fb45bc131fdb659f100 Mon Sep 17 00:00:00 2001 From: Alex Bartlett Date: Thu, 19 Sep 2024 13:56:33 -0400 Subject: [PATCH] begin diffbind templates --- DESCRIPTION | 0 LICENSE | 0 LICENSE.md | 0 NAMESPACE | 0 NEWS.md | 0 README.md | 0 _pkgdown.yml | 0 .../diffbind/chipseq_peakanalysis_H3K27Ac.csv | 25 ++++++++++++++++++ .../diffbind/params_diffbind-example.R | 8 ++++++ inst/templates/chipseq/information.R | 0 inst/templates/chipseq/libs/load_data.R | 0 .../chipseq/libs/make_diffbind_samplesheet.R | 26 +++++++++++++++++++ inst/templates/chipseq/readme.md | 0 13 files changed, 59 insertions(+) mode change 100644 => 100755 DESCRIPTION mode change 100644 => 100755 LICENSE mode change 100644 => 100755 LICENSE.md mode change 100644 => 100755 NAMESPACE mode change 100644 => 100755 NEWS.md mode change 100644 => 100755 README.md mode change 100644 => 100755 _pkgdown.yml create mode 100644 inst/templates/chipseq/diffbind/chipseq_peakanalysis_H3K27Ac.csv create mode 100644 inst/templates/chipseq/diffbind/params_diffbind-example.R mode change 100644 => 100755 inst/templates/chipseq/information.R mode change 100644 => 100755 inst/templates/chipseq/libs/load_data.R create mode 100755 inst/templates/chipseq/libs/make_diffbind_samplesheet.R mode change 100644 => 100755 inst/templates/chipseq/readme.md diff --git a/DESCRIPTION b/DESCRIPTION old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/NAMESPACE b/NAMESPACE old mode 100644 new mode 100755 diff --git a/NEWS.md b/NEWS.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/_pkgdown.yml b/_pkgdown.yml old mode 100644 new mode 100755 diff --git a/inst/templates/chipseq/diffbind/chipseq_peakanalysis_H3K27Ac.csv b/inst/templates/chipseq/diffbind/chipseq_peakanalysis_H3K27Ac.csv new file mode 100644 index 0000000..9686e20 --- /dev/null +++ b/inst/templates/chipseq/diffbind/chipseq_peakanalysis_H3K27Ac.csv @@ -0,0 +1,25 @@ +sample,fastq_1,fastq_2,antibody,control,genotype +WT_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780292_SRR6823782.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP1,WT +WT_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780292_SRR6823783.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP1,WT +WT_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780292_SRR6823784.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP1,WT +WT_H3K27ac_input_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780293_SRR6823785.fastq.gz,,,,WT +WT_H3K27ac_input_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780293_SRR6823786.fastq.gz,,,,WT +WT_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780294_SRR6823787.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP2,WT +WT_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780294_SRR6823788.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP2,WT +WT_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780294_SRR6823789.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP2,WT +WT_H3K27ac_input_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780295_SRR6823790.fastq.gz,,,,WT +WT_H3K27ac_input_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780295_SRR6823791.fastq.gz,,,,WT +WT_H3K27ac_ChIPseq_REP3,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780296_SRR6823792.fastq.gz,,H3K27ac,WT_H3K27ac_input_REP3,WT +WT_H3K27ac_input_REP3,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780297_SRR6823793.fastq.gz,,,,WT +cKO_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780298_SRR6823794.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP1,cKO +cKO_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780298_SRR6823795.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP1,cKO +cKO_H3K27ac_ChIPseq_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780298_SRR6823796.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP1,cKO +cKO_H3K27ac_input_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780299_SRR6823797.fastq.gz,,,,cKO +cKO_H3K27ac_input_REP1,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780299_SRR6823798.fastq.gz,,,,cKO +cKO_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780300_SRR6823799.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP2,cKO +cKO_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780300_SRR6823800.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP2,cKO +cKO_H3K27ac_ChIPseq_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780300_SRR6823801.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP2,cKO +cKO_H3K27ac_input_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780301_SRR6823802.fastq.gz,,,,cKO +cKO_H3K27ac_input_REP2,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780301_SRR6823803.fastq.gz,,,,cKO +cKO_H3K27ac_ChIPseq_REP3,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780302_SRR6823804.fastq.gz,,H3K27ac,cKO_H3K27ac_input_REP3,cKO +cKO_H3K27ac_input_REP3,s3://hcbc-seqera/results/sra_peakanalysis_GSE111661/fastq/SRX3780303_SRR6823805.fastq.gz,,,,cKO \ No newline at end of file diff --git a/inst/templates/chipseq/diffbind/params_diffbind-example.R b/inst/templates/chipseq/diffbind/params_diffbind-example.R new file mode 100644 index 0000000..3ddfd56 --- /dev/null +++ b/inst/templates/chipseq/diffbind/params_diffbind-example.R @@ -0,0 +1,8 @@ +# info params + + +# Example data +coldata_fn='chipseq_peakanalysis_H3K27Ac.csv' +peaks_dir = '~/s3_results/chipseq_peakanalysis_h3k27ac_narrow/bowtie2/mergedLibrary/macs2/narrowPeak/' +bam_dir = '~/s3_results/chipseq_peakanalysis_h3k27ac_narrow/bowtie2/mergedLibrary/' +peak_caller = 'macs' \ No newline at end of file diff --git a/inst/templates/chipseq/information.R b/inst/templates/chipseq/information.R old mode 100644 new mode 100755 diff --git a/inst/templates/chipseq/libs/load_data.R b/inst/templates/chipseq/libs/load_data.R old mode 100644 new mode 100755 diff --git a/inst/templates/chipseq/libs/make_diffbind_samplesheet.R b/inst/templates/chipseq/libs/make_diffbind_samplesheet.R new file mode 100755 index 0000000..7a68bd3 --- /dev/null +++ b/inst/templates/chipseq/libs/make_diffbind_samplesheet.R @@ -0,0 +1,26 @@ +library(tidyverse) +library(tools) + +source('../libs/load_data.R') +source('params_diffbind-example.R') + +coldata <- load_coldata(coldata_fn) + +bam_files <- data.frame(bam = list.files(bam_dir, pattern = '.bam$', full.names = T)) %>% + mutate(sample = sub("\\..*", "",basename(bam))) + +peak_files <- data.frame(Peaks = list.files(peaks_dir, pattern = 'Peak$', full.names = T)) %>% + mutate(SampleID = sub("\\..*", "",basename(Peaks))) %>% + mutate(SampleID = gsub('_peaks', '', SampleID)) + +coldata_for_diffbind <- coldata %>% + filter(!is.na(control) & control != '') %>% + # select(-description) %>% + dplyr::rename(ControlID = control, SampleID = sample) %>% + separate(SampleID, into = c('sample', 'Replicate'), remove = F, sep = '_REP') %>% + mutate(peakCaller = peak_caller) + +samplesheet <- coldata_for_diffbind %>% + left_join(bam_files %>% select(SampleID = sample, bamReads = bam), by = 'SampleID') %>% + left_join(bam_files %>% select(ControlID = sample, bamControl = bam), by = 'ControlID') %>% + left_join(peak_files, by = 'SampleID') diff --git a/inst/templates/chipseq/readme.md b/inst/templates/chipseq/readme.md old mode 100644 new mode 100755