I want to change the segid name of topology(in pdb format) and gromacs trajectory. To later generate a new topology and trajectory with the changed names. Do you know a way to do this in gromacs or vmd?
You can use psfgen of VMD for this. Just execute below command in a tcl script or in tk console.
Just seperate the parts of your pdb that you want to change for instance according to residue numbers or whatever you wantç
mol load pdb yours.pdb
set a [atomselect top "resid 1 to 30"]
set b [atomselect top "resid 30 to 60"]
$a writepdb blabla.pdb
$b writepdb otherblabla.pdb
Then just merge them with psfgen using segment command. That will change the name of your segments in the created pdb and structure files. You can also change the residue names with the topology alias and pdb alias.
package require psfgen
topology top_all27_prot_lipid.inp
#topology alias
#pdbalias residue
segment segmentname {pdb blabla.pdb}
coordpdb blabla.pdb segmentname
segment segmentname2 {pdb otherblabla.pdb}
coordpdb otherblabla.pdb segmentname2
guesscoord
writepdb final.pdb
writepsf final.psf
If you perform the simulations with these files the changes you have made here will be also in your trajectory files