BioJulia / Bio.jl

[DEPRECATED] Bioinformatics and Computational Biology Infrastructure for Julia
http://biojulia.dev
MIT License
261 stars 65 forks source link

Bio.Align to read bam file Julia 0.6.2 #491

Closed rgate closed 6 years ago

rgate commented 6 years ago

I think there is a syntax discrepancy between either Julia versions or Bio.jl versions and I can't figure out which is correct

tried following example on https://github.com/BioJulia/Bio.jl/blob/master/docs/src/man/alignments.md

julia> reader = open(BAM.Reader, bam_input) ERROR: UndefVarError: BAM not defined

but this seems to work julia> reader = open(BAMReader, bam_input) Bio.Align.BAMReader{IOStream}: header keys: SQ, PG, HD number of contigs: 8

and if I run this example command I get an error, but not sure where to help it find "BAM" julia> for record in reader

record is a BAM.Record object

       if BAM.ismapped(record)
           # print mapped position
           println(BAM.refname(record), ':', BAM.position(record))
       end
   end

ERROR: UndefVarError: BAM not defined

Goal: I'd like to be able to extract the read name and sequence from each read and substring the sequence. thank you!

rgate commented 6 years ago

change "BAM" to "Bio.Align"