Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find() instead of findall() in hts-files.md #28

Open
aalexandersson opened this issue Feb 6, 2019 · 0 comments
Open

find() instead of findall() in hts-files.md #28

aalexandersson opened this issue Feb 6, 2019 · 0 comments

Comments

@aalexandersson
Copy link

There seems to be a typo in the file BioAlignments.jl/docs/src/hts-files.md

Expected Behavior

I expected this code to work in Julia 1.1.0:

find(header(reader), "SQ")

I suggest to use findall() instead of find(), like this:

findall(header(reader), "SQ")

Current Behavior

The current code gives this error:

UndefVarError: find not defined

The suggested change instead results in this:

2-element Array{BioAlignments.SAM.MetaInfo,1}:
 BioAlignments.SAM.MetaInfo:
    tag: SQ
  value: SN=chr1 LN=1575
 BioAlignments.SAM.MetaInfo:
    tag: SQ
  value: SN=chr2 LN=1584

Possible Solution / Implementation

Replace find() with findall() for Julia 1.x.

Steps to Reproduce (for bugs)

Download the file ex1_header.sam, then run this code in Atom

using BioAlignments
reader = open(SAM.Reader, "ex1_header.sam");
find(header(reader), "SQ")

Context

Obviously, I am a Julia beginner. I am trying to learn how to read a SAM file and a BAM file using BioAlignments. The documentation refers to "data.sam" and "data.bam" which are only generic hypothetical files. I would like to have a fully reproducible example with a real file instead such as ex1_header.sam from https://github.com/BioJulia/BioFmtSpecimens/tree/master/SAM

I tried to add Bio but received this error message:

(v1.1) pkg> add Bio
  Updating registry at `C:\Users\aalexandersson\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Bio [3637df68]:
 Bio [3637df68] log:
 ├─possible versions are: [0.1.0, 0.2.0-0.2.3, 0.3.0, 0.4.0-0.4.7] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.1.0, 0.2.0-0.2.3, 0.3.0, 0.4.0-0.4.7]
 └─restricted by julia compatibility requirements to versions: uninstalled - no versions left

Then I successfully installed BioAlignments individually.

Your Environment

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7 CPU         870  @ 2.93GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, nehalem)
Environment:
  JULIA_EDITOR = "C:\Users\aalexandersson\AppData\Local\atom\app-1.29.0\atom.exe" -a
  JULIA_NUM_THREADS = 4
(v1.1) pkg> status
    Status `C:\Users\aalexandersson\.julia\environments\v1.1\Project.toml`
  [c52e3926] Atom v0.7.14
  [9e28174c] BinDeps v0.8.10
  [00701ae9] BioAlignments v1.0.0
  [37cfa864] BioCore v2.0.5
  [7e6ae17a] BioSequences v1.1.0
  [159f3aea] Cairo v0.5.6
  [34da2185] Compat v1.5.1
  [a93c6f00] DataFrames v0.17.0
  [186bb1d3] Fontconfig v0.2.0
  [c91e804a] Gadfly v1.0.1
  [c43c736e] Genie v0.1.0 #master (https://github.com/essenciary/Genie.jl)
  [e5e0dc1b] Juno v0.5.4
  [ce6b1742] RDatasets v0.6.1
  [b8865327] UnicodePlots v1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant