Skip to content

Commit

Permalink
Use MIToS v3 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegozea authored Aug 16, 2024
1 parent 91e9021 commit bcc3e0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GPCRAnalysis"
uuid = "c1d73f9e-d42a-418a-8d5b-c7b00ec0358f"
authors = ["Tim Holy <[email protected]> and contributors"]
version = "0.4.2"
version = "0.4.3"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down Expand Up @@ -48,7 +48,7 @@ Interpolations = "0.15"
JSON3 = "1"
JuMP = "1"
LinearAlgebra = "1"
MIToS = "2"
MIToS = "3"
MultivariateStats = "0.9, 0.10"
MutableConvexHulls = "0.2"
OffsetArrays = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end
Read a PDB file `filename` and extract the specified chain.
"""
getchain(filename::AbstractString; model="1", chain="A") = read(filename, PDBFile; model, chain)
getchain(filename::AbstractString; model="1", chain="A") = read_file(filename, PDBFile; model, chain)

function validate_seq_residues(seq::AnnotatedAlignedSequence, chain::AbstractVector{PDBResidue})
for (i, r) in zip(getsequencemapping(seq), seq)
Expand Down
16 changes: 8 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ using Test
@testset "MSA" begin
# The test file is copied from MIToS/test/data, with gratitude
pf09645_sto = "PF09645_full.stockholm"
msa = read(pf09645_sto, MIToS.Pfam.Stockholm)
msa = MIToS.MSA.read_file(pf09645_sto, MIToS.Pfam.Stockholm)
@test MIToS.MSA.nsequences(filter_species!(deepcopy(msa), "ATV")) == 1
@test MIToS.MSA.nsequences(filter_long!(deepcopy(msa), 70)) == 3

Expand Down Expand Up @@ -137,7 +137,7 @@ using Test
D = [1 0 1 2 3; 3 2 1 0 1; 4 3 2 1 0; 5 4 3 2 1]
@test align_nw(D, gapcosts) == [(1, 2), (2, 3), (3, 4), (4, 5)]

opsd = read("AF-P15409-F1-model_v4.pdb", PDBFile)
opsd = read_file("AF-P15409-F1-model_v4.pdb", PDBFile)
opsd_tms = [37:61, 74:96, 111:133, 153:173, 203:224, 253:274, 287:308]
@test align_ranges(opsd, opsd, opsd_tms) == opsd_tms

Expand All @@ -153,7 +153,7 @@ using Test
testscore(S, P, D, gapcosts)
end
@testset "Pocket residues and features" begin
opsd = read("AF-P15409-F1-model_v4.pdb", PDBFile)
opsd = read_file("AF-P15409-F1-model_v4.pdb", PDBFile)
opsdr = [three2residue(r.id.name) for r in opsd]
# These are not quite accurate, from https://www.uniprot.org/uniprotkb/P15409/entry#subcellular_location
# the actual answer is
Expand Down Expand Up @@ -277,7 +277,7 @@ using Test
@test all(abs.(wF*ones(3)) .< 1e-7) # gradient is zero at the minimum even under re-tuning

interactions = [(:Steric, :Steric) => 1, (:Hydrophobe, :Hydrophobe) => -1, (:Donor, :Acceptor) => -1] # drop the ionic
opsd = read("AF-P15409-F1-model_v4.pdb", PDBFile)
opsd = read_file("AF-P15409-F1-model_v4.pdb", PDBFile)
opsd_tms = [37:61, 74:96, 111:133, 153:173, 203:224, 253:274, 287:308]
tm_res = inward_tm_residues(opsd, opsd_tms)
tm_idxs = reduce(vcat, [tm[idx] for (tm, idx) in zip(opsd_tms, tm_res)])
Expand Down Expand Up @@ -340,7 +340,7 @@ using Test
if !isfile(pfampath)
Pfam.downloadpfam("PF03402"; filename=pfampath)
end
msa = read(pfampath, MSA.Stockholm, generatemapping=true, useidcoordinates=true)
msa = MIToS.MSA.read_file(pfampath, MSA.Stockholm, generatemapping=true, useidcoordinates=true)
filter_species!(msa, "MOUSE")
# Make small enough for a decent download test
filtersequences!(msa, coverage(msa) .>= 0.9)
Expand Down Expand Up @@ -413,9 +413,9 @@ using Test
chimerafile = tempname() * ".cxc"
chimerax_script(chimerafile, ["K7N775", "K7N731"], msa, [66, 69]; dir=path)
script = read(chimerafile, String)
@test occursin("open $path/AF-K7N775", script)
@test occursin("open $path/AF-K7N731", script)
@test !occursin("open $path/AF-K7N701", script)
@test occursin("open $(joinpath(path, "AF-K7N775"))", script)
@test occursin("open $(joinpath(path, "AF-K7N731"))", script)
@test !occursin("open $(joinpath(path, "AF-K7N701"))", script)
@test occursin("show #1 :67", script)
@test occursin("show #1 :70", script)
@test occursin("show #2 :70", script)
Expand Down

0 comments on commit bcc3e0b

Please sign in to comment.