Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/avdata99/life.py

Just playing with bioinformatics
https://github.com/avdata99/life.py

Last synced: 24 days ago
JSON representation

Just playing with bioinformatics

Awesome Lists containing this project

README

        

# life.py

Learning Genetics with Python

## Installation

```bash
pip install lifepy
```

## Usage

### Nucleotide

```python
from life import Nucleotide

nuc_a = Nucleotide('A')
nuc_t = Nucleotide('T')

nucs = nuc_a + nuc_t
type(nucs)

print(nucs)
AT
```

### Gene

```python
from life import Gene
sequence = (
"ggtaagtcctctagtacaaacacccccaatattgtgatataattaaaattatattcatat"
"tctgttgccagaaaaaacacttttaggctatattagagccatcttctttgaagcgttgtc"
"ggtaagtgctctagtacaaacacccccaatattgtgatataattaaaattatattcatat"
"tctgttgccagattttacacttttaggctatattagagccatcttctttgaagcgttgtc"
"tatgcatcgatcgacgactg"
)
g = Gene(sequence)
g.description = 'Some sample description'
# save will discover your desired format
g.save('test.fasta')
"""
>Some sample description
GGTAAGTCCTCTAGTACAAACACCCCCAATATTGTGATATAATTAAAATTATATTCATATTCTGTTGCCAGAAAAAACAC
TTTTAGGCTATATTAGAGCCATCTTCTTTGAAGCGTTGTCGGTAAGTGCTCTAGTACAAACACCCCCAATATTGTGATAT
AATTAAAATTATATTCATATTCTGTTGCCAGATTTTACACTTTTAGGCTATATTAGAGCCATCTTCTTTGAAGCGTTGTC
TATGCATCGATCGACGACTG
"""
g.save('test.110.fasta', max_line_length=110)
"""
>Some sample description
GGTAAGTCCTCTAGTACAAACACCCCCAATATTGTGATATAATTAAAATTATATTCATATTCTGTTGCCAGAAAAAACACTTTTAGGCTATATTAGAGCCATCTTCTTTG
AAGCGTTGTCGGTAAGTGCTCTAGTACAAACACCCCCAATATTGTGATATAATTAAAATTATATTCATATTCTGTTGCCAGATTTTACACTTTTAGGCTATATTAGAGCC
ATCTTCTTTGAAGCGTTGTCTATGCATCGATCGACGACTG
"""
g.save('test.life')
# Binary custom content
```