Metadata-Version: 2.1
Name: pybioinformatic
Version: 1.2.2
Summary: Bioinformatic python package.
Author: Wenlin Xu
Author-email: wenlinxu.njfu@outlook.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: ViennaRNA (>=2.6.4,<3.0.0)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: matplotlib (>=3.7.5,<4.0.0)
Requires-Dist: natsort (>=8.4.0,<9.0.0)
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
Requires-Dist: pandas (>=2.0.3,<3.0.0)
Requires-Dist: pymysql (>=1.1.1,<2.0.0)
Requires-Dist: seaborn (>=0.13.2,<0.14.0)
Requires-Dist: sshtunnel (>=0.4.0,<0.5.0)
Requires-Dist: statsmodels (>=0.14.1,<0.15.0)
Requires-Dist: swifter (>=1.4.0,<2.0.0)
Requires-Dist: tqdm (>=4.66.2,<5.0.0)
Requires-Dist: typing_extensions (>=4.9.0,<5.0.0)
Requires-Dist: xlrd (>=2.0.1,<3.0.0)
Requires-Dist: xlsxwriter (>=3.2.0,<4.0.0)
Requires-Dist: xlwt (>=1.3.0,<2.0.0)
Description-Content-Type: text/markdown

# This is a bioinformatic python package.

## Install
```shell
pip install pybioinformatic --upgrade
```

## Issue
### ImportError: libffi.so.7: cannot open shared object file: No such file or directory
```shell
# First use the following command to verify that the file exists in that path.
ls /usr/lib/x86_64-linux-gnu/libffi.so.7

# If libffi.so.6 is present on your system but libffi.so.7 is missing, you can try creating a soft link to an existing libffi.so.6 file.
ln -s /usr/lib/x86_64-linux-gnu/libffi.so.6 /usr/lib/x86_64-linux-gnu/libffi.so.7

# You can also install libffi7 with sudo grant.
sudo apt-get install libffi7
```

## Usage example
### RNA secondary structure prediction.
```python
from pybioinformatic import Nucleotide

# Generate random nucleic acid sequence.
random_nucl = Nucleotide.random_nucl(name='demo', length=[100, 150], bias=1.0)

# Secondary structure prediction
ss, mfe = random_nucl.predict_secondary_structure('test/structure.ps')
print(ss, mfe, sep='\n')
```
```
>demo length=135
CAAAAAAAAACCATAAGCCGCCATGTCTCACATCGCAACCGGCTCAAGTAGAGTGCCCCTAATAATATGATCTTCGCTACAGAAGTTCCCCCCCCGCTGCCGGCTAGATGCGAACTCCACGCCTGGATGGCTCAG
...............((((((((.((......(((((.(.((((...((((.................((.((((......)))).))........)))).)))).).))))).......)).))).)))))...
-27.299999237060547
```
![image](test/structure.png)

### Connect MySQL
```python
from pybioinformatic import BioMySQL

with BioMySQL(
    mysql_host='192.168.1.110',
    mysql_port=3306,
    mysql_user='60533',
    mysql_password='NJFU',
    ssh_ip=None,
    ssh_port=None,
    ssh_user=None,
    ssh_password=None,
    remote_bind_ip=None,
    remote_bind_port=None,
    local_bind_ip=None,
    local_bind_port=None
) as connect:
    cur = connect.cursor()
    sql = 'use Ptrichocarpa;'
    cur.execute(sql)
    sql = 'select protein_id,sequence from protein where protein_id = "Potri.019G097720.1.p";'
    cur.execute(sql)
    for data in cur.fetchall():
        protein_id, sequence = data
        print(f'>{protein_id}\n{sequence}')
```
```
>Potri.019G097720.1.p
MESLQHLYLSKTGIKEIPSSFKHMISLITLKLDGTPIKELPLSIKDKVCLEYLTLHGTPIKALPELPPSLRFLTTHDCASLETVISIINISSLWFRRDFTNCFKLDQKPLVAAMHLKIQSGEETPHGTIQMVLLGSEIPEWFGDKGIGSSLTIQLPSNCHLLKGIAFCLVFLLPLPSQDMPCEVDDDSYVHVYFDCHVKSKNGESDGGDEIVFGSQERRALLYLLETCDSDHMFLHYELGLVNHLRKYSGNEVTFKFYHEVYNQGRKLGHEIRKPFKLKNCGVYLHFDENLPADTDLP*
```

