In this article, a simple python script is provided that can be used to search for a specific character in a file.
If you have a file consisting of some information including name, address, email, post, and so on. You want to extract only email addresses present in that file, then use the following script/block of code. Here, this input file is named “employee_info.txt”.
#!/usr/bin/env python value = '' str = 'Email ID:' file = open('employee_info.txt') result = '' for line in file: if '@' in line: #looking for specific character value = line.splitlines() print ("Email ID:", value) file.close()
Save this script with .py extension. Suppose, save it as ‘script.py’. Open a terminal on Ubuntu or command prompt on Windows and type:
$ python script.py
If you want to redirect the output to a file, then type:
$ python script.py > output.txt
sminalog_analysis.py – A new Python script to fetch top binding affinities from SMINA log file
In one of our previous posts, we provided a Python script for the virtual screening analysis of Autodock Vina. This script analyzes all log files obtained from docking of multiple ligands to a receptor and provides the binding affinities for top poses from each file. In this article, we are publishing a new Python script for the virtual screening analysis of SMINA . (more…)
Installing Pycharm on Ubuntu (Linux)
Pycharm  is an integrated development environment (IDE) for developers. It combines Python developer tools and provides an easy graphical user interface. In this article, we are going to install Pycharm on Ubuntu. (more…)
vs_Analysis.py: A Python Script to Analyze Virtual Screening Results of Autodock Vina
The output files obtained as a result of virtual screening (VS) using Autodock Vina may be large in number. It is difficult or quite impossible to analyze them manually. Therefore, we are providing a Python script to fetch top results (i.e., compounds showing low binding affinities). (more…)