[BioC] BAM files to Genomic Ranges object

Hervé Pagès hpages at fhcrc.org
Mon Jan 14 21:10:58 CET 2013


Hi Dario,

On 01/10/2013 05:00 PM, Dario Strbenac wrote:
>> That code looks correct, but I would rather do:
>>
>>    bam_files <- list.files(pattern="*.bam")
>>    gr_list <- lapply(bam_files,
>>                      function(bam_file)
>>                        as(readGappedAlignments(bam_file), "GRanges"))
>>    names(gr_list) <- bam_files
>
> Is it possible to add an option to the coercion to keep the metadata columns ? For example, if the user specifies they also want to read the quality scores, the coercion to GRanges currently discards that.

Because of its syntax, coercion doesn't allow additional options.
So I could modify the coercion method to propagate the metadata cols.
Given that the names are propagated, it probably make sense to also
propagate the metadata cols.

Note that the coercion method from GappedAlignments to GRanges is
just calling the granges() getter with no args. I think I should add
the 'use.names' and 'use.mcols' args to this one to let the user
control whether or not propagate the names and/or metadata cols.

Cheers,
H.

>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list