A Python project to read and write Snapgene *.dna into dict, json, and biopython object.
Project description
# SnapGeneFileReader
a Python project to read and write Snapgene *.dna
## install
```bash
pip install SnapGeneFileReader
```
## test:
```bash
pytest
```
## usage:
### to read a SnapGene file into a dict
```python
from SnapGeneFileReader import SnapGeneFileReader
file_path = './snap_gene_file.dna'
dna_dict = SnapGeneFileReader.read_file(file_path)
```
### to convert dna file to genbank file:
```python
from Bio import SeqIO
from SnapGeneFileReader import snapgene_file_to_seq_record
file_path = './snap_gene_file.dna'
seqObject = snapgene_file_to_seq_record(file_path)
with open('genbank_file.gb', 'w') as f:
SeqIO.write([seqObject,], f, 'genbank')
```
a Python project to read and write Snapgene *.dna
## install
```bash
pip install SnapGeneFileReader
```
## test:
```bash
pytest
```
## usage:
### to read a SnapGene file into a dict
```python
from SnapGeneFileReader import SnapGeneFileReader
file_path = './snap_gene_file.dna'
dna_dict = SnapGeneFileReader.read_file(file_path)
```
### to convert dna file to genbank file:
```python
from Bio import SeqIO
from SnapGeneFileReader import snapgene_file_to_seq_record
file_path = './snap_gene_file.dna'
seqObject = snapgene_file_to_seq_record(file_path)
with open('genbank_file.gb', 'w') as f:
SeqIO.write([seqObject,], f, 'genbank')
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for SnapGeneFileReader-0.1.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e383b9bf725747a5645d42cef78f64c2bee3002b46fc556573382a3101a6ab70 |
|
MD5 | aa1ce9a539fb52ace4a5b0657fad822e |
|
BLAKE2b-256 | 02454b5804eacff293f4e0f984046cd3f0ad0e7752ec1107cfd3c40baec42309 |