semvec/pypi-packages huggingface dataset:
metapipeline 0.0.0
Metapipeline
License: MIT
Requires Python: >=3.7,<4.0

Metapipeline
============

|PyPI| |Status| |Python Version| |License|

|Read the Docs| |Tests| |Codecov|

|pre-commit| |Black|

.. |PyPI| image:: https://img.shields.io/pypi/v/metapipeline.svg
   :target: https://pypi.org/project/metapipeline/
   :alt: PyPI
.. |Status| image:: https://img.shields.io/pypi/status/metapipeline.svg
   :target: https://pypi.org/project/metapipeline/
   :alt: Status
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/metapipeline
   :target: https://pypi.org/project/metapipeline
   :alt: Python Version
.. |License| image:: https://img.shields.io/pypi/l/metapipeline
   :target: https://opensource.org/licenses/MIT
   :alt: License
.. |Read the Docs| image:: https://img.shields.io/readthedocs/metapipeline/latest.svg?label=Read%20the%20Docs
   :target: https://metapipeline.readthedocs.io/
   :alt: Read the documentation at https://metapipeline.readthedocs.io/
.. |Tests| image:: https://github.com/ClementCaporal/metapipeline/workflows/Tests/badge.svg
   :target: https://github.com/ClementCaporal/metapipeline/actions?workflow=Tests
   :alt: Tests
.. |Codecov| image:: https://codecov.io/gh/ClementCaporal/metapipeline/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/ClementCaporal/metapipeline
   :alt: Codecov
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
   :target: https://github.com/pre-commit/pre-commit
   :alt: pre-commit
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
   :alt: Black


Features
--------

* TODO


Requirements
------------

* TODO


Installation
------------

You can install *Metapipeline* via pip_ from PyPI_:

.. code:: console

   $ pip install metapipeline


Usage
-----

Please see the `Command-line Reference <Usage_>`_ for details.


Contributing
------------

Contributions are very welcome.
To learn more, see the `Contributor Guide`_.


License
-------

Distributed under the terms of the `MIT license`_,
*Metapipeline* is free and open source software.


Issues
------

If you encounter any problems,
please `file an issue`_ along with a detailed description.


Credits
-------

This project was generated from `@cjolowicz`_'s `Hypermodern Python Cookiecutter`_ template.

.. _@cjolowicz: https://github.com/cjolowicz
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _MIT license: https://opensource.org/licenses/MIT
.. _PyPI: https://pypi.org/
.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python
.. _file an issue: https://github.com/ClementCaporal/metapipeline/issues
.. _pip: https://pip.pypa.io/
.. github-only
.. _Contributor Guide: CONTRIBUTING.rst
.. _Usage: https://metapipeline.readthedocs.io/en/latest/usage.html
haploblock-shuffler 0.0.6
Create all possible combinations of phased and unphased blocks in a vcf
License: MIT
Requires Python: >=3.7.*

[![Continous integration](https://github.com/Redmar-van-den-Berg/haploblock-shuffler/actions/workflows/ci.yml/badge.svg)](https://github.com/Redmar-van-den-Berg/haploblock-shuffler/actions/workflows/ci.yml)

# Haploblock-shuffler
Create all possible combinations of phased and unphased blocks in a vcf

------------------------------------------------------------------------
## Background
This tool takes a phase, unphased or partially phased VCF file, and generates
all possible combinations of phase blocks that are consistent with the phasing
that is present in the VCF file.


## Details
First, this tool reads all variants from a VCF file, and groups variants
together if they are compatible.
1. If a variant is phased (using the `PS` tag), it is only compatible with
   other phased variants that have the same phase ID.
2. Homozygous variants are always compatible with other variants, since they
   are part of every phase group
3. Heterozygous variants are only compatible when they are phased, and the
   phase ID matches.

To produce all possible combinations of grouped variants, haplotype-suffler
uses a counter to produce a binary pattern that determines which calls should
be modified. To modify a variant, we simply invert the order of the `GT` field,
so that `0/1` becomes `1/0`, or vice versa.

Since there are two alleles for every variant, we only have to produce half of
the possible VCF file, since the other half are mirror images (e.g. `0101` and
`1010`).

## Usage
```bash
haploblock-shuffler test.vcf output
```

To generate consensus fasta files from the output vcf files, bgzip and index
the output vcf files
```bash
cd output
for i in out_*.vcf; do
    bgzip $i
    tabix ${i}.gz
done
```
Then, generate the consensus using
```bash
samtools faidx $REFERENCE $REGION | bcftools consensus -H 1 out_0.vcf.gz > out_0_1.fa
samtools faidx $REFERENCE $REGION | bcftools consensus -H 2 out_0.vcf.gz > out_0_2.fa
```

## Limitations
This tool will generate `2^(n-1)` VCF files in the specified `output` folder,
where `n` is the number of phase blocks in the input VCF (see above). By
default, this is limited to 11 blocks, which means that at most 1024 files will
be created. This limit can be increased by using `--max-blocks`, but use with
caution.