Running Python toolbox tool both standalone from other tools within same Python toolbox?
I have created a Python toolbox for work that has two tools inside. These tools use the toolbox template and so have a init, getParameterInfo, etc.
I want to be able to run one tool both standalone and call it inside other tools within that toolbox. I can't seem to get the parameters correct though.
class foo(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages) print parameter return class bar(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages) foo("hello, world) return
I have tried adding a parameter to the init(self, parameter) or the foo class but I can't get it to work.
I am new to Object-Oriented Programming (OOP) and ArcGIS in general.
The simplest option is to have your
executemethod call a function instead of doing the actual processing. This makes it easily callable by any tool.
class Foo(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages) somefunc(parameters.value, parameters.value) class Bar(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages): somefunc(parameters.value, parameters.value) anotherfunc(parameters.value, parameters.value) return def somefunc(arg1, arg2): #do something return def anotherfunc(arg1, arg2): #do something else return
If you want those functions contained in the tool classes:
class Foo(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages) self.somefunc(parameters.value, parameters.value) def somefunc(self, arg1, arg2): #do something return class Bar(object) def __init__(self) #stuff def getParameterInfo(self): # list parameters for UI tool def execute(self, parameters, messages): foo = Foo() foo.somefunc(parameters.value, parameters.value) self.anotherfunc(parameters.value, parameters.value) return def anotherfunc(self, arg1, arg2): #do something else return
Which build tool(s) do you recommend for python? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
I'm starting a small/medium-sized python project, likely in Test Driven Development. My backgrounds are more in C and java than python (I used ant and makefile)
I know that in python you might not need a build tool, but I will, because I'll use cython and PyInstaller (the thing should work on a couple of different UNIXes, without depending directly on python) and I'd like the convenience of selecting the tests form CLI, building the docs, maybe check dependencies, etc.
Somebody is complaining that python lacks a make-like tool. I know that few tools exist, like scon and paver, but I'd like to hear from real users and not just their website. Does anybody use paver?
What's about the usual setup.py that comes with many packages? I looked into a few to see if there is a common usage, but I didn't find anything interesting (maybe I used the wrong examples)
Do you recommend sticking with things I already know (ant and Makefile) at least to start? If so, is there any ant extension you recommend for python (+cython+pyinstaller+pyUnit)?
EDIT: to avoid further answers like jwp's one, note that, for this project, I absolutely need my program being a standalone executable because it is absolutely impossible to have a python VM on the target platform where the executable will run. I have exactly the same hw available for compiling, so luckly I don't need to cross-compile (but I'd do the development on a more friendly Linux).
I'd also like to test if my code compile in Cython from the beginning, not to premature optimize, but just to be sure that I'm not going too far with the use of incompatible features, which would require a painful refactoring if Cython would be seriously needed.
This is a problem after Visual Studio does an update for Optimization.
I have confirmed that the fix is:
Open menu item: - Tools - Options - Environment - On the General Tab - DISABLE/uncheck - "Optimize rendering for screens with different pixel densities"
I am using visual studio 2017, To get the SSIS toolbox back, right-click on the SSIS design surface in the project and select SSIS Toolbox please see this link. This resolved it for me
A Picture is worth of thousand words
I think you should download and install the Integration Services Projects extension:
Since in Visual Studio 2019, for Analysis Services, Integration Services or Reporting Services projects, you have to install the appropriate extension(s) from the marketplace.
You can refer to the following official documentation for additional information:
I'm very glad you asked! I was just working on explaining this very thing in our wikibook (which is obviously incomplete). We're working with Python novices, and had to help a few through exactly what you're asking!
Command-line Python in Windows:
Save your python code file somewhere, using "Save" or "Save as" in your editor. Lets call it 'first.py' in some folder, like "pyscripts" that you make on your Desktop.
Open a prompt (a Windows 'cmd' shell that is a text interface into the computer):
start > run > "cmd" (in the little box). OK.
Navigate to where your python file is, using the commands 'cd' (change directory) and 'dir' (to show files in the directory, to verify your head). For our example something like,
> cd C:Documents and SettingsGreggDesktoppyscripts
'python' is not recognized as an internal or external command, operable program or batch file.
then python (the interpreter program that can translate Python into 'computer instructions') isn't on your path (see Putting Python in Your Path below). Then try calling it like this (assuming Python2.6, installed in the usual location):
(Advanced users: instead of first.py, you could write out first.py's full path of C:Documents and SettingsGreggDesktoppyscriptsfirst.py)
Putting Python In Your Path
In order to run programs, your operating system looks in various places, and tries to match the name of the program / command you typed with some programs along the way.
control panel > system > advanced > |Environmental Variables| > system variables -> Path
this needs to include: C:Python26 (or equivalent). If you put it at the front, it will be the first place looked. You can also add it at the end, which is possibly saner.
Then restart your prompt, and try typing 'python'. If it all worked, you should get a ">>>" prompt.
For user interfaces, you have three options:
- You can easily use the generic, native dialogues and menus through the API. This is good for confirmation dialogues and other basic user inputs.
- You can also open a webview from inside a Python script, then use HTML5 for the user interface. When you use webviews from Python, you can pass messages back and forth, between the webview and the Python process that spawned it. The UI will not be native, but it is still a good option to have.
- There is some support for native Android user interfaces, but I am not sure how well it works I just haven't ever used it.
You can mix options, so you can have a webview for the main interface, and still use native dialogues.
Silent installation on Windows
Silent installation is performed without any user interface. It can be used by network administrators to install PyCharm on a number of machines and avoid interrupting other users.
To perform silent install, run the installer with the following switches:
/CONFIG : Specify the path to the silent configuration file
/D : Specify the path to the installation directory
This parameter must be the last in the command line and it should not contain any quotes even if the path contains blank spaces.
To check for issues during the installation process, add the /LOG switch with the log file path and name between the /S and /D parameters. The installer will generate the specified log file. For example:
Silent configuration file
The silent configuration file defines the options for installing PyCharm. With the default options, silent installation is performed only for the current user: mode=user . If you want to install PyCharm for all users, change the value of the installation mode option to mode=admin and run the installer as an administrator.
The default silent configuration file is unique for each JetBrains product. You can modify it to enable or disable various installation options as necessary.
It is possible to perform silent installation without the configuration file. In this case, omit the /CONFIG switch and run the installer as an administrator. Without the silent configuration file, the installer will ignore all additional options: it will not create desktop shortcuts, add associations, or update the PATH variable. However, it will still create a shortcut in the Start menu under JetBrains .
Uninstall / Disable CodeRush or every other addon one by one until it works fine. Most of the time one of them is the problem.
I've got same setup with you, in my case it was DxCore
Ok, the question is a bit older, but for the sake of completeness: you don't need to uninstall anything.
- start visual studio from the command line using: devenv.exe /SafeMode
- install the item to the tool box using the common procedure (Choose Items. )
vs should not crash that way. after restarting visual studio without the SafeMode switch, the added item(s) are still available.
For me it was Visual Studio 2008 Power Commands
EDIT: I also had this problem with another other free extensions. I simply cannot remember which the other one was :(
EDIT2: I just remembered, I installed the SilverLight Tools 2 or 2 beta. This caused this issue. It also screwed up DataAnnotations with an older version and messed up Entity Framework for me. Ended up having to reinstall my machine.
Running Python toolbox tool both standalone from other tools within same Python toolbox? - Geographic Information Systems
The folders stored here corresond to folders found in a standard Galaxy installation. Included are the tool files (both original code and .xml wrappers) for Metabolomics analysis and the Galaxy config files from a working installation of Galaxy. Not all of the config files have been altered, but all are included here for completeness.
The Galaxy version that these files have been tested on is from the Master branch on Github: commit c429777c93680dcee449fe410f5360afbe673758.
The MI-Pack version that the GigaScience publication utilises is Github commit: 06ce0ace643ee1cf1d27550769a5272b7ea50825
Availability and Requirements
###Programming languages (versions given were used for development, other versions may also be compatible):
###Any restrictions to use by non-academics:
###Pre-Installed Virtual Machine (Publication specific) A virtual machine implementation has been created to support reuse by the community as well as to act as a snapshot of reproducibility for the work in the GigaScience publication. This will be available via the GigaDB repository (accession details to follow). You can use the VM in VMWare or VirtualBox, there is one virtual hard disk (VMDK file) that suits both systems however we've had to create separate metadata files for each (MF and OVF files). To import into either system you need the VMDK to be in the same folder as the relevant MF and OVF file.
Installation instructions to recreate the virtual machine can be found below. They are quite complex and can involve a lot of troubleshooting, so it is advised to work direct from the virtual machine where possible. We will aim to share the VM via Amazon AWS for access without download. The GalaxyM installation has a user already registered and two workflows have been stored/published. If you wish to access the original user account then the login details are:
Location of data in published work:
When logged in as galaxym user on the Ubuntu system, the Mass Spectra can be found in :
The pipelines/workflows also make use of CSV files for certain instructions and these can be found in the GalaxyM-TestData folder mentioned above. See the published histories or workflows for where to use these files.
Installation instructions for Ubuntu 14.04LTS 64bit
###Step 0. Update the package manager
You may need to run this with superuser privileges, I’ll assume that you do so my commands will begin ‘sudo’. This requires you to provide your password and Ubuntu will check that you have superuser privileges
If you are running a 64bit (amd) version of Ubuntu (14.04) then it may be problematic to install WINE because it expects an i386 architecture. A workaround is:
In any event, you should start with
You may wish to see the official instructions here.
If using Ubuntu 64bit, there are problems with WINE and Python2.7 sometimes. WINE is notoriously difficult. Some nice people have set up an Ubuntu WINE repository and so it’s advised to set that up first:
To set up the WINE/Ubuntu repository:
It is then advised to install the latest version of WINE (made available by the new repository). I’ll be installing WINE1.7 but you may wish to check which versions are available to you using:
We then perform the standard ‘apt-get install’ on our chosen WINE version. On running the command, the package manager will ask you if you are sure you want to install the package - type Y to confirm.
Once it’s finished downloading all the packages, it might present you with an End User Agreement for Microsoft software that you can scroll through with the arrow keys and select the ‘yes’/‘no’ options by pressing Tab and then Enter or Space to select. Having agreed, more installation will proceed. On my most recent WINE1.7 install, none of this happened, but on previous attempts it did.
IMPORTANT: You must force wine to install everything in 32bit mode. In order to get WINE to run in 32bit, remove the .wine folder in your home directory (or move it to e.g.
/.wine_backup) which will remove all installed software and data from WINE. Then set the WINEARCH system variable by updating your
/.profile file with the line export WINEARCH=win32 (place at end of file). Then try installing the software as follows. if you do not do this, you will likely get errors from the SimStitch tools along the lines of 'Invalid file identifier' - this is because they can't use the MSFileReader tool to open the DIMS data. Note that if this is the first time wine has been installed and it has yet to be configured the .wine folder will not have been created yet so will not need to be removed.
###Step 2. Install Windows packages in WINE
Download packages: Python 2.7, 32 bit
Download packages: numpy 1.8.1
Download packages: scipy 0.14.0
Download packages: comtypes 0.6.1
Download software: MSFileReader 3.0 sp2
For MSFileReader, you need to go to ThermoFisher’s site and register ( https://thermo.flexnetoperations.com/control/thmo/RegisterMemberToAccount ) then wait for a login to be emailed to you… then you can download the software by following the link in the email - which will take you to a product list, MSFileReader is under Utility Software - I’ve chosen to use version 3.0 sp2
Extract the downloaded .zip file into your
/wine-soft folder to join the other packages. It will produce a couple of folders, one for standard x86 architecture and one for 64bit. WINE is working off 32bit so the file you are looking for is MSFileReader.exe in the standard (non 64bit) folder.
Install packages: python2.7 WINE can’t install .MSI files directly. You need to use the msiexec command (see below). When presented with Python installation GUI, just accept the defaults. Update: For Ubuntu 14.04, you may be asked to confirm installation of the Wine MONO installer, and Wine Gecko installer etc. Just agree to 'install':
Install packages: comtypes
Install software: MSFileReader 3.0 sp2 Below I’m printing out the full path for clarity. If your downloaded/extracted files look like mine, this might help. If your file system doesn’t look like this, replace my path directions with wherever you’ve stored the 32bit ‘standalone’ version of MSFileReader.exe
Install visual C using winetricks (NB: This will not work in China. download.microsoft.com is not accessible, tested 7th Aug 2015)
At this stage, Wine may produce errors because it can not register the XRawFile2.dll required for MSFileReader. You may already have installed winetricks during the previous step when you installed wine 1.7 but in case you haven not, you can install it using apt-get. Then you need to install Visual C. These two steps can be done as follows (the vc install will ask you to accept various agreements etc, just say yes!):
###Step 3: Install MI-Pack python package Download the MI-Pack python package from https://github.com/Viant-Metabolomics/MI-Pack (there is a version installed on the GalaxyM VM already, the original package files are at /home/galaxym/Galaxy_MI_Pack/MI_Pack_Python_package/ ) and install as you would any standard Python package. That is to say:
Then if you have multiple processing cores on your system and wish to make use of parallel processing to speed up e.g. Empirical Formula search, install Parallel Python. This can be downloaded from parallelpython.com or there is a version within the MI-Pack folder on the VM. Install this package in the same way as MI-Pack ( sudo python setup.py install ). It is NOT necessary to have parallel python installed for MI-Pack to work, but it is advised if you have multiple cores.
You may wish to check out the instructions at Get Galaxy.
Upon download, the Galaxy distribution (using the following settings) will create a folder called galaxy in the directory that you call the command from. So if you are copying these instructions verbatim, make sure you're in a directory you’re happy to work from. I’ll be in my user’s home directory /home/galaxym .
###Step 5: Add GalaxyM to Galaxy
Obtain the latest version of GalaxyM from github.
galaxy/tools/ directory with GalaxyM/tools/
galaxy/test-data/ directory with GalaxyM/test-data/
galaxy/tool-data/ directory with GalaxyM/tool-data/
Edit/replace/create galaxy/config/tool_conf.xml with [the contents of] GalaxyM/config/tool_conf.xml
Edit/replace/create galaxy/config/datatypes_conf.xml with the SQLite datatype extension tags from GalaxyM/config/datatypes_conf.xml (or simply copy the GalaxyM file to your galaxy/config/ directory).
Copy the Galaxy-M binary type definitions file from GalaxyM/lib/galaxy/datatypes/galaxym.py into the galaxy/lib/galaxy/datatypes/ directory.
Copy the Galaxy-M welcome page files from GalaxyM/static/ into the galaxy/static/ directory.
If you were already running Galaxy, restart now.
NB: to run Galaxy, you need to call the run.sh bash script within the main galaxy folder e.g.
If run in this way, Galaxy can be stopped with the command Ctrl-C.
###Step 6. MATLAB Compiler Runtime (MCR)
The MATLAB Runtime is a standalone set of shared libraries that enables the execution of compiled MATLAB applications or components on computers that do not have MATLAB installed. Each release includes executables for most of the tools
No need to set environment variables to your path.
The LC-MS pipeline makes use of XCMS for an initial peak picking and alignment processing. This requires ‘R’ and various packages. R can be installed using:
Then you need to run R and install Hmisc, XCMS and CAMERA
From the commandline, start R by typing simply:
NB: it is advisable to run with sudo because various packages complain about not being able to write to various directories. Then within R, use install.packages to install Hmisc.
If errors appear, saying that e.g. "Installation of packages 'ggplot2' had non-zero exit status", check your R version and if it's less than 3.1 (Ubuntu 14.04LTS apt-get base R is 3.0.2), then you'll need to upgrade. We followed these instructions for the Virtual Machine released to support this package (http://sysads.co.uk/2014/06/install-r-base-3-1-0-ubuntu-14-04/)
XCMS and CAMERA are installed from Bioconductor so the command is slightly different
The test data sets (both LCMS and DIMS) can be obtained from their larger data sets in Metabolights (DIMS: Accession MTBLS79 LCMS: Accession MTBLS146) or from GigaDB (accession to follow). In the case of the DIMS dataset, the MetaboLights accession does not include the necessary .dat files that allow SimStitch processing, therefore the GigaDB repository is required (or contact Viant Lab). Download the datasets and, if you want to copy the GalaxyM paper, move to
/GalaxyM-TestData (with subfolders DIMS_DATA and LCMS_DATA for each modality).
from the Linux commandline, start Galaxy if it’s not already running by typing:
To interact with Galaxy, open up a web-browser and point it at your server. If you have access to a browser on the same system as Galaxy, you can load that up and enter 127.0.0.1:8080 in the address bar. 127.0.0.1 means localhost and the browser speaks to the system it is running on. Alternatively, if you are running the server on a remote system (in the cloud perhaps) then you’ll need to ensure that the galaxy.ini file ( galaxy/config/galaxy.ini ) has the line host = 0.0.0.0 rather than the default host = 127.0.0.1 . This line tells Galaxy to expect traffic from the internet rather than just local requests. That setting has already been changed in the GalaxyM file (you may wish to change it back to 127.0.0.1 if you want to protect your Galaxy server from the wide web).
Hopefully, you should be presented with the main Galaxy landing page. There should be a list of tools in the left hand panel, a welcome page in the middle and a history in the right hand side.
###Install Matlab (Optional: tool development and use of most recent source code)
7a) install Java RunTime Environment and WebStart. This enables you to use the Matlab installers as downloaded from the Mathworks website. Alternatively you can just download the product files directly. To install Java JRE, first check which version is available:
Within the results you should see packages with names like openjdk-6-jre . The number indicates the Java version. I’ll be installing the latest one available in my package list, version 7.
In order to use the Mathworks’ ‘Download Agent’, you’ll also need java webstart. On Ubuntu, you can download this from the apt-get repository as follows:
7b) Download Matlab and Statistics Toolbox (version 2014a) using Download Agent Within your Mathworks website account, navigate to your licenses and start the download products process. The site intends you to use their Java ‘webstart’ based Download Agent but there are alternatives. The website will try to see that you have Java installed before download. If it can’t find your Java JRE but you installed it in the previous step, just click ‘i have java’ and continue. A file called Download Agent will start to download.
Your internet browser may ask if you want to open with IcedTea - feel free to do so. Alternatively download the file and then open with IcedTea. In theory you ought to be able to do this via the commandline using ‘javaws /path/to/my/file’ but I found this produced an error. However, simply opening up a file browser and double clicking on the file automatically opened it with the Iced Tea tool.
Simply follow all defaults to install Matlab. The only exception will be that Matlab will try to create a folder called /usr/local/MATLAB/R2014a but you may not have started the process with superuser privileges and so the installer won’t be allowed to do this. If there is an error, simply use the following commands (at the commandline) and then tell it to try again:
Of course, you should make sure you’ve created the same path that the installer wanted to make or that you change the path when running the installer. Assuming that this allows you to progress, and you can activate your software etc. it is a good idea to go back and change the permissions on that folder, undoing the chmod 777 that we just did to allow anyone (including the installer) to write to that location.
Now, for ease, you should put a symbolic link between the matlab binary that you’ll want to run and the /usr/local/bin directory that holds most of these programs. This is optional but it means you can simply type matlab at the command line and Linux will know what you mean.
NB: for some versions of 64 bit Ubuntu (13.10 for example), Matlab declares an error when it runs - ‘blah blah blah… /lib64/libc.so.6: not found’. Technically it will run and seems to perform the GalaxyM tasks but this warning is seen as an error by Galaxy and so despite storing the correct output in the history, it appears in red (i.e. failed job) and that’s not very helpful. A workaround is to find the libc.so.6 file and place a symbolic link in the location that Matlab is looking.
First find the libc.so.6 file:
In my case this produces the result: /lib/x86_64-linux-gnu/libc.so.6 Next step is to create the symbolic link between that result (where the file actually is) and the directory that Matlab is looking for it ( /lib64/libc.so.6 )
###Install PLS Toolbox (Optional: tool development and use of most recent source code)
Log into the Eigenvector.com website and navigate to software downloads. Choose your version (we’re using 7.0.3) and download the .zip file. Assuming you’ve downloaded that to the /home/your_user/Downloads folder (and that it’s version 7.0.3 and that you put your Matlab install in the default location), you can unzip it and place it in the Matlab toolbox folder as follows:
We now need to run the install program which is a matlab script. Open up Matlab from the commandline:
Once inside the Matlab environment, you’ll have to specify the location of your PLS_Toolbox folder (i.e. /usr/local/MATLAB/R2014a/toolbox/PLS_Toolbox_802/ ) so Matlab knows where the PLS scripts are. Using the GUI, this can be done from drop down menus: File-> Set Path -> Add with subfolders. Or it can be done from the Matlab command line as follows:
Once PLS_Toolbox is added to the path, return to the matlab commandline and type evriinstall to run the installation wizard.
Here you will be asked for a license code - obtainable from the download page on the Eigenvector website. Accepting all the defaults should be fine although if you’re very keen to have exactly version 7.0.3 to copy the original GalaxyM installation, you may wish to uncheck the box (underneath where you enter the license code) that offers to look for updates and newer versions of code etc.
10 Answers 10
Regardless of what completes the phrase "Python vs . ", the answer is always going to be Python.
Very few people who are serious about using optimisation in production use MATLAB, and the ones who do can't wait to move away from it.
As to why, there are plenty of reasons. MATLAB is:
not object-oriented friendly, so it's a very bad choice for complex software
hard to distribute computations, and has a very expensive license for doing so
very hard to interface with
nigh-impossible to hire professional programmers for
Seriously, if you want to be able to use your own code after your PhD, don't use commercial packages.
From a programming perspective, I have personal experience in the bottlenecks. I wrote the very first version of my solver in MATLAB, and I could solve problems of
5 variables in reasonable time. Moving to C++ increased that to 200 variables. Rewriting the solver in C++ once I had experience increased that to 100,000 variables, and hiring professional developers increased that to >1,000,000 variables.
What's interesting here is that with the experience I have now, 10 years later, I know there's no way I could have ever scaled our software beyond 100 variables in MATLAB, but I could have in Python.
I agree with everything Nikos said and I add some colors to some of the reasons:
- Python is free and open-source but Matlab is not. Anyone can write codes in Python and share it with others who can easily run that code (as it's free software) but your Matlab codes can be run only by those who have a license.
- Just because Python is open-source and free, it means it's widely available to a larger audience. And when you're talking about projects in industry, spending money on a piece of software, IMO, is not justifiable when there is a widely accessible alternative.
- It makes more sense not to tie a piece of code to a person. Since there are more and more Python users, almost anyone can read and modify your Python code in a company, but if you leave a place and there are not many proficient in Matlab, that's a big loss for the company. It can be easily avoided by using general-purpose programming languages such as Python.
- Remember that the work in the industry is not just focused on matrix and vector operations. So, my suggestion: gradually start getting out of Matlab comfort zone.
Nikos Kazazakis and EhsanK have given you great reasons for using Python. I will focus on the point from you about needing to use an additional package/library in Python for matrix and vector operations. In industry projects you will encounter many challenges and things you want to do, but you don't want to (and shouldn't) implement. Currently I work on a route planning software, most of what I do is sadly not core optimization work, but everything needed to making it useful for customers. Make imports from various data sources, integrating the data into objects (doing this in a non object oriented language would be annoying), make your product available via an API, and so on. This is to say I use a lot of things that come not out of the box. Adding numpy to that list of imports for the optimization work won't break the camel's back.
All this is to say: needing to import an additional library for functionality shouldn't be used to determine usefulness of a language most of the time ).
I work for a company that offers a commercial optimization solver. The solver offers interfaces to both MATLAB and Python for solving problems defined in those languages.
We only get one or two queries about MATLAB interfacing with our product per year, but we get many times that amount of questions on interfacing Python with our product.
Many bluechip and non B.C companies already have Python in heavy use. If I were you, I would concentrate on becoming knowledgeable with Python, not just for optimization purposes, but it's very useful in other areas of computing too.
MATLAB is a language built on top of a library. Python (with NumPy & numba) is a language with a library built under it.
Neither is ideal. Like all languages, both have a few quirks, due to their history.
My suggestion: Door Number 3, Julia.
In either case (MATLAB, Python, Julia), you should ask yourself:
- Is your immediate goal to master the math, or to master how to program it?
- Is your long-term career goal academia, or industry?
- Is it important to you that other people can run your code (e.g. github repo)?
- Is your code all short, or might it grow into a large (many 1000-line, 100's of functions) code?
If your answers are: 1: math, 2: academia, 3: no, 4: all short, then MATLAB is fine. It is an excellent tool. I love it for doing something fast and not fussing with things it's an industry standard in DSP and radar and other problems that rely very heavily on linear algebra. There is a lot of code written in it it will be around for a long time to come.
Nevertheless, if those are not your answers, then between the two, I definitely suggest Python over MATLAB. You will become a much better programmer, and your job prospects will be much better, too. If your code gets long, beware that managing a large (many 1000-lines) MATLAB code is a nightmare IMO (namespaces, anyone?). If you find you have to use MATLAB at some later date, it will be easy. Conversely, if you learn MATLAB and later on find you need to learn Python + NumPy + numba, then you will probably find this very difficult.
This is all the more true if we are talking about optimization, which is at least tangential to machine learning (ML). MATLAB is trying to compete in this space, but if you look online for job ads, they are almost all asking for Python, not MATLAB. In fact, in ML, you will find (in my experience) more job ads asking for Julia than for MATLAB.
But again (and yes it is just my personal opinion), I would suggest you take a look at Julia. I have not been as excited about a language after trying Julia since. well, since I started learning Python 18 years ago. I use all three at work, and Julia is my first choice most of the time I think the language is truly going places. But, I'm a risk-taker. It's not the safe move. If you want safe, the safe move is Python.
Disclosure: I have no interests, financial or otherwise, in MATLAB, Python, or Julia, other than my own experience using them for work/research.
Computational structure-based drug discovery has steadily gained traction partially thanks to the constant improvements in available software, now often free and open source. Protein-ligand docking in particular is now a standard tool employed in the early stages of drug discovery pipelines in order to screen possible drugs acting on a known target of interest.
Protein-ligand docking consists of the prediction of binding modes and binding affinity of a (flexible) ligand to a target of known structure. The performance of docking programs is often assessed by their ability to reproduce the crystallographic pose of the bound ligand. A common metric to evaluate the difference between the predicted binding pose and the crystallographic pose is the heavy-atoms root mean square displacement (RMSD) , although other metrics have been suggested . RMSD calculations are also used in other contexts, for example for the evaluation of diversity in generated conformers .
Many simple scripts to compute RMSDs are based on the assumption of a direct one-to-one mapping between atoms of different conformers of the same ligand. In different words, atoms are often assumed to be labelled according to their position in a coordinate file (or data structure) and they are paired according to such label. This assumption breaks down when such labels are not conserved—i.e. the order of atoms is different in the two structures being compared—and/or for symmetric molecules. In the case of symmetric molecules, different binding poses can be chemically identical but different in terms of atom-atom mapping. Since molecular connectivity is naturally represented by graphs (atoms as vertices and bonds as edges), tools from graph theory can be used to obtain the correct atom-atom mapping for two different conformers of the same molecule, thus avoiding the problems outlined above.
Here we present a new Python tool, spyrmsd , for the calculation of symmetry-corrected RMSDs based on graph isomorphisms.
What are active and passive IDS?
Intrusion Detection Systems (IDS) only need to identify unauthorized access to a network or data in order to qualify for the title. A passive IDS will record an intrusion event and generate an alert to draw an operator’s attention. The passive IDS can also store information on each detected intrusion and support analysis. An active IDS is also known as an Intrusion Prevention System (IPS) or an Intrusion Detection and Prevention System (IDPS) because as well as spotting an intrusion, it implements automated actions to block out the intruder and protect resources.