2
« on: March 05, 2012, 02:48:05 am »
Hi!
Thank you Dr. Xiang-Jun for such a detailed reply. I used the x3dna2charmm_pdb script and modified it as follows:
...........................................................
#!/usr/bin/env perl
use strict;
use warnings;
## This is utility Perl script, intially written by Dr. Xiang-Jun for converting 3DNA generated PDB file
## to CHARMM acceptable format, has been modified for converting to that accepted by HADDOCK.
## Please note that this script may not be that sophisticated, since I
## know little about the specifications of the HADDOCK PDB format.
## Please let me know if you find any bug in it.
die "Usage: $0 3DNA_generated_PDB converted_PDB\n" unless @ARGV == 2;
my $x3dna_pdb = $ARGV[0];
my $charmm_pdb = $ARGV[1];
open( FH, "$x3dna_pdb" ) || die "Can't open <$x3dna_pdb> for reading: $!\n";
open( FO, ">$charmm_pdb" ) || die "Can't open <$charmm_pdb> for writing: $!\n";
while (<FH>) {
if (/^ATOM/) {
chomp;
# expand this list as necessary ...
my %one2three = (
' A' => 'ADE',
' C' => 'CYT',
' G' => 'GUA',
' T' => 'THY'
);
my $residue = substr( $_, 17, 3 );
substr( $_, 17, 3 ) = $one2three{$residue}
if ( exists $one2three{$residue} );
my $chainID = substr( $_, 21, 1 );
substr( $_, 21, 1 ) = $chainID;
substr( $_, 54, 18 ) = ' 1.00 0.00 ';
my $rc = substr( $_, 13, 1 );
my $addspace = " ";
my $replace_copy = $addspace.$rc;
substr( $_, 72, 1 ) = $replace_copy;
print FO "$_\n";
} else {
print FO;
}
}
close(FH);
close(FO);
=for example
Sample HADDOCK PDB file:
ATOM 27 H2' ADE A 1 -3.643 6.134 3.867 1.00 0.00 H
ATOM 28 C3' ADE A 1 -4.155 7.022 5.806 1.00 0.00 C
ATOM 29 H3' ADE A 1 -5.203 7.382 5.738 1.00 0.00 H
ATOM 30 O3' ADE A 1 -3.256 8.063 5.448 1.00 0.00 O
ATOM 31 P THY A 2 -3.070 8.432 3.902 1.00 0.00 P
ATOM 32 O1P THY A 2 -4.195 7.871 3.120 1.00 0.00 O
ATOM 33 O2P THY A 2 -2.853 9.889 3.761 1.00 0.00 O
ATOM 34 O5' THY A 2 -1.722 7.646 3.549 1.00 0.00 O
Sample CHARMM PDB file:
ATOM 27 H2' ADE 1 -3.643 6.134 3.867 0.00 0.00 A
ATOM 28 C3' ADE 1 -4.155 7.022 5.806 0.00 0.00 A
ATOM 29 H3' ADE 1 -5.203 7.382 5.738 0.00 0.00 A
ATOM 30 O3' ADE 1 -3.256 8.063 5.448 0.00 0.00 A
ATOM 31 P THY 2 -3.070 8.432 3.902 0.00 0.00 A
ATOM 32 O1P THY 2 -4.195 7.871 3.120 0.00 0.00 A
ATOM 33 O2P THY 2 -2.853 9.889 3.761 0.00 0.00 A
ATOM 34 O5' THY 2 -1.722 7.646 3.549 0.00 0.00 A
Sample 3DNA generated PDB file:
ATOM 50 O3' C A 3 -7.224 -1.903 7.585
ATOM 51 C2' C A 3 -6.408 0.308 8.023
ATOM 52 C1' C A 3 -5.322 0.045 6.986
ATOM 53 N1 C A 3 -4.202 0.995 7.051
=cut
.........................................
This works perfectly fine. thank you!
Regards
Sumedha