Dear Micha,
 
have you considered using the commandline tool molconvert that is part of MarvinSketch, which can do just that (and many other things):

molconvert mol mol.mrv -o mol.mol

 

It should be under bin/ in the Marvin installation

 

for batch processing you can e.g. use a small shell script:

for f in *.mrv; do
  echo "  converting $f..."
  BN=$(basename $f .mrv)
  molconvert mol $f -o $BN.mol
done
 
Hope, this helps.
 

Kind regards,

Axel

 
 
> A question I have is why you want to access the bond wedging.

This is very good question so I will begin with answering this. I'm
writing a module, which converts *mrv files to molfiles, both ways. In
my case, the original mrv file looks like this:

<cml><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom
id="a1" elementType="C" x2="-3.1249866416667733"
y2="-0.5015733293207466"/><atom id="a2" elementType="C"
x2="-4.458533297665067" y2="-1.2715733231607467"/><atom id="a3"
elementType="C" x2="-4.458533297665067" y2="-2.81175997750592"/><atom
id="a4" elementType="C" x2="-3.1249866416667733"
y2="-3.58175997134592"/><atom id="a5" elementType="C"
x2="-1.7912533190033066" y2="-2.81175997750592"/><atom id="a6"
elementType="C" x2="-1.7912533190033066"
y2="-1.2715733231607467"/><atom id="a7" elementType="C"
x2="-0.45751999633984003" y2="-0.5013866626555733"/><atom id="a8"
elementType="O" x2="-0.45751999633984003"
y2="1.0384266583592534"/><atom id="a9" elementType="C"
x2="0.87583999299328" y2="-1.2713866564955734"/><atom id="a10"
elementType="C" x2="0.87583999299328"
y2="-2.8113866441755735"/></atomArray><bondArray><bond atomRefs2="a1
a2" order="2"/><bond atomRefs2="a2 a3" order="1"/><bond atomRefs2="a3
a4" order="2"/><bond atomRefs2="a4 a5" order="1"/><bond atomRefs2="a5
a6" order="2"/><bond atomRefs2="a6 a1" order="1"/><bond atomRefs2="a6
a7" order="1"/><bond atomRefs2="a7 a9" order="1"/><bond atomRefs2="a9
a10" order="1"/><bond atomRefs2="a7 a8"
order="1"><bondStereo>W</bondStereo></bond></bondArray></molecule></MChemicalStruct></MDocument></cml>

It's easy to spot, that the last bond have additional tag -
"bondStereo" with value 'W'. Looking at this specification
http://download.accelrys.com/freeware/ctfile-formats/ctfile-formats.zip,
page 50 I can see that this can be translated into '1' in 4th field in
bond block and the field is called 'bond stereo', the same as mrv's
bond tag - this is the actual reason why I've used term 'stereo' in my
email. So the resulting molfile looks like this:




10 10 0 0 0 0 0 0 0 0999 V2000
-1.6741 -0.2687 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.3885 -0.6812 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.3885 -1.5063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6741 -1.9188 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.9596 -1.5063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.9596 -0.6812 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.2451 -0.2686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.2451 0.5563 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.4692 -0.6811 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.4692 -1.5061 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 2 0 0 0 0
2 3 1 0 0 0 0
3 4 2 0 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
6 1 1 0 0 0 0
6 7 1 0 0 0 0
7 9 1 0 0 0 0
9 10 1 0 0 0 0
7 8 1 1 0 0 0
M END

Now imagine I only have this molfile and I want to convert it back to
*mrv. I don't want to write my own parser for molfiles when I know
that RDKit can already parse it. But I need to extract this 'bond
stereo' information from within RDKit somehow.

Now when you say that this '1' or 'W' value corresponds to bond
direction, I'm guessing that 'direction' can store only two values: up
and down so '1' and '6' ('W' and 'H' in marvin terms). So what about
other values which this field can have, If for example I have this
molfile:



10 10 0 0 0 0 0 0 0 0999 V2000
-1.6741 -0.2687 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.3885 -0.6812 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.3885 -1.5063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6741 -1.9188 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.9596 -1.5063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.9596 -0.6812 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.2451 -0.2686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.2451 0.5563 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.4692 -0.6811 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.4692 -1.5061 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 2 0 0 0 0
2 3 1 0 0 0 0
3 4 2 0 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
6 1 1 0 0 0 0
6 7 1 0 0 0 0
7 9 1 0 0 0 0
9 10 1 0 0 0 0
7 8 1 4 0 0 0
M END

So 4 instead of 1, how I will get this information from RDKit?

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
 
 
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to