簡體   English   中英

通過Java代碼為Modeller軟件執行script.py

[英]Executing script.py for Modeller software through java code

腳本文件

# Homology modeling by the automodel class
from modeller import *              # Load standard Modeller classes
from modeller.automodel import *    # Load the automodel class

log.verbose()    # request ver`enter code here`bose output
env = environ()  # create a new MODELLER environment to build this model in

# directories for input atom files
env.io.atom_files_directory = './:../atom_files'

a = automodel(env,
alnfile  = 'align.ali',     # alignment filename
knowns   = '1GJZ',              # codes of the templates
sequence = 'target')              # code of the target

a.starting_model= 1       
a.ending_model= 10           # index of the first model
# (determines how many models to calculate)
a.make()                            # do the actual homology modeling

import java.io.*;


public class Demo 
{


        public static void main(String args[])
        {

        try 
        {
Runtime r = Runtime.getRuntime();
Process p = r.exec("cmd /c \"C:/model2/script.py\"");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = br.readLine()) != null) {
    System.out.println(line);
}
} 
catch (Exception e) 
{
e.printStackTrace();
}
        }
    }

輸出量

                     MODELLER 9.10, 2011/09/28, r8346

 PROTEIN STRUCTURE MODELLING BY SATISFACTION OF SPATIAL RESTRAINTS


                 Copyright(c) 1989-2011 Andrej Sali
                        All Rights Reserved

                         Written by A. Sali
                           with help from
       B. Webb, M.S. Madhusudhan, M-Y. Shen, M.A. Marti-Renom,
            N. Eswar, F. Alber, M. Topf, B. Oliva, A. Fiser,
                R. Sanchez, B. Yerkovich, A. Badretdinov,
                  F. Melo, J.P. Overington, E. Feyfant
             University of California, San Francisco, USA
                Rockefeller University, New York, USA
                  Harvard University, Cambridge, USA
               Imperial Cancer Research Fund, London, UK
          Birkbeck College, University of London, London, UK

錯誤

iodataW> Setting io.atomfilesdirectory to a colon-delimited string is deprecated, as it is not robust on Windows systems. Set it to a list of directories instead. For example: env.io.atomfilesdirectory = ['./', '../atomfiles'] openf__E> Cannot open file align.ali: No such file or directory;

正如我們在輸出部分中看到的那樣,這段代碼正在訪問建模程序,一旦開始執行,它就會產生錯誤align.ali,正如我們在錯誤部分中看到的那樣。 它作為獨立的script.py文件運行。

看起來像是路徑問題。 您是否嘗試在Python腳本中使用絕對路徑來align.ali

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM