This is a read-only mirror of pymolwiki.org
Difference between revisions of "Create"
Jump to navigation
Jump to search
RuneKidmose (talk | contribs) |
|||
Line 1: | Line 1: | ||
− | |||
'''create''' creates a new molecule object from a selection. It can also be used to create states in an existing object. | '''create''' creates a new molecule object from a selection. It can also be used to create states in an existing object. | ||
'''NOTE''': this command has not yet been throughly tested. | '''NOTE''': this command has not yet been throughly tested. | ||
Line 27: | Line 26: | ||
=== User Comments/Examples === | === User Comments/Examples === | ||
+ | ===EXAMPLES=== | ||
+ | <source lang="python"> | ||
+ | # merging two multi-state objects with the create command | ||
+ | # obj1 has 25 states and obj2 has 40 states | ||
+ | |||
+ | load multi_state_obj1, obj1 | ||
+ | load multi_state_obj2, obj2 | ||
+ | |||
+ | # merge the two multi-state objects back to back into obj3 | ||
+ | # 0 indicates every states from obj1 should be included | ||
+ | # 1 indicates that the first state of obj3 is the first state from obj1 etc. | ||
+ | |||
+ | create obj3, obj1, 0, 1 | ||
+ | |||
+ | # as obj1 has 25 states, the first state of obj2 must be state 26 to create a multi-state object of obj1 and obj2 back-to-back | ||
+ | # 26 indicates that the 26th state of obj3 is state nr. 1 of obj2 etc. | ||
+ | |||
+ | create obj3, obj2, 0, 26 | ||
+ | |||
+ | # Obj3 now has 65 states (25 from obj1 and 40 from obj2) | ||
+ | # save obj3 as a multi-state pdb file | ||
+ | # use state=0 to get all states into one pdb file | ||
+ | |||
+ | save obj3.pdb, obj3, state=0 | ||
+ | </source> | ||
[[Category:Commands|Create]] | [[Category:Commands|Create]] | ||
[[Category:States|Create]] | [[Category:States|Create]] | ||
[[Category:Editing Module|Create]] | [[Category:Editing Module|Create]] |
Revision as of 23:42, 11 February 2013
create creates a new molecule object from a selection. It can also be used to create states in an existing object. NOTE: this command has not yet been throughly tested.
USAGE
create name, (selection) [,source_state [,target_state ] ]
create name = (selection) [,source_state [,target_state ] ] # (DEPRECATED)
- name = object to create (or modify)
- selection = atoms to include in the new object
- source_state (default: 0 - copy all states)
- target_state (default: 0)
PYMOL API
cmd.create(string name, string selection, int state, int target_state,int discrete)
NOTES
If the source and target states are zero (default), all states will be copied. Otherwise, only the indicated states will be copied.
SEE ALSO
User Comments/Examples
EXAMPLES
# merging two multi-state objects with the create command
# obj1 has 25 states and obj2 has 40 states
load multi_state_obj1, obj1
load multi_state_obj2, obj2
# merge the two multi-state objects back to back into obj3
# 0 indicates every states from obj1 should be included
# 1 indicates that the first state of obj3 is the first state from obj1 etc.
create obj3, obj1, 0, 1
# as obj1 has 25 states, the first state of obj2 must be state 26 to create a multi-state object of obj1 and obj2 back-to-back
# 26 indicates that the 26th state of obj3 is state nr. 1 of obj2 etc.
create obj3, obj2, 0, 26
# Obj3 now has 65 states (25 from obj1 and 40 from obj2)
# save obj3 as a multi-state pdb file
# use state=0 to get all states into one pdb file
save obj3.pdb, obj3, state=0