Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cmsip

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmsip

  • 0.0.3.0
  • PyPI
  • Socket score

Maintainers
1

CMSIP: Hydroxymethylation anlaysis of CMS-IP data

A scalable, accurate, and efficient solution for hydroxymethylation analysis of CMS-IP sequencing data.

Workflow of CMSIP.

Installation

CMSIP has been deployed in Bioconda at https://anaconda.org/bioconda/cmsip. It is encouraged to install CMSIP from Bioconda due to most runtime dependencies will be installed automatically. The following channels should be added in Conda. Namely,

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda install cmsip

Alternatively, CMSIP has been also deployed in PyPI at https://pypi.org/project/cmsip, and it can be installed via pip.

pip3 install cmsip

In some cases, users want to build CMSIP manually from source code at https://github.com/lijinbio/cmsip. Below is an example installation steps.

git clone https://github.com/lijinbio/cmsip.git
cd cmsip
python3 setup.py install

In order to run CMSIP after a manual installation, the following dependent software are required.

SoftwareURL
Python 3https://www.python.org
Matplotlibhttps://matplotlib.org
PyYAMLhttps://pyyaml.org
bedtoolshttps://bedtools.readthedocs.io
R softwarehttps://www.r-project.org
R package DESeq2https://bioconductor.org/packages/release/bioc/html/DESeq2.html
R package genefilterhttps://bioconductor.org/packages/release/bioc/html/genefilter.html
R package RVAideMemoirehttps://cran.r-project.org/web/packages/RVAideMemoire/index.html
Gawkhttps://www.gnu.org/software/gawk
MOABShttps://github.com/sunnyisgalaxy/moabs

Documentation

CMSIP takes in a configuration file for input data and program parameters. CMSIP can be run end-to-end, starting from raw FASTQ files to peak calling and differential hydroxymethylation identification. One can also start the pipeline from intermediate steps. For example, using alignment files as input so that mapping steps will be skipped.

Inspection of configuration

The configuration file is in a YAML format. Two example templates are config_fastq.yaml and config_bam.yaml under https://github.com/lijinbio/cmsip/blob/master/config. config_fastq.yaml is used as a full CMSIP running from FASTQ inputs, while config_bam.yaml is adapted to input existing BAM files so that CMSIP will skip the long-time alignment step. The inspection of configuration is explained below.

  1. sampleinfo

The sampleinfo section defines metadata information in analysis. Below metadata information can be specified.

ParameterDescription
sampleinfo.sampleidthe unique identifier to one sample
sampleinfo.groupthe biological group of the sample, e.g., KO or WT
sampleinfo.filenamesthe absolute path of raw FASTQ files
sampleinfo.referencethe absolute path of the reference BAM file when aligninfo.inputbam is True
sampleinfo.spikeinthe absolute path of the spike-in BAM file when aligninfo.inputbam and aligninfo.usespikein is True
  1. groupinfo

This section defines biological comparison group1 - group2, e.g., KO - WT.

ParameterDescription
groupinfo.group1the first group in biological comparison
groupinfo.group2the second group in biological comparison
  1. resultdir

This directory is default working directory storing intemediate result files, such as BAM and BED files.

  1. aligninfo

This section specifies parameters used in raw reads alignment.

ParameterDescription
aligninfo.inputbamTrue for BAM inputs. Default: FASTQ inputs.
aligninfo.referenceFASTA file of the reference genome, e.g. hg38.fa.
aligninfo.usespikeinTrue for spike-in libraries, otherwise False. This option controls the normalization method, either a spike-in normalization using spike-in mapping, or reduced to WIG sum in reference genome.
aligninfo.spikeinFASTA file of the spike-in genome, e.g. mm10.fa.
aligninfo.statfilethe output statistics file. This file includes quality control statistics as well as estimated normalization factors.
aligninfo.barplotinfoa barplot of normalized WIG sums of samples.
aligninfo.numthreadsnumber of threads in alignment program.
aligninfo.verbosePrint verbose message
  1. genomescaninfo

This section defines parameters for CMS measurement construction.

ParameterDescription
genomescaninfo.readextensionTrue to extend reads length before CMS measurement construction.
genomescaninfo.fragsizethe fixed fragment size to extend when readextension is True.
genomescaninfo.windowfilean intermediate window file with fixed-size genomic regions.
genomescaninfo.referencenamethe UCSC genome name to fetch reference genome size. E.g., hg38 or mm10.
genomescaninfo.windowsizethe window size
genomescaninfo.readscountCMS measurement using readcount (True) or mean WIG (False).
genomescaninfo.counttablefilethe result count table file.
genomescaninfo.verbosePrint verbose message
  1. dhmrinfo

Parameters in this section is for DMR detection.

ParameterDescription
dhmrinfo.methodThe statistical method used in DHMR detection. Available methods: ttest, chisq, gtest, nbtest, nbtest_sf. ttest is calling Student's t-test to examine the mean difference of CMS measurements between two biological groups. chisq and gtest are Pearson’s Chi-squared and G-test to test if sums of CMS measurements fit the numbers of replicates between two biological condtions. nbtest applies negative binomial generalized linear model to formulate CMS measurements, and Wald test evaluates the significance of logarithmic fold change. By default, CMS measurement are adjusted by size factors using spike-in normalization. In nbtest_sf, CMS measurements are normalized by the median-ratio algorithm (previously used in DESeq2 for transcriptome measurements).
dhmrinfo.meandepthAverage depth to filter out low-depth windows. This step is essential to save computing resources and increase power of downstream statistical inference
dhmrinfo.testfileThe result file with statistical outputs for whole genome windows
dhmrinfo.qthrq-value threshod for DHMW.
dhmrinfo.maxdistanceMaximum distance to merge adjacent DHMWs into DHMRs
dhmrinfo.dhmrfileThe final DHMR result file after merging adjacent DHMWs.
dhmrinfo.numthreadsThe number of threads.
dhmrinfo.nsplitThe number of split of windows. This option controls parallelization with dhmrinfo.numthreads.
dhmrinfo.verbosePrint verbose message.
dhmrinfo.keepNAKeep genome windows ruled out by independent filtering.
  1. useinput

To indicate if the input data is used during CMS-IP sequencing.

  1. inputinfo

If useinput is True, this section is required to specify input data. When input data is used, peak windows are identified first by comparing CMS measurements between group 1/2 and their input data. Then, the union of peak windows are tested for DHMR between group 1 and group 2.

ParameterDescription
inputinfo.group1The label for the first group input data.
inputinfo.group2The label for the second group input data. Group 1 and group 2 can share same set of input data.
inputinfo.methodThe statistical method used in peak calling. See dhmrinfo.method.
inputinfo.qthrq-value threshold for peak calling.
inputinfo.testfile1Statistical test results for group 1 peaking calling.
inputinfo.dhmrfile1Peak regions for group 1.
inputinfo.testfile2Statistical test results for group 2 peaking calling.
inputinfo.dhmrfile2Peak regions for group 2.
inputinfo.inputfilterfileUnion of peak regions in group 1 and group 2.
inputinfo.verbosePrint verbose message.

A toy example using BAM inputs

To facilitate the running of CMSIP, a toy example is generated using existing BAM inputs. The example is accessible at https://github.com/lijinbio/cmsip/blob/master/example. The example directory consists of running scripts and example BAM files. Below commands will generate the configuration file and run the example.

$ ./config.sh ## Generate config.yaml
$ ./fasta.sh ## download the reference genome and the spike-in genome under ./fasta
$ ./run.sh ## run the example
  1. config.sh

This script will generate the running configuration file. The inspection of configuration file has been explained above. This example includes small BAM files for 2 KO and 2 WT samples, together with 3 input samples. Spike-in BAM files are also included for spike-in normalization. These BAM files are under the ./bamfile directory. The gtest is used for peaking calling and DHMR detection.

  1. fasta.sh

This script is to download required FASTA file for reference genome and spike-in genome. These FASTA files are used in MCALL for bisulfite conversion ratio (BCR) estimation. FASTA files are downloaded into a local directory ./fasta.

  1. run.sh

The simple command to run CMSIP:

$ cmsip -c config.yaml

Intermediate and results files are stored under ./outdir. The example quality control statistic file (e.g., qcstats.txt) is as below.

sample_idtotalunique_refref/totalunique_spkspk/totalcommcomm/totalcomm/unique_reftwss_spksizefactorstwss_reftwss_ref_normbcr_refbcr_spk
T123282328100.00%1416.06%994.25%4.25%30530.52171892886200.0228830.278465
T22041420414100.00%278013.62%253912.44%12.44%95220.177049651165320.0334820.178238
W115881588100.00%976.11%744.66%4.66%17860.881183121042680.0433170.206362
W211821182100.00%897.53%665.58%5.58%15741.0085335853350.0348640.214435
I1212212100.00%178.02%41.89%1.89%9921.5915984253620.7385020.811715
I2150150100.00%149.33%10.67%0.67%10321.5311586176710.8976330.994475
I35252100.00%917.31%00.00%0.00%3564.42205390770.9104940.983871

Specifically, the sizefactors column is the size factors generated by spike-in normalization.

The example DHMR file is as below.

chromstartendbaseMeanlfcstatisticpvaluepadj
chr410527610010527640095.88-0.807237545127.637026661.463503254e-072.048904555e-06
chr410527250010527270086.7175-0.83738303519.458819011.027921214e-054.796965666e-05
chr410525960010525980042.4925-0.53201827735.6820209840.017139614270.03999243329

For example, three hypo-DHMRs are identified in chr4 between group T and group W.

Contact

Maintainer: Jin Li, lijin.abc@gmail.com. PI: De-Qiang Sun, dsun@tamu.edu.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc