[BioC] ChiPseq input files?
Jonathan Cairns
Jonathan.Cairns at cancer.org.uk
Mon Sep 17 16:38:05 CEST 2012
Hi John,
I would try the Rsamtools package. You'd need something like this (warning, untested code):
library(Rsamtools)
bamFile = "path/to/Bamfile.bam"
p <- ScanBamParam(what=c("rname", "strand", "pos", "qwidth"))
bam <- scanBam(bamFile, param=p)[[1]]
BayesPeak accepts data.frames or RangedDatas. I would suggest the easiest thing to do is construct a RangedData:
library(IRanges)
IR <- IRanges(start=bam[["pos"]], width=bam[["qwidth"]])
x <- RangedData(ranges=IR, strand=bam[["strand"]], space=bam[["rname"]])
chipseq accepts GRanges by preference:
library(GenomicRanges)
y <- GRanges(seqnames=bam[["rname"]], ranges=IR, strand=bam[["strand"]])
There may be a faster/cleverer way of doing it, but this should work.
Jonathan
________________________________________
From: bioconductor-bounces at r-project.org [bioconductor-bounces at r-project.org] On Behalf Of John linux-user [johnlinuxuser at yahoo.com]
Sent: 17 September 2012 15:04
To: bioconductor at r-project.org
Subject: [BioC] ChiPseq input files?
Hi,
I am wondering how to simply prepare the input files for R BayesPeak and chipseq packages, assuming BAM files already generated by BWA and samtools. Thanks.
John
[[alternative HTML version deleted]]
NOTICE AND DISCLAIMER
This e-mail (including any attachments) is intended for ...{{dropped:17}}
More information about the Bioconductor
mailing list