On 05/31/2011 05:42 AM, David A. wrote:
Hi, I would like to load my paired-end bam file for TEQC using the TEQC library. In the manual it says that the bed file needed for paired-end reads should contain read pair ID. How can I get this format? Some bam2bed converters I know only give the three main columns, and if I am not wrong the BEDPE format is too ample.
Hi Dave -- I haven't used TEQC (looks good, though) but since its get.reads function returns a RangedData object with mate pairs as successive rows (from example(get.reads); reads) it seems like this could be constructed directly from your bam file using Rsamtools::scanBam and IRanges::RangedData. I think you'll start with something like
param <- ScanBamParam(flag=scanBamFlag(isProperPair=TRUE), what=c("qname", "pos", "qwidth", "rname")) aln = scanBam(fl, param=param)[[1]] rd = with(aln, RangedData(IRanges(pos, width=qwidth), ID=qname, space=rname)) rd[order(rd$space, rd$ID)] Martin
Any help would be greatly appreciated Cheers, Dave [[alternative HTML version deleted]] _______________________________________________ Bioc-sig-sequencing mailing list Bioc-sig-sequencing@r-project.org https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
-- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793 _______________________________________________ Bioc-sig-sequencing mailing list Bioc-sig-sequencing@r-project.org https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing