I am using a script to create a psf file in VMD, then I hope use this psf file in namd. But the program generates a fault (photography).
My system is a protein dimer: chain A (15-501), chain B (425-676) with 2 Magnesium molecules and 1 CPF ligand.
I separated the protein in 2 pdb because I thought the program confused a segment of chains (425-501), however I still have the same fault.
*The fault was generated after the command line ''coordpdb myfilefrag${chain}.pdb ; # Assign coordinates from segment PDB''
*Also, the final psf file have neither the chain B nor the manesium ion . I wrote coordpdb myfilefrag${chain}.pdb P, but the psf file and pdb file do no have the chain B.
My script is :
package require psfgen ; # Load the psfgen plugin
topology top_all36_prot.rtf ; # Load CHARMM36 (charmm-gui)
topology top_all36_cgenff.rtf ; # Load CGenFF (charmm-gui)
topology cpf_e.str ; # Load drug parameters (charmm-gui)
topology toppar_water_ions.str ; # Load TIP3P/ions (charmm-gui)
pdbalias residue P3M TIP3 ; # Interpret water as TIP3P
mol new cpf_e.mol2 type mol2 waitfor all ; # Load MOL2
set drug [atomselect top "resname CPF677"] ; # Select drug molecule
$drug set segname L ; # Assign segname for psfgen
$drug writepdb CPF2.pdb ; # Write segment PDB
mol new 5btc_chains.pqr type pqr waitfor all ; # Load PQR
### PROTEIN
set protein [atomselect top "protein"] ; # Select protein
set chains [lsort -unique [$protein get pfrag]]
foreach chain $chains {set sel [atomselect top "pfrag $chain"]; $sel writepdb myfilefrag${chain}.pdb}
#$protein set segname P ; # Assign segname for psfgen
#$protein writepdb 5BTC.pdb ; # Write segment PDB
segment P {pdb myfilefrag${chain}.pdb;first NTER;last CTER} ; # Build protein segment
regenerate angles dihedrals ; # Critical after patching
coordpdb myfilefrag${chain}.pdb ; # Assign coordinates from segment PDB
### DRUG
pdbalias residue CPF6 CPF677 ; # Interpret CPF6 as CPF677
segment L {pdb CPF2.pdb} ; # Build drug segment; # From segment PDB
coordpdb CPF2.pdb ; # Assign coordinates from segment PDB
### CRYSTALLOGRAPHIC WATER
set water [atomselect top "resname P3M"] ; # Select water
$water set segname W ; # Assign segname for psfgen
$water writepdb W0.pdb ; # Write segment PDB
segment W {pdb W0.pdb} # Build water; # From segment PDB
coordpdb W0.pdb ; # Assign coordinates from segment PDB
writepsf P_L_pH7.psf ; # Output PSF
writepdb P_L_pH7.pdb ; # Output PDB