Suggested file structure for reorganizing the codebase:
readfx/
├── readfx.nim # Main library file (exports all modules)
├── readfx.nimble # Package file
├── src/
│ ├── types.nim # Type definitions
│ ├── io.nim # I/O operations (GzFile, Bufio)
│ ├── parsers.nim # Parsing functions (readFastx, readFQPtr, readFQ)
│ ├── utils.nim # Utility functions for FQRecord
│ └── intervals.nim # Interval operations
├── readfx/ # C bindings
│ ├── kseq.h
│ ├── klib/
│ │ ├── README.md
│ │ └── kseq.h
│ └── bindings.nim # C bindings for kseq.h
└...
This structure creates a clear dependency direction with no circular references:
types.nim <── io.nim
^ ^
| |
| |
bindings.nim |
^ |
| |
└── parsers.nim
^
|
utils.nim├── intervals.nim
^ ^
| |
└────┴── readfx.nim (main module)