Welcome to pydamage’s documentation!¶
Homepage: github.com/maxibor/pydamage
Introduction¶
Pydamage, is a Python software to automate the process of contig damage identification and estimation. It uses a process akin to a likelihood ratio test to attempt to discriminate between truly ancient, and modern contigs originating from sample contamination.
Install¶
Pydamage is not yet on pypi nor conda, but you can already install it using pip, provided that you have access to this repository.
Install dependencies in conda environment¶
git clone git@github.com:maxibor/pydamage.git
cd pydamage
conda env create -f environment.yml
conda activate pydamage
Install pydamage¶
- from source
python setup.py install
- from Github using pip
pip install git+ssh://git@github.com/maxibor/pydamage.git
API¶
-
pydamage.main.
analyze
(bam, wlen=30, show_al=False, mini=2000, cov=0.5, process=1, outdir='', plot=False, verbose=False, force=False)[source]¶ Runs the pydamage analysis
Parameters: - bam (str) – Path to alignment (sam/bam/cram) file
- wlen (int) – window length
- show_al (bool) – print alignments representations
- mini (int) – Minimum numbers of reads aligned to consider contigs
- cov (float) – Minimum coverage to consider contig
- process (int) – Number of processes for parellel computing
- outdir (str) – Path to output directory
- verbose (bool) – verbose mode
- force (bool) – force overwriting of results directory
Returns: pandas DataFrame containg pydamage results
Return type: pd.DataFrame
CLI¶
To access the help menu:
$ pydamage --help
The list of arguments of options is detailed below
pydamage¶
BAM: path to BAM/SAM/CRAM alignment file
pydamage [OPTIONS] BAM
Options
-
--version
¶
Show the version and exit.
-
-w
,
--wlen
<wlen>
¶ Window length for damage modeling [default: 35]
-
-p
,
--process
<process>
¶ Number of processes [default: 2]
-
-m
,
--mini
<mini>
¶ Minimum reads aligned to consider reference [default: 1000]
-
-c
,
--cov
<cov>
¶ Minimum coverage to consider reference [default: 8]
-
-s
,
--show_al
¶
Show alignments representations
-
-pl
,
--plot
¶
Make the damage plots
-
--verbose
¶
Verbose mode
-
-o
,
--outdir
<outdir>
¶ Output directory [default: pydamage_results]
-
--force
¶
Force overwriting of results directory
Arguments
-
BAM
¶
Required argument