Hi Anasuya,

You can make the selections in PyMOL and save each chain separately. But if
you have to do batch processing, you're probably better off using sed:

sed -n "/^.\{21\}P/p" 1a55.pdb > 1a55_P.pdb
sed -n "/^.\{21\}Q/p" 1a55.pdb > 1a55_Q.pdb
sed -n "/^.\{21\}R/p" 1a55.pdb > 1a55_R.pdb

To automate completely, you can do (in bash):

pdb=1a55.pdb
for chain in $(grep "^ATOM" $pdb | cut -b 22 | sort -u); do sed -n
"/^.\{21\}$chain/p" $pdb > ${pdb%.pdb}_$chain.pdb; done

You can make that a small script, like 'chains.sh', containing:


#!/bin/bash
pdb=$1
for chain in $(grep "^ATOM" $pdb | cut -b 22 | sort -u)
do
    sed -n "/^.\{21\}$chain/p" $pdb > ${pdb%.pdb}_$chain.pdb
done


That script you can run giving a pdb file as argument.

Hope it helps,

Tsjerk




On Thu, Apr 4, 2013 at 12:19 PM, Anasuya Dighe <anas...@mbu.iisc.ernet.in>wrote:

> Hello,
>
> I wanted to know if its possible in PyMOL to split a PDB file with multiple
> chains,into its component chains and make smaller PDB files corresponding
> to
> each chain.
>
> For eg: I have a pdb file, 1a55.pdb, having chains P,Q and R. How do I make
> split it to separate components like 1a55_P.pdb, 1a55_Q.pdb, 1a55_R.pdb
>
> Also, in case I have a large number of multiple chain PDB files, how could
> I go
> about splitting each of them?
>
> Please help.
>
>  - Anasuya Dighe
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>



-- 
Tsjerk A. Wassenaar, Ph.D.
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to