Comments (5)
for domain_ddd in readlines("$index_dir/$pdb_name-$model_num-$chain_id-domain.info")
domain_id = split(domain_ddd,":")[1]
domain_vec = split(domain_ddd,":")[2]
com_id = 0
domain_selection = []
for domain_range in split(domain_vec,",")
frag_N = parse(Int64,split(domain_range,"-")[1])
frag_C = parse(Int64,split(domain_range,"-")[2])
for resi in frag_N:frag_C
push!(domain_selection, resi)
end
end
domain_str = collectresidues(chain, res -> resnumber(res) in domain_selection , allselector)
writepdb("$output_dir/$pdb_name-$model_num-$chain_id-$domain_id.pdb", domain_str)
end
It works now! Thanks, Greener~
from biostructures.jl.
Yes you can do it as you have by using ||
in the selector. You can merge selections by defining them as functions:
selector1(res) = 13 <= resnumber(res) <= 436
selector2(res) = 504 <= resnumber(res) <= 534
combinedselector(res) = selector1(res) || selector2(res)
domain = collectresidues(chain, combinedselector)
I deleted the allselector
as it doesn't do anything here.
from biostructures.jl.
yeah, I have found this method about ||
.
and I wanna select many fragments and merge them into one domain.
firstly, I test it in REPL:
for domain_range in split(domain_vec,",")
frag_N = parse(Int64,split(domain_range,"-")[1])
frag_C = parse(Int64,split(domain_range,"-")[2])
( length(domain_selection) == 0 ) && (domain_selection = "($frag_N <= resnumber(res) <= $frag_C)" )
( length(domain_selection) == 0 ) || (domain_selection = "$(domain_selection) || ( $frag_N <= resnumber(res) <= $frag_C)" )
end
println(domain_selection)
# (13 <= resnumber(res) <= 436) || ( 13 <= resnumber(res) <= 436) || ( 504 <= resnumber(res) <= 534) || ( 655 <= resnumber(res) <= 682)
domain_str = collectresidues(chain, res -> ("$(domain_selection)"), allselector)
writepdb("$output_dir/$pdb_name-$model_num-$chain_id-$domain_id.pdb", domain_str)
however, an error occured that:
nested task error: TypeError: non-boolean (var"#12#13") used in boolean context
I think that it may be caused by the inappropriate statement construction. Even after I replace the res -> ("$(domain_selection)")
to Meta.parse("res -> (\"$(domain_selection)\")") |> eval
or res -> ( eval(domain_selection) )
, it still doesn't work....
from biostructures.jl.
I would just form a Vector
or Set
of all residue numbers in the domain (domain_res
) and then do:
domain_selector(res) = resnumber(res) in domain_res
from biostructures.jl.
wow, a great idea!
from biostructures.jl.
Related Issues (15)
- BioStructures fails to parse certain PDB files from SCOPe/ASTRAL archive HOT 1
- Create a ContactMap from a BitArray HOT 3
- Error using BioStructures, no "libz1" module found HOT 2
- Request for symmetries HOT 2
- Suggestion: Make structural elements mutable HOT 7
- MMCIF reader parsing mistakes, some keys are missing / corrupted HOT 3
- Secondary Structure Information HOT 7
- convert pdb to mol HOT 2
- MMCIF reading error
- export fixlists! HOT 1
- Strip whitespaces from atom/element names HOT 1
- Feature suggestion: support BinaryCIF file format HOT 1
- failing to read PDB files generated by VMD
- x, y, z seem too generic to export
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biostructures.jl.