-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathread-chip-bams.R
executable file
·27 lines (20 loc) · 1.12 KB
/
read-chip-bams.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env Rscript
#Turning off warning messages for loading the packages-globally
options(warn=-1)
suppressMessages(require(Repitools))
#Turn warnings back on
options(warn=0)
args <- commandArgs(trailingOnly=TRUE)
#Directory to search for the chip and input bam files
bam.dir <- args[1]
prefix <- args[2]
paths <- list.files("/nfs/research2/bertone/user/mxenoph/hendrich/enhancers/hendrichChIP/bowtie", pattern="*E12_2i.*sort.bam", full.name=T)
paths <- c(paths, list.files("/nfs/research2/bertone/user/mxenoph/hendrich/enhancers/hendrichChIP/bowtie", pattern="*E12.*Input.bam", full.name=T))
grL <- BAM2GRangesList(paths)
names(grL) <- paths
#save(grL, file= "/nfs/nobackup2/research/bertone/mxenoph/bh/ChIP-Epi/mm9/bowtie/bam2grList.Rdata")
save(grL, file= "/nfs/nobackup2/research/bertone/mxenoph/bh/ChIP-Epi/mm9/bowtie/2ibam2grList.Rdata")
#paths <- list.files("/nfs/research2/bertone/user/mxenoph/hendrich/enhancers/hendrichChIP/bowtie", pattern="*E12_2i.*sort.bam", full.name=T)
#grL <- BAM2GRangesList(paths)
#names(grL) <- paths
#save(grL, file= "/nfs/nobackup2/research/bertone/mxenoph/bh/ChIP-Epi/mm9/bowtie/2ibam2grList.Rdata")