Skip to content

Commit c632278

Browse files
authored
Propagate an explicit denominator to the builder when creating d4 file (#108)
1 parent d4f8acb commit c632278

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

d4tools/src/create/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ impl CreateAppCtx {
272272

273273
fn determine_default_denominator(&mut self, matches: &ArgMatches) -> Result<(), DynErr> {
274274
if self.denominator.is_some() {
275+
self.builder.set_denominator(self.denominator.unwrap());
275276
return Ok(());
276277
}
277278

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
${D4TOOLS} create --denominator 100 -g genome.size input.bedgraph ${OUTDIR}/out.d4 && \
2+
${D4TOOLS} view ${OUTDIR}/out.d4
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
chr1 1000
2+
chr2 1000
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
chr1 100 200 0.2
2+
chr2 300 400 10.8
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
chr1 0 100 0
2+
chr1 100 200 0.2
3+
chr1 200 1000 0
4+
chr2 0 300 0
5+
chr2 300 400 10.8
6+
chr2 400 1000 0

0 commit comments

Comments
 (0)