Subject: Re: SDF files (summary)

From: Richard Wood <rlw28*at*cornell.edu>
Date: Wed, 03 Mar 2004 13:08:28 -0700

Hi all

A few days ago I posted a question about a problem I was having with SDF files.  Here's my original post:

======================================================================================

Hi all

I'm trying to glean the structures out of some SDF files that I have. I 
have 3 databases that have structures in them, and I'm trying to get the 
structures out of them.  I've downloaded the SDF toolkit and the program 
CACTUS, but neither of those are helping me.  I can get both programs to 
read the first structure, but I can't get any further than that.

Any suggestions on how to do this, including any other programs that 
could be of help (free would be the best) would be most welcome.

Thanks in advance,
Richard

======================================================================================

Here are the responses I received:

======================================================================================
W. D. Ihlenfeldt
Xemistry GmbH
wdi*at*xemistry.com

aber being disconnected from the Internet for a week I just learned
about your problems in splitting an SD-file. The CACTVS toolkit is the
right tool for this. Maybe you could send me a few record from your
original file, any scripts which you may already have written, and I
will see if I see any problem with your original file and/or application
script.

Regards

======================================================================================

Rajeshri G. Karki Ph.D. (several response)
rajeshri*at*helix.nih.gov

1) Did you try reading the structures using csbr (the cactus browser GUI) or
csed (cactus editor GUI)?
Do you see any error message?

Rajeshri

and 

2) I could not rest at peace so tried again.
I contacted the folks at DTP and they have made changes in the sd file.
So please download again and now you will be able to see the structures
using csbr.

With best wishes
Rajeshri

======================================================================================

Dr. Tamas E. Gunda
tgunda*at*puma.unideb.hu

Hi,
You may try Mol2Mol. It can slice SDF files.
http://web.interware.hu/frenzy/mol2mol/index.html
Regards

======================================================================================

Jacco van de Streek
streek*at*ccdc.cam.ac.uk

If all you want to do is look at them, possible do some measurements and save
some of them in other file formats, you can try Mercury. Mercury is available
for a number of platforms and is free:

http://www.ccdc.cam.ac.uk/mercury/

======================================================================================

Kevin P. Cross, Ph.D.
kcross*at*leadscope.com

You need to look at your SD file to determine
whether it is ill-formed or correct. Several programs
that export SD files, like ChemFinder, fail to separate
individual mol entries (1 per structure) with the SD file.
Commonly, they are either missing the "$$$$" delimiter
between the structures or are missing an "M END" statement.
I suggest you download the SDF format from the MDL web site
and then examine the first mol entry of you file to see what
the problem is. As the SDF toolkit includes source code, you
should be able to tell what data field it is looking for
to delimit individual structures. However, we have found several
bugs in the SDF toolkit and use our own code for reading and
verifying structures in SD files.

======================================================================================

Konrad Koehler
konrad.koehler*at*karobio.se

I am not sure exactly what you are trying to do, but you might
	try Open Babel (http://openbabel.sourceforge.net/) which can convert SD
	files into a number of other file formats (Sybyl mol2, pdb, SMILES,
	etc.).  If the SDF Toolkit can't read past the first structure in your
	SD file, then there may be something wrong with your SD file.  Are your
	structures seperated by "$$$$" records in your SD file?  Finally, if you
	would indicate what program you are using to view/analyze the
	structures, I might be able to provide you with more specific advice.
	
		I hope this helps.  Best regards,
	
	Konrad

======================================================================================

Doug Henry had two suggestions:
D.Henry*at*mdl.com

1) When I have noticed trouble reading SDfiles with 3rd party programs, I look
for:
- There should be one blank line between the last line of the molfile, and
the $$$$:

...
M  END

$$$$
(next molfile)
...

- If there are data fields in the SDfile, they should follow the M  END
immediately, and they should each be separated by one blank line:

...
M  END
      
<EXTREG>    

MFCD1234

<MOLWEIGHT>

123.45

$$$$

- Check that the $$$$ is not '$$$$ ' or something else (extra blank)

Hope this helps...
DH

2) If you have the sed utility (it's standard on unix; on Windows, it 
comes as part of unix emulation systems like Cygwin - see below...), you 
could try this:
 
For Windows, create a file (called say, insert_blank) using the 
following commands:
 
echo /\$\$\$\$/i\ > insert_blank
echo. >> insert_blank
 
On unix, you would type:
 
echo /\$\$\$\$/i\ > insert_blank
echo "" >> insert_blank
 
This creates a file that has two lines:
 
/\$\$\$\$/i\
(a blank line)
 
Then run sed using the file insert_blank to change the old_sdfile to the 
new one:
 
sed -f  insert_blank  old_sdfile.sdf  > new_sdfile.sdf

If you need sed for windows, you can download the Setup zip file
http://gnuwin32.sourceforge.net/packages/sed.htm
 
And it will install sed for you (just install the binaries if you want). 
It is a very useful utility.
 
If you need to insert blanks before other things besides $$$$, you can 
modify the insert_blank file to have the string to look for, between the 
/.../ separators, and run the command as above.
 
As an example, to insert a blank before the string ">  <" the 
insert_blank file would look like:
 
/>  </i\
(blank line)
 
The reason we have to add "\" in front of each $ is because $ is a 
special character to sed.
 
DH

===================================================================================================

Dr. Frank Oellien
Frank.Oellien*at*intervet.com

you start with a SD File, right?

What do you want to do with the structures?
Are you searching for specific structures?

If you are using CACTVS, do this:

1. Start csts
2. Write the following code

set infile [molfile open your_sdfile.sdf r]
molfile loop $infile ehandle {

>...
>... do somehting with the structure ...
>...

}

In the body of the loop you can define various methods like Hashcode
calculations, write the structures to other chemical exchange formats,
modify them and so on.

========================================================================================

Carsten Detering
detering*at*u.washington.edu

Hi Richard,

although not free, I can highly recommend MOE (Chemical Computing Group) 
for processing databases. It is very easy and straightforward to use, 
and the support is excellent.

Hope this helps.

Carsten

========================================================================================

Josef Scheiber
Josef.Scheiber*at*mail.uni-wuerzburg.de

Hi Richard,

maybe the DS Viewer Pro (http://www.accelrys.com/dstudio/ds_viewer/) could be 
helpful for you. It is not for free, but they have a free 30-day trial version 
that could help you solving your problem.
Another possibility is to separate the files in a text editor. In a sdf - File 
the different structures are separated by "$$$$". You can take every part out of 
there (each structure represents a mol-File, a sdf is a database of .mol-files) 
and save it as a mol-File that can be read by a lot of common freeware packages 
(e.g. VMD or VEGA). 

Bye, Sepp

===================================================================================================

Ajit Jadhav
Ajit.Jadhav*at*amphoracorp.com

Cactus should work fine for the sdf browsing. Another program you can
try (go through evaluation agreement) is Vida by OpenEye
http://www.eyesopen.com/products/applications/vida.htm. It's an
excellent 3d browser but can depict 2d as well.

-Ajit

========================================================================================

Marc Niclaus
mn1*at*helix.nih.gov

Hmm, that's a bit surprising.  Usually, these tools have no problems reading
databases of >100,000 compounds.  Are you sure your SD file is not somehow
corrupted?  Or that the second structure has illegal molfile syntax?

If you can send me one of these databases (the smallest one, preferably),
I could have a look at it.

Marc

===================================================================================================

Gyandera Kumar
gyan*at*mbu.iisc.ernet.in

You can try babel. you can seperate individual structures from a SDF 
database using this free program downloadable from the net.

Gyan.

===================================================================================================

Jolanta Lotasinska
jolanala*at*amu.edu.pl

As far as i remember SDF is MDL format.
Babel read sdf structures.
best,
Jola

===================================================================================================

Thanks to everyone who responded.  I apologize if I missed anyone.

The problem was the database I was using was formatted incorrectly.  The people at the NCI fixed it, and now I can read the structures.

Thanks to all.

Richard

-- 
Richard L. Wood, Ph. D.
Computational Chemist
SynVax, Inc.
N. Logan, UT 84341