Author Topic: Import other file formats in VNL?  (Read 22695 times)

0 Members and 1 Guest are viewing this topic.

Offline ugglebot

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: se
  • Reputation: 1
    • View Profile
Import other file formats in VNL?
« on: December 5, 2008, 20:27 »
I'm new to Virtual NanoLab, which seems like a great program! I have one question, which I could not figure out from the manual...

Is it possible to import common molecular formats like XYZ or PDB files to use in your calculations? It's a bit cumbersome to have to build all molecules by hand all the time, and I have several pre-relaxed structures (I use DMol and Gaussian a lot too), which I would like to include in a two-probe structure.

If this functionality is not present, I hope that there are plans to include it in future editions...!

Offline ipsecog

  • Heavy QuantumATK user
  • ***
  • Posts: 35
  • Country: se
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #1 on: December 5, 2008, 21:12 »
Well, at least in NanoLanguage you can use the small script provided in the examples directory. It is called import_xyz.py and it's quite straight-forward to use; in fact, and example (import_xyz-test.py) is also included in the same directory. For convenience, I copy the example here:
Code
from ATK.KohnSham import *

# Import XYZ file 
from import_xyz import *
(elements,positions) = importXYZFile ('3-octanol.xyz')

# Create NanoLanguage molecule
molecule = MoleculeConfiguration(elements, positions*Angstrom)

# Save in VNL file    
vnlfile = VNLFile('3-octanol.vnl')
vnlfile.addToSample(new_vnl_molecule,'3-octanol')
Just remember to copy the file import_xyz.py to the same directory as your script, or add these lines at the top:
Code
import sys
sys.path.append('c:/Program Files/Atomistix/ATK 2008.02/examples')
(Yeah, I run ATK on Windows! the performance is actually not much worse, except there is no MPI parallelization of course...)
« Last Edit: December 5, 2008, 21:15 by ipsecog »

Offline ipsecog

  • Heavy QuantumATK user
  • ***
  • Posts: 35
  • Country: se
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #2 on: December 5, 2008, 21:14 »
I just noted that the "xyz" file to be used in the example mentioned above has the wrong extension in the ATK distribution (in the examples directory); it's called 3-octanol.py...

Offline ugglebot

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: se
  • Reputation: 1
    • View Profile
Re: Import other file formats in VNL?
« Reply #3 on: December 5, 2008, 21:18 »
Ok, I just found it by using "Search" in the "online" VNL manual (the one that opens in QTAssistant when you press F1).

You can import xyz files into the "Result Browser" if you click the "Open" button and open the file this way. It does not, however, seem to work to drop xyz files on the Result Browser or any other instrument for that matter...

So, now the question is just how I convert my PDB files to xyz? The help file says there are "programs that can convert various file formats to an XYZ file". But which ones??
« Last Edit: December 5, 2008, 21:23 by ugglebot »

Offline ipsecog

  • Heavy QuantumATK user
  • ***
  • Posts: 35
  • Country: se
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #4 on: December 5, 2008, 21:21 »
The XYZ import into NanoLanguage is actually also mentioned in the manual, in a bit of a hidden place., in the "Tips" section.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Import other file formats in VNL?
« Reply #5 on: December 5, 2008, 21:28 »
Have a look at OpenBabel (http://openbabel.org/wiki/Main_Page), that should solve your problems!

Offline ugglebot

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: se
  • Reputation: 1
    • View Profile
Re: Import other file formats in VNL?
« Reply #6 on: December 5, 2008, 21:32 »
Thanks a lot - that looks awsome!

And thanks a lot for the fast answers!
« Last Edit: January 1, 2009, 22:34 by ugglebot »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Import other file formats in VNL?
« Reply #7 on: December 5, 2008, 23:43 »
Here is a related tip: How to export XYZ files from VNL:
http://quantumwise.com/forum/index.php?topic=5.0

Offline yangzw1985

  • QuantumATK Guru
  • ****
  • Posts: 113
  • Reputation: 0
    • View Profile
some questions
« Reply #8 on: March 19, 2009, 10:25 »
Hi,  I have read this topic, but I can not import any file?
Now, I have a pre-optimised model by demol3. I want to put it in the atomic manipulator, as a input structure in a two probe model. what should I do? can anyone give me the methods in details.
In the past, I export the model, and obtain the atomic cordinate, and use insert atomic in the atomic manipulator.
thanks!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Import other file formats in VNL?
« Reply #9 on: March 19, 2009, 10:51 »
The procedure would be as follows:

1. Use OpenBabel to convert the structure from DMol format to XYZ
2. Open the Result Browser in VNL
3. Click "Open", and browse for and import the XYZ file
4. Drop the structure from the Result Browser to the Atomic Manipulator.

Offline yangzw1985

  • QuantumATK Guru
  • ****
  • Posts: 113
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #10 on: March 19, 2009, 12:12 »
Thank you, Anders Blom!!!

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #11 on: September 27, 2010, 13:24 »
Dear Sir, I followed the above conversations and got an XYZ format  file, shown below. 1) how do i create a two probe system from this XYZ format file 2) Note: the coordinates are negative which creates problem while writing unit cell vectors. 3) i am unable to bring the whole geometry in the centre while creating a unit cell and a two probe system.
Code
# Define elements
elements = [Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon, 
            Carbon, Carbon, Carbon, Carbon]

# Define coordinates
coordinates = [[ 2.716,  0.   ,  2.463],
               [ 2.623,  0.703,  3.694],
               [ 2.716,  0.   ,  0.   ],
               [ 1.92 ,  1.92 ,  1.231],
               [ 2.623,  0.703,  1.231],
               [ 1.358,  2.352,  2.463],
               [ 1.92 ,  1.92 ,  3.694],
               [ 0.   ,  2.716,  0.   ],
               [ 1.358,  2.352,  0.   ],
               [-0.703,  2.623,  1.231],
               [ 0.   ,  2.716,  2.463],
               [-1.92 ,  1.92 ,  3.694],
               [-0.703,  2.623,  3.694],
               [-2.352,  1.358,  0.   ],
               [-1.92 ,  1.92 ,  1.231],
               [-2.716,  0.   ,  2.463],
               [-2.352,  1.358,  2.463],
               [-2.623, -0.703,  3.694],
               [-2.716,  0.   ,  0.   ],
               [-1.92 , -1.92 ,  1.231],
               [-2.623, -0.703,  1.231],
               [-1.358, -2.352,  2.463],
               [-1.92 , -1.92 ,  3.694],
               [ 0.   , -2.716,  0.   ],
               [-1.358, -2.352,  0.   ],
               [ 0.703, -2.623,  1.231],
               [ 0.   , -2.716,  2.463],
               [ 1.92 , -1.92 ,  3.694],
               [ 0.703, -2.623,  3.694],
               [ 2.352, -1.358,  0.   ],
               [ 1.92 , -1.92 ,  1.231],
               [ 2.352, -1.358,  2.463]]*Angstrom

# Set up configuration
molecule_configuration = MoleculeConfiguration(elements,coordinates)

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #12 on: September 27, 2010, 13:48 »
Okay..I found it is possible.

Offline Emilio_bassini

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Reputation: 0
    • View Profile
Re: Import other file formats in VNL?
« Reply #13 on: October 17, 2010, 13:03 »
Well, at least in NanoLanguage you can use the small script provided in the examples directory. It is called import_xyz.py and it's quite straight-forward to use; in fact, and example (import_xyz-test.py) is also included in the same directory. For convenience, I copy the example here:
Code
from ATK.KohnSham import *

# Import XYZ file 
from import_xyz import *
(elements,positions) = importXYZFile ('3-octanol.xyz')

# Create NanoLanguage molecule
molecule = MoleculeConfiguration(elements, positions*Angstrom)

# Save in VNL file    
vnlfile = VNLFile('3-octanol.vnl')
vnlfile.addToSample(new_vnl_molecule,'3-octanol')
Just remember to copy the file import_xyz.py to the same directory as your script, or add these lines at the top:
Code
import sys
sys.path.append('c:/Program Files/Atomistix/ATK 2008.02/examples')
(Yeah, I run ATK on Windows! the performance is actually not much worse, except there is no MPI parallelization of course...)
Hi I'm new with VNL and so i find it preatty hard to use. My job is to optimize a number of thiophene molecules with a crescent number of elements with gaussian than to put those molecules in a two-probe system and so calculate an I-V courve...i tried to use the two methods listed above but neither one or the other worked.... i just copy and paste the script in the job manager but it crash everytime and it report an error. it is the code wrong? should i add the entire file path? could anyone help me to convert .xyz file in vnl? i apologize for my bad english and hope i'll recive an answare....please help me

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Import other file formats in VNL?
« Reply #14 on: October 17, 2010, 21:36 »
The reason this script fails is because it is written for ATK 2008.10. In the new version you are using (10.8.x), it's much simpler: you can just drop your xyz file onto any instrument in VNL and use it directly!

If you haven't yet, please have a look at the tutorials to get to terms with some of the basics in VNL/ATK.