Skip to content

Commit

Permalink
Merge pull request #625 from diegozea/master
Browse files Browse the repository at this point in the history
Use MIToS v3
  • Loading branch information
kool7d authored Jul 13, 2024
2 parents 086059d + dcdd54d commit ed1e5d7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ ImageCore = "0.9, 0.10"
ImageShow = "0.3"
JSON3 = "1"
Lazy = "0.15"
MIToS = "2"
Makie = "0.21"
MIToS = "3"
Makie = "0.19, 0.20, 0.21"
Meshes = "0.46"
MolecularGraph = "0.13, 0.14, 0.15, 0.16"
OrderedCollections = "1.4"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ reader = open(FASTX.FASTA.Reader, "PF00062_full.fasta")
msa = [reader...] |> Observable
close(reader)
## or
using MIToS
using MIToS.MSA
msa = MIToS.MSA.read("pf00062.stockholm.gz", Stockholm)
msa = read_file("pf00062.stockholm.gz", Stockholm)

fig = plotmsa(msa; colorscheme = :tableau_blue_green)
```
Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ reader = open(FASTX.FASTA.Reader, "PF00062_full.fasta")
msa = [reader...] |> Observable
close(reader)
## or
using MIToS
using MIToS.MSA
msa = MIToS.MSA.read("pf00062.stockholm.gz", Stockholm)
msa = read_file("pf00062.stockholm.gz", Stockholm)

fig = plotmsa(msa; colorscheme = :tableau_blue_green)
```
Expand Down
6 changes: 2 additions & 4 deletions docs/src/msaselection.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ are plotted on the right.
## Copy-pastable code
````julia
using BioMakie
using MIToS
using MIToS.MSA, MIToS.Pfam
using GLMakie
using Lazy
downloadpfam("pf00062")
msa1 = MIToS.MSA.read("pf00062.stockholm.gz",Stockholm)
msa1 = read_file("pf00062.stockholm.gz",Stockholm)
msa2 = Observable(msa1)
plotdata = plottingdata(msa2)
fig = Figure(resolution = (1400,400))
Expand Down Expand Up @@ -61,7 +60,6 @@ xlims!(ax, (0, 23))
## Imports
````julia
using BioMakie
using MIToS
using MIToS.MSA, MIToS.Pfam
using GLMakie
using Lazy
Expand All @@ -72,7 +70,7 @@ Use MIToS to download a Pfam MSA, then prepare the plotting data.

````julia
downloadpfam("pf00062")
msa1 = MIToS.MSA.read("pf00062.stockholm.gz",Stockholm)
msa1 = read_file("pf00062.stockholm.gz",Stockholm)
msa2 = Observable(msa1)
plotdata = plottingdata(msa2)
````
Expand Down
4 changes: 2 additions & 2 deletions src/msa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ a Figure and Observables for interaction.
# Examples
```julia
MIToS.Pfam.downloadpfam("PF00062") # download PF00062 MSA
msa = MIToS.MSA.read("PF00062.stockholm.gz", Stockholm,
generatemapping =true, useidcoordinates=true)
msa = MIToS.MSA.read_file("PF00062.stockholm.gz", Stockholm,
generatemapping =true, useidcoordinates=true)
plotmsa( msa; kwargs... )
```
Expand Down
8 changes: 4 additions & 4 deletions src/otherplots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Plot a MIToS distance or contact map.
using MIToS.PDB
pdbfile = MIToS.PDB.downloadpdb("1IVO", format=PDBFile)
residues_1ivo = read(pdbfile, PDBFile)
pdb = @residues residues_1ivo model "1" chain "A" group "ATOM" residue All
residues_1ivo = read_file(pdbfile, PDBFile)
pdb = select_residues(residues_1ivo, model="1", chain="A", group="ATOM")
dmap = MIToS.PDB.distance(pdb, criteria="All") # distance map
cmap = contact(pdb, 8.0, criteria="CB") # contact map
Expand Down Expand Up @@ -66,8 +66,8 @@ fig = Figure()
using MIToS.PDB
pdbfile = MIToS.PDB.downloadpdb("1IVO", format=PDBFile)
residues_1ivo = read(pdbfile, PDBFile)
pdb = @residues residues_1ivo model "1" chain "A" group "ATOM" residue All
residues_1ivo = read_file(pdbfile, PDBFile)
pdb = select_residues(residues_1ivo, model="1", chain="A", group="ATOM")
dmap = MIToS.PDB.distance(pdb, criteria="All") # distance map
cmap = contact(pdb, 8.0, criteria="CB") # contact map
Expand Down
16 changes: 8 additions & 8 deletions src/structure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ fig = Figure()
using MIToS.PDB
pdbfile = MIToS.PDB.downloadpdb("2vb1")
struc = MIToS.PDB.read(pdbfile, PDBML) |> Observable
pdbfile = MIToS.PDB.downloadpdb("2vb1", format=PDBFile)
struc = MIToS.PDB.read_file(pdbfile, PDBFile) |> Observable
strucplot = plotstruc!(fig, struc)
chain_A = @residues struc model "1" chain "A" group "ATOM" residue All
chain_A = select_residues(struc, model="1", chain="A", group="ATOM")
strucplot = plotstruc!(fig, chain_A)
chnatms = @atoms struc model "1" chain "A" group "ATOM" residue All atom All
chnatms = select_atoms(struc, model="1", chain="A", group="ATOM")
strucplot = plotstruc!(fig, chnatms)
-------------------------
using BioStructures
Expand Down Expand Up @@ -1135,14 +1135,14 @@ Create and return a Makie Figure for a protein structural element.
```julia
using MIToS.PDB
pdbfile = MIToS.PDB.downloadpdb("2vb1")
struc = MIToS.PDB.read(pdbfile, PDBML) |> Observable
pdbfile = MIToS.PDB.downloadpdb("2vb1", format=PDBFile)
struc = MIToS.PDB.read_file(pdbfile, PDBFile) |> Observable
strucplot = plotstruc(struc)
chain_A = @residues struc model "1" chain "A" group "ATOM" residue All
chain_A = select_residues(struc, model="1", chain="A", group="ATOM")
strucplot = plotstruc(chain_A)
chnatms = @atoms struc model "1" chain "A" group "ATOM" residue All atom All
chnatms = select_atoms(struc, model="1", chain="A", group="ATOM")
strucplot = plotstruc(chnatms)
-------------------------
using BioStructures
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ firstvalue(dict::AbstractDict) = first(values(dict))
@test atmcolors[][end] == RGB{Float64}(0.65,0.96,0.7)

# MIToS
struc = MIToS.PDB.read("$(dir)/2VB1.pdb", MIToS.PDB.PDBFile);
chn = MIToS.PDB.@residues struc model "1" chain "A" group "ATOM" residue All
atms = MIToS.PDB.@atoms chn model "1" chain "A" group "ATOM" residue All atom All
struc = MIToS.PDB.read_file("$(dir)/2VB1.pdb", MIToS.PDB.PDBFile);
chn = MIToS.PDB.select_residues(struc, model="1", chain="A", group="ATOM")
atms = MIToS.PDB.select_atoms(chn, model="1", chain="A", group="ATOM")
struc_obs = Observable(struc);
chn_obs = Observable(chn);
atms_obs = Observable(atms);
Expand Down Expand Up @@ -252,7 +252,7 @@ end
@testset "MSA plotting" begin
# MIToS
downloadpfam("pf00062")
msa1 = MIToS.MSA.read("pf00062.stockholm.gz",Stockholm)
msa1 = MIToS.MSA.read_file("pf00062.stockholm.gz",Stockholm)
@test size(msa1) == (3023, 123)
@test length(msa1.annotations.sequences) == 3023
plotdata = plottingdata(msa1)
Expand Down

0 comments on commit ed1e5d7

Please sign in to comment.