https://github.com/poseidon-framework/poseidon-hs
A toolset to work with modular genotype databases in the Poseidon format
https://github.com/poseidon-framework/poseidon-hs
ancient-dna genotype-data haskell research-data
Last synced: 1 day ago
JSON representation
A toolset to work with modular genotype databases in the Poseidon format
- Host: GitHub
- URL: https://github.com/poseidon-framework/poseidon-hs
- Owner: poseidon-framework
- License: mit
- Created: 2019-07-25T14:48:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2026-04-01T03:22:23.000Z (5 days ago)
- Last Synced: 2026-04-01T05:43:39.656Z (5 days ago)
- Topics: ancient-dna, genotype-data, haskell, research-data
- Language: Haskell
- Homepage: https://poseidon-framework.github.io/#/trident
- Size: 53.2 MB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/poseidon-framework/poseidon-hs/actions/workflows/main.yml)
[](https://codecov.io/github/poseidon-framework/poseidon-hs?branch=master)
[ ](https://github.com/poseidon-framework/poseidon-hs/releases)
[](https://anaconda.org/bioconda/poseidon-trident) [](https://anaconda.org/bioconda/poseidon-trident)
# poseidon-hs
A toolset to work with modular genotype databases formatted using Poseidon. The main executable within this package is called `trident`.
**Detailed user documentation can be found on our [website](https://poseidon-framework.github.io/#/trident).**
***
## For (Haskell) developers
To install the development version of poseidon-hs/trident you can follow these steps:
1. Install the Haskell build tool [Stack](https://docs.haskellstack.org/en/stable/README/)
2. Clone this repository
3. Execute `stack install` inside the repository to build the tool and copy the executables to `~/.local/bin` (which you may want to add to your path). This will install the compiler and all dependencies into folders that won't interfere with any installation you might already have.
4. To run the tests, execute `stack test` inside the repository to build and run tests.
### Development Quickstart
The technical haddock documentation for the poseidon-hs Haskell library is available [here](https://poseidon-framework.github.io/poseidon-hs/index.html) (you can also render it locally using `stack haddock` and open it subsequently using `stack haddock --open`). The critical package is the `Poseidon.Package` module which defines the core functions to read and work with module files.
Important packages to look into to understand the architecture of this tool:
* Start with `Poseidon.Package`: It defines the main package format and provides some functions how to access the data inside packages.
* The `Poseidon.Utils` module only provides the definition of an Exception type.
* The modules in `CLI/` define the functionality provided in the command line functions for `trident`.
* The `list` command might be a good place to start understanding what's going on and how to use the `Poseidon.Package` interface.
### Preparing a new stable release
The Github Actions script in `.github/workflows/release.yml` registers a new draft release and automatically builds and uploads trident binaries when a new Git tag with the prefix `v*` is pushed.
```bash
# locally register a new tag (e.g. 0.3.1)
git tag -a v0.3.1 -m "see CHANGELOG.md"
# push tag
git push origin v0.3.1
```
In case of a failing build delete the tag and the release draft on Github and then delete the tag locally with
```bash
git tag -d v0.3.1
```
before rerunning the procedure above.
### Golden tests
To test some of the output of the powerful trident CLI functions, poseidon-hs features a golden test mechanism:
The output of a number of CLI function calls implemented in [`test/PoseidonGoldenTests/GoldenTestsRunCommands.hs`](test/PoseidonGoldenTests/GoldenTestsRunCommands.hs) is stored in a static file storage ([`test/PoseidonGoldenTests/GoldenTestData`](test/PoseidonGoldenTests/GoldenTestData)), together with relevant checksums for these files in [`test/PoseidonGoldenTests/GoldenTestCheckSumFile.txt`](test/PoseidonGoldenTests/GoldenTestCheckSumFile.txt).
`stack test` then runs -- among other things -- the code in `/test/testDat/poseidonHSGoldenTestData` again and stores the result in a dynamic, temporary directory. It then validates the output by comparing the new and temporary checksums with the old and git-logged checksums in said file `poseidonHSGoldenTestCheckSumFile.txt`. Any deviation between these two sets of checksums will cause the test to fail. The test output in this case will therefore only print the name of the operation or the output file that changed, not what exactly changed within this file.
To find out what exactly changed and also update the output storage and static checksum file, you can run `poseidon-devtools updateGoldenTests` and compare the old and new static output storage with `git diff`.