Skip to main content

Find CDR locations using bedmethyl file and CenSat annotations. (REQUIRES BEDTOOLS INSTALLED)

Project description

hmmCDR

Conda DockerHub pypi

hmmCDR is a set of python scripts to predict CDR regions of active alpha satellite arrays. It takes a bedMethyl from modkit and a set CenSat Annotations in order to make predictions.

Installation:

hmmCDR can be installed through conda. With bioconda and conda-forge channels enabled.

conda install jmmenend::hmmcdr -c bioconda -c conda-forge

hmmCDR can be run with docker.

docker run -v .:/data jmmenend/hmmcdr:0.1.4 # YOUR FLAGS #

hmmCDR can be install through pypi. Although this requires a separate installation of bedtools.

pip install hmmCDR

NOTE: If you chose it install with only pip you need to install bedtools as well.

Description:

HMM Diagram

This software is designed to find Centromere Dip Regions (CDRs), subCDRs, and their boundaries within the centromeric active alpha satellite (alpha-sat) array. CDRs are a uniquely hypo-methylated region within the typically hyper-methylated alpha-sat array. CDRs are tightly associated with the histone mark Centromere Protein A (CENP-A). This makes establishing accurate boundaries to CDRs and subCDRs essential to studying their relationship with CENPA. This method combines previous methods of identifying CDRs, through a sliding-window approach, with a Hidden Markov Model(HMM) that uses these sliding window estimates as a prior. The advantage to this two-fold approach is seen at the edges of the CDRs. A sliding window algorithm has a hard time drawing precise boundaries and identifying transitions in/out of the CDRs, whereas the HMM greatly improves identification of these regions.

Example Improvements

* in this image the lighter blue represents a CDR transition.

This python package takes in a bed file of 5mC methylation in aggregate, preferably from modkit, and an Centromere-Satellite Annotation(CenSat) file. The aggregate methylation file is used to determine where the 5mC depleted regions are, and the CenSat Annotation is used to subset the methylation files to only the alpha-sat array. This improves both the speed and accuracy of the CDR identification, as outside this region the trend of hypermethylation is not as strong. This package also processes each chromosome separately and in parallel to further improve speed.

Inputs:

1. Modkit Pileup bedMethyl File:

column name description type
1 chrom name of chromosome/contig str
2 start position 0-based start position int
3 end position 0-based exclusive end position int
4 modified base code single letter code for modified base str
5 score Equal to Nvalid_cov. int
6 strand '+' for positive strand '-' for negative strand, '.' when strands are combined str
7 start position included for compatibility int
8 end position included for compatibility int
9 color included for compatibility, always 255,0,0 str
10 Nvalid_cov Refer to modkit github int
11 fraction modified Nmod / Nvalid_cov float
12 Nmod Refer to modkit github int
13 Ncanonical Refer to modkit github int
14 Nother_mod Refer to modkit github int
15 Ndelete Refer to modkit github int
16 Nfail Refer to modkit github int
17 Ndiff Refer to modkit github int
18 Nnocall Refer to modkit github int

2. CenSat Annotation bed

column name description type
1 chrom name of chromosome/contig str
2 start position 0-based start position int
3 end position 0-based exclusive end position int
4 satellite type/name type of satellite and for some specific name in parentheses str
5 score Not sure what if it is used for anytime. int
6 strand '+' for positive strand '-' for negative strand, '.' if uncertain str
7 start position included for compatibility int
8 end position included for compatibility int
9 color color of the annotation in browser str

Usage:

usage: hmmCDR [-h] [-m MOD_CODE] [-s SAT_TYPE] [--bedgraph] [--min_valid_cov MIN_VALID_COV] [--window_size WINDOW_SIZE] [--prior_percentile PRIOR_PERCENTILE]
              [--raw_thresholds] [--n_iter N_ITER] [--remove_transitions] [-w W] [-x X] [-y Y] [-z Z] [--merge_distance MERGE_DISTANCE] [--min_size MIN_SIZE]
              [--enrichment] [--main_color MAIN_COLOR] [--transition_color TRANSITION_COLOR] [--save_intermediates] [--output_label OUTPUT_LABEL]
              bedMethyl_path cenSat_path output_path

Process input files with optional parameters.

positional arguments:
  bedMethyl_path        Path to the bedMethyl file
  cenSat_path           Path to the CenSat BED file
  output_path           Output Path for the output files

options:
  -h, --help            show this help message and exit
  -m MOD_CODE, --mod_code MOD_CODE
                        Modification code to filter bedMethyl file (default: "m")
  -s SAT_TYPE, --sat_type SAT_TYPE
                        Comma-separated list of satellite types/names to filter CenSat bed file. (default: "H1L")
  --bedgraph            Flag indicating if the input is a bedgraph. (default: False)
  --min_valid_cov MIN_VALID_COV
                        Minimum Valid Coverage to consider a methylation site. (default: 10)
  --window_size WINDOW_SIZE
                        Window size to calculate prior regions. (default: 510)
  --prior_percentile PRIOR_PERCENTILE
                        Percentile for finding priorCDR regions. (default: 10)
  --raw_thresholds      Use values for flags w,x,y,z as raw threshold cutoffs for each emission category. (default: True)
  --n_iter N_ITER       Maximum number of iteration allowed for the HMM. (default: 1)
  --remove_transitions  Do not report transitions in final hmmCDR output file. (default: False)
  -w W                  Threshold of non-zero methylation percentile to be classified as very low (default: 0)
  -x X                  Threshold of non-zero methylation percentile to be classified as low (default: 25)
  -y Y                  Threshold of non-zero methylation percentile to be classified as medium (default: 50)
  -z Z                  Threshold of non-zero methylation percentile to be classified as high (default: 75)
  --merge_distance MERGE_DISTANCE
                        Distance to merge adjacently labelled regions. (default: 1021)
  --min_size MIN_SIZE   Minimum size for regions. (default: 3000)
  --enrichment          Enrichment flag. Pass in if you are looking for methylation enriched regions. (default: False)
  --main_color MAIN_COLOR
                        Color to dictate main regions. (default: 50,50,255)
  --transition_color TRANSITION_COLOR
                        Color to dictate transition regions. (default: 100,150,200)
  --save_intermediates  Set to true if you would like to save intermediates(filtered beds+window means). (default: False)
  --output_label OUTPUT_LABEL
                        Label to use for name column of hmmCDR BED file. Needs to match priorCDR label. (default: "CDR")

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hmmcdr-0.2.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

hmmCDR-0.2.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file hmmcdr-0.2.0.tar.gz.

File metadata

  • Download URL: hmmcdr-0.2.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for hmmcdr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 714588cd016d3be7d4457a801904d5054329c7bb514ace2814eae7668759bb08
MD5 2a25898f2a6bef853e933d25bb9a502e
BLAKE2b-256 f2ccaf8c10941c081719f91770fcd14c9767bdfda1a899684dac7b22e3cf0840

See more details on using hashes here.

File details

Details for the file hmmCDR-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hmmCDR-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for hmmCDR-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c57d8eb0bc7e5eb2b659283bb7202c6d73c55b8e29f35aef5e3ff1ddc8a610
MD5 9f5644b136780635b3ec8f6a1784a8b6
BLAKE2b-256 afdf6da323c1b70166bac9c3c99005f3a90434b380445cbce34a605a92951f3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page