Skip to main content

PLINKLiftOver

Build status Python Version Dependencies Status

Code style: black Security: bandit Semantic Versions License Alt

PLINKLiftOver is a utility enabling liftOver to work on genomics files from PLINK, allowing one to update the coordinates from one genome reference version to another.

Installation

PLINKLiftOver requires

  • Python 3.10
  • The command line version of liftOver, installed and on the system path
  • An appropriate chain file
  • The MAP file from a PLINK dataset

Install from pypi

pip install -U plinkliftover

or install the development version with

pip install -U git+https://github.com/milescsmith/plinkliftover.git

Usage

plinkliftover has three subcommands:

  • liftover: Fully convert the genomic coordinates from one version to another in a PLINK file
  • map2bed: Convert a PLINK MAP file to a BED file
  • bed2map: Convert a BED file to a MAP file

The latter two subcommands are most useful in situations where it is not possible to run the liftOver executable locally (i.e. you are on Windows) but can use UCSC's online version or you otherwise need/want a BED file.

liftover:

Usage: plinkliftover liftover [OPTIONS] MAPFILE CHAINFILE

  Converts genotype data stored in the PLINK PED+MAP format from one genome
  build to another, using liftOver.

Arguments:
  MAPFILE    The plink MAP file to `liftOver`.  [required]
  CHAINFILE  The location of the chain files to provide to `liftOver`.
             [required]

Options:
  --pedfile TEXT             Optionally remove "unlifted SNPs" from the plink
                             PED file after running `liftOver`.
  --datfile TEXT             Optionally remove 'unlifted SNPs' from a data
                             file containing a list of SNPs (e.g. for
                             --exclude or --include in `plink`)
  --prefix TEXT              The prefix to give to the output files.
  --liftoverexecutable TEXT  The location of the `liftOver` executable.
  -v, --version              Prints the version of the plinkliftover package.
  --help                     Show this message and exit.

For example

plinkliftover liftover updating.map hg19ToHg38.over.chain.gz --prefix updated

map2bed:

Usage: plinkliftover map2bed [OPTIONS] MAPFILE

  Convert genotype data stored in a PLINK MAP file into a BED file, allowing
  one to use the online version of liftOver should the local executable is
  unavailable

Arguments:
  MAPFILE  A PLINK MAP file.  [required]

Options:
  -o, --output PATH  Location to save BED file to.  If one is not provided,
                     then it will be saved to where the MAP file is.
  -v, --version      Prints the version of the plinkliftover package.
  --help             Show this message and exit.

bed2map:

Usage: plinkliftover bed2map [OPTIONS] BEDFILE

  Convert genotype data stored in a PLINK MAP file into a BED file, allowing
  one to use the online version of liftOver should the local executable is
  unavailable

Arguments:
  BEDFILE  A BED file.  [required]

Options:
  -o, --output PATH  Location to save MAP file to.  If one is not provided,
                     then it will be saved to where the BED file is.
  -v, --version      Prints the version of the plinkliftover package.
  --help             Show this message and exit.

Note!

By default, PLINK 2.0 does not use/create the required MAP file. It can be generated using PLINK 1.9 by

plink --bfile original --recode --out to_update

where original is the prefix for the bed/bim/fam files and to_update is the prefix to give the new files.

🛡 License

License

This project is licensed under the terms of the GNU GPL v3.0 license. See LICENSE for more details.

📃 Citation

@misc{plinkliftover,
  author = {Miles Smith <miles-smith@omrf.org>},
  title = {Awesome `plinkliftover` is a Python cli/package created with https://github.com/TezRomacH/python-package-template},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/milescsmith/plinkliftover}}
}

Credits

This project was generated with python-package-template.

Metadata

Release files for plinkliftover 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plinkliftover 0.5.2
File Size Uploaded Provenance Actions
plinkliftover-0.5.2.tar.gz 35.0 kB Without provenance Details for plinkliftover-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plinkliftover 0.5.2
File Interpreter ABI Platform Actions
plinkliftover-0.5.2-py3-none-any.whl Python 3 none any Details for plinkliftover-0.5.2-py3-none-any.whl

Total release size: 58.2 kB

Release files / plinkliftover-0.5.2.tar.gz

Download URL plinkliftover-0.5.2.tar.gz
Size 35.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1b426c8556d9ee2683ef022299ce846cf39209dd3d0514cac27f58d3f2c699cd
BLAKE2b-256 checksum
How to use checksums
9c64bbf23726a362375c140fc1f36b53f332584ff32415008ed596a4df0d1fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / plinkliftover-0.5.2-py3-none-any.whl

Download URL plinkliftover-0.5.2-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b145960347f0392d67a97710764b3dffbd7c93815590378fa43b6130e01c3d
BLAKE2b-256 checksum
How to use checksums
4717857f5e2277ccd8f62cf8ec5e06d917494a51015c88128e65dfcded875865
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for plinkliftover 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page