Split mol2 file with python (-> 2016.04.17 Also supports sdf file)

I had to split the compound with more than 1 million entries into several files, so I looked it up.

At first I was looking at open babel etc. http://openbabel.org/wiki/--splitinto As far as I can see, it seems that this function is not implemented as of openbabel 2.3.0, and 2.3.1 at hand was also useless.

So I made my own code. Just move for the time being! The soul is revealed! https://github.com/keisuke-yanagisawa/python-tools/blob/master/split_mol2.py

python split_mol2.py hoge.mol2 #Default for every 10000 compounds
python split_mol2.py -n 100 hoge.mol2 #Divided every 100 compounds

You can use it like this.

A -v option is also provided so that you can see what name the file is being output.


2016.04.17 It also supports sdf files. (The way of execution has not changed https://github.com/keisuke-yanagisawa/python-tools/blob/master/split_sdf.py

python split_sdf.py hoge.sdf #Default for every 10000 compounds
python split_sdf.py -n 100 hoge.sdf #Divided every 100 compounds
python split_sdf.py -v hoge.sdf #You can see what the name of the file was output

Recommended Posts

Split mol2 file with python (-> 2016.04.17 Also supports sdf file)
Draw netCDF file with python
Download csv file with python
Extract the xz file with python
[Python] Write to csv file with Python
[Automation with python! ] Part 1: Setting file
Implemented file download with Python + Bottle
Output to csv file with Python
Create an Excel file with Python3
[Automation with python! ] Part 2: File operation
Creating a simple PowerPoint file with Python
Exclusive control with lock file in Python
Read CSV file with python (Download & parse CSV file)
HTTP split download guy made with Python
Check the existence of the file with python
Quickly create an excel file with Python #python
Let's read the RINEX file with Python ①
Create Excel file with Python + similarity matrix
Record with Python → Save file (sounddevice + wave)
Supports Python 2.4
I made a configuration file with Python
[Automation] Read mail (msg file) with Python
nginxparser: Try parsing nginx config file with Python
How to read a CSV file with Python 2/3
[Python] Split a large Flask file using Blueprint
[Python] How to read excel file with pandas
Convert svg file to png / ico with Python
[Web development with Python] query is also redirect
Read table data in PDF file with Python
Develop Windows apps with Python 3 + Tkinter (exe file)
[Python] Summary of S3 file operations with boto3
Extract zip with Python (Japanese file name support)
Create a Photoshop format file (.psd) with python
Convert the character code of the file with Python3
Wav file generation from numeric text with python
Read line by line from a file with Python
I want to write to a file with Python
Open a file dialog with a python GUI (tkinter.filedialog)
Script python file
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Twilio with Python
Integrate with Python
Play with 2016-Python
Python file processing
AES256 with python
Tested with Python
python starts with ()
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
Excel with Python
Microcomputer with Python
Cast with python
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
I tried to touch the CSV file with Python
How to measure mp3 file playback time with python
Read QR code from image file with Python (Mac)