Skip to content

Commit

Permalink
Include short preface in README
Browse files Browse the repository at this point in the history
  • Loading branch information
MaelLefeuvre committed May 27, 2024
1 parent 140389c commit 0a12770
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Perform hard selective masking of ancient DNA deamination patterns, using the ou

[![Ubuntu](https://github.com/MaelLefeuvre/pmd-mask/actions/workflows/Ubuntu.yml/badge.svg)](https://github.com/MaelLefeuvre/pmd-mask/actions/workflows/Ubuntu.yml) [![MacOS](https://github.com/MaelLefeuvre/pmd-mask/actions/workflows/MacOS.yml/badge.svg)](https://github.com/MaelLefeuvre/pmd-mask/actions/workflows/MacOS.yml)

# Preface

`pmd-mask` is a simple preprocessing and quality filtration command-line utility designed to selectively mask potentially deaminated nucleotides within ancient DNA alignement files, changing putative deaminated bases to ‘N’ and quality to ‘!’.

This method may be regarded as a conservative compromise between post-morterm damage rescaling methods such as [MapDamage](https://ginolhac.github.io/mapDamage/) or [PMDtools](https://github.com/pontussk/PMDtools), and hard-clipping methods such as [`bamUtils trimBam`]. Here, `pmd-mask` instead leverages nucleotide and position specific misincorporation rate estimes emitted from [MapDamage](https://ginolhac.github.io/mapDamage/) to selectively trim read ends, up-until the local misincorporation rate reaches a designated, user-defined threshold (default: 1%). This approach can thus greatly mitigate the loss of information usually displayed when applying hard-clipping on ancient DNA samples, by *specifically* targeting potential `C>T` and `G>A` transitions on both the 5’ and 3’ end of the read, respectively.


<p align="center">
<figure align="center">
<img src="docs/images/preface-illustration.png" alt="An illustration of how pmd-mask operates" title="This is a Title">
<figcaption>
<em>Figure 1.</em> An illustration of how pmd-mask operates.
</figcaption>
</figure>
</p>


# Installation

Expand Down
Binary file added docs/images/preface-illustration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/genome/coordinate/position.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::{self, Display, Formatter}};
use std::fmt::{self, Display, Formatter};
use serde::Deserialize;

/// Absolute or relative position within a chromosome or read (in base pairs).
Expand Down
2 changes: 1 addition & 1 deletion src/genome/orientation/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::{self, Display, Formatter}};
use std::fmt::{self, Display, Formatter};
use serde::Deserialize;

/// Encodes the orientation of a relative bam record position. Two possible variants:
Expand Down
5 changes: 5 additions & 0 deletions src/genome/strand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,9 @@ mod test {
assert_eq!(Strand::from_str("*"), Err(StrandError::ParseStrand("*".to_string())));
}

#[test]
fn from_char() {
assert_eq!('+', std::convert::Into::<char>::into(Strand::Forward));
assert_eq!('-', std::convert::Into::<char>::into(Strand::Reverse));
}
}
4 changes: 2 additions & 2 deletions src/mask/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl TryFrom<&Misincorporations> for Masks {
for position in value.iter() {
let record = MaskEntry{chromosome: position.chromosome.clone(), strand: position.strand};
masks.inner.entry(record)
.or_insert(MaskThreshold::default())
.or_default()
.set_threshold(position.end, position.position);
}

Expand Down Expand Up @@ -229,7 +229,7 @@ mod test {
mis_record!("chr1", Reverse, FivePrime, 8, 1000, 0.01),
mis_record!("chr1", Reverse, ThreePrime, 6, 600, 0.01),

].into_iter())
])
}

#[test]
Expand Down

0 comments on commit 0a12770

Please sign in to comment.