XAM.jl icon indicating copy to clipboard operation
XAM.jl copied to clipboard

Export and document some more things?

Open phaverty opened this issue 7 years ago • 1 comments

First, thanks for this package! I made some functions for creating objects from my GenomicVectors.jl package using your BAM reader functions. I think I found the right functions.

Chromosome names and lengths: function GenomeInfo(name, reader::BioAlignments.BAM.Reader) GenomeInfo(name, reader.refseqnames, reader.refseqlens ) end

Chromosome name and alignment start and end positions: read_bam = function(bam_file) # iterate over BAM records
chr = String[] left_pos = Int64[] right_pos = Int64[] for record in reader push!(chr, BAM.refname(record)) push!(left_pos, leftposition(record)) push!(right_pos, rightposition(record)) end DataFrame(chr = chr, left = left_pos, right = right_pos) end

Should/could reader.refseqnames, reader.refseqlens and BAM.refname be exported? I'd be happy to add the exports, some docstrings and a bit of README text if you are open to it.

phaverty avatar Apr 18 '18 15:04 phaverty

I don't know about exporing the fields like reader.* should be exprted, but this package should certainly have some sort of getter method to provide a stable api for getting that info.

TransGirlCodes avatar Apr 18 '18 21:04 TransGirlCodes