[](http://bioconda.github.io/recipes/bioconductor-dialignr/README.html)
[](https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/galaxyp/dialignr/dialignr)
# DIAlignR
DIAlignR is an R package for retention time alignment of targeted mass spectrometric data, including DIA and SWATH-MS data. This tool works with MS2 chromatograms directly and uses dynamic programming for alignment of raw chromatographic traces. DIAlignR uses a hybrid approach of global (feature-based) and local (raw data-based) alignment to establish correspondence between peaks.
[](https://travis-ci.com/shubham1637/DIAlignR)
# Documentation
For documentation please see [our vignette](https://htmlpreview.github.io/?https://github.com/shubham1637/DIAlignR/master/vignettes/DIAlignR-vignette.html).
# Developing C++ code
```
cd DIAlignR
mkdir build && cd build
cmake -B. -H..
make clean && make && make test
make runTest3
cd ..
```
Documenting C++ code
```
sudo apt install doxygen doxygen-gui
sudo apt install graphviz
cd DIAlignR
cd src
doxygen doc/Doxyfile
```
# Installing Rcompression
`devtools::install_github("omegahat/Rcompression")`
# Docker



## Pull image
```
docker push singjust/dialignr:2.0.0
```
## Build image
```
docker build --no-cache -t singjust/dialignr:2.0.0 .
```
## Run Command
```
$docker run -it --rm -v `pwd`:/data singjust/dialignr:2.0.0
Name:
Run DIAlignR's alignTargetedRuns via the Command Line
Usage:
Rscript alignTargetedRuns_cli.R --dataPath=/data/ [args] | --help
Example: Rscript alignTargetedRuns_cli.R --dataPath=/data/osw/ --params=context:experiment-wide,maxFdrQuery:0.01
Example2: Rscript alignTargetedRuns_cli.R --dataPath=/data/osw/ --oswMerged=FALSE --params=context:experiment-wide,maxFdrQuery:0.01 --runs=run0,run1,run2 --peps=0,1 --applyFun=BiocParallel::bplapply --regBioCP=BiocParallel::register(BiocParallel::MulticoreParam(workers=4,progressbar=TRUE))
Options:
--dataPath: path to xics and osw directory.
--outFile: name of the output file.
--oswMerged: TRUE for experiment-wide FDR and FALSE for run-specific FDR by pyprophet.
--params: Parameters for the alignment functions generated from DIAlignR::paramsDIAlignR(). Separate keys and values using a ':', and separate parameters using ','. Example: --params=context:experiment-wide,maxFdrQuery:0.01,fitEMG:TRUE
--runs: names of xics file without extension. Separate runs using ','. Example: --runs=run0,run1,run2
--refRun: reference for alignment. If no run is provided, m-score is used to select reference run.
--peps: ids of peptides to be aligned. If NULL, align all peptides. Separate peptide ids using ','. Example--peps=1,2,3
--appyFun: value must be either lapply or BiocParallel::bplapply.
--regBioCP: If using BiocParallel::bplapply, register cores to use. Example: --regBioCP=BiocParallel::register(BiocParallel::MulticoreParam(workers=4,progressbar=TRUE)) . Make sure there are no spaces in this command
--help: Display this help message
```
## Example
```
docker run -it --rm -v `pwd`:/data singjust/dialignr:2.0.0 --dataPath=/data/ --outFile=/data/dialignr
```
# Snakemake
To run the snakemake workflow, you need to ensure you have [snakemake](https://snakemake.readthedocs.io/en/stable/getting_started/installation.html) and [singularity](https://sylabs.io/guides/3.0/user-guide/installation.html#build-and-install-an-rpm) installed.
To change parameters for your experiment, edit the input, output and parameters in the [snakemake/Snakefile.dialignr](https://github.com/singjc/DIAlignR/blob/feature/docker/snakemake/Snakefile.dialignr) file.
## Run Command
Snakefile.dialignr will need to be in the same directory as **cmd.sh**
```
$cd snakemake
$bash cmd.sh
```
# Citation
If you use the provided algorithms or the package, please cite our paper:
Gupta S, Ahadi S, Zhou W, Röst H. "DIAlignR Provides Precise Retention Time Alignment Across Distant Runs in DIA and Targeted Proteomics." Mol Cell Proteomics. 2019 Apr;18(4):806-817. doi: https://doi.org/10.1074/mcp.TIR118.001132 Epub 2019 Jan 31.
CNPN 2018 Poster doi: https://doi.org/10.6084/m9.figshare.6200837.v1
HUPO 2018 Poster doi: https://doi.org/10.6084/m9.figshare.7121696.v2