https://github.com/silbena/secon
Protein sequence files batch converter
https://github.com/silbena/secon
Last synced: 5 months ago
JSON representation
Protein sequence files batch converter
- Host: GitHub
- URL: https://github.com/silbena/secon
- Owner: Silbena
- License: mit
- Created: 2024-05-21T14:13:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-10T23:08:01.000Z (over 1 year ago)
- Last Synced: 2024-06-10T23:15:03.194Z (over 1 year ago)
- Language: Python
- Size: 158 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SeCon
SeCon is a nucleic acid sequence files batch converter. Able to convert both single files and folders of diverse sequence formats.## Supported formats
- FASTA
- GenBank
- EMBL## Requirements
Python 3.12.2# Usage
```bash
secon.py [-h] [-o OUTPUT] [-e EXCLUDE] [-v] input format
```Positional arguments:
`input` path to input file/folder
`format` fasta/embl/gbOptions:
`-h, --help` show this help message and exit
`-o OUTPUT --output OUTPUT` path to output folder
`-e EXCLUDE, --exclude EXCLUDE` pattern to be excluded from conversion (only for folders)
`-v, --verbose` print all logsThe command-line interface was designed to be flexible and intuitive. The input folder may contain files of various formats. The file names are automatically generated. Extension may be given with or without a dot. Files to be excluded `-e` from batch convertersion may be specified with the Unix shell-style pattern.
## Examples
```bash
# single file
secon.py ./input/gb/sequence.gb embl -o my_output -v# batch
secon.py ./input/embl gb -o my_output -e *.1* -v
```# Architecture
SeCon's architecture ensures seamless integration of new converters. The core functionality is centered around a base converter that manages I/O operations. Each converter script consists of two classes, each implementing a unidirectional conversion method. Both classes include a `convert()` function. These classes are organized in a list generated by `get_converters()`, facilitating easy access via the registry. SeCon supports both single file and batch conversions, accompanied by detailed logging of operations and errors.