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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3ec2748a268e0f7e77a0c136b3ef240200a614ca8ad9151c0bb365cc6d3234d |
|
MD5 | ad9911189ebba4f75fa6e18082c9de1b |
|
BLAKE2b-256 | 06c34ee020632487674efd64fd3c7cb8186231bbfd3c839208763e653480caf0 |