This is a read-only mirror of pymolwiki.org

Difference between revisions of "Create"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(14 intermediate revisions by 8 users not shown)
Line 1: Line 1:
===DESCRIPTION===
+
'''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.
 
 
 
===USAGE===
 
===USAGE===
 
<source lang="python">
 
<source lang="python">
create name, (selection) [,source_state [,target_state ] ]
+
create name, (selection) [, source_state [, target_state ]]
 +
</source>
 +
 
 +
* name = object to create (or modify)
 +
* selection = atoms to include in the new object
 +
* source_state (default: 0 - copy all states)
 +
* target_state = int: -1 appends after last state {default: 0}
  
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)
 
</source>
 
 
 
===PYMOL API===
 
===PYMOL API===
<source lang="python">  
+
<source lang="python">
  cmd.create(string name, string selection, int state, int target_state,int discrete)
+
cmd.create(string name, string selection, int source_state, int target_state,int discrete)
 
</source>
 
</source>
  
 
===NOTES===
 
===NOTES===
+
If the source and target states are zero (default), all states will be copied.  Otherwise, only the indicated states will be copied.
  If the source and target states are zero (default), all states will
 
  be copied.  Otherwise, only the indicated states will be copied.
 
 
===SEE ALSO===
 
 
  [[Cmd load|load]], [[Cmd copy|copy]]
 
  
 +
Target state -1 will append new states.
  
 
=== 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>
 +
 +
===SEE ALSO===
 +
[[Fuse]], [[load]], [[copy]], [[Extract]]
  
[[Category:Commands|create]]
+
[[Category:Commands|Create]]
 +
[[Category:States|Create]]
 +
[[Category:Editing Module|Create]]

Latest revision as of 03:23, 29 April 2019

create creates a new molecule object from a selection. It can also be used to create states in an existing object.

USAGE

create name, (selection) [, source_state [, target_state ]]
  • name = object to create (or modify)
  • selection = atoms to include in the new object
  • source_state (default: 0 - copy all states)
  • target_state = int: -1 appends after last state {default: 0}

PYMOL API

cmd.create(string name, string selection, int source_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.

Target state -1 will append new states.

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

SEE ALSO

Fuse, load, copy, Extract