databio / gtars

Performance-critical tools to manipulate, analyze, and process genomic interval data. Primarily focused on building tools for geniml - our genomic machine learning python package.
3 stars 2 forks source link

Dev narrow peak scoring #36

Closed donaldcampbelljr closed 1 month ago

donaldcampbelljr commented 1 month ago

Add counting based on narrowpeak score.

Can now give uniwig a narrowPeak file and and set score flag via

-o true

Also refactored for convenience.

nleroy917 commented 1 month ago

Just ran it now and it seems to work! Very briefly... I was wondering if we could make that -o flag a boolean just by itself. I wonder if saying -o true is a tad redundant because we can just say -o and that represents true. The absence of the flag, therefore, represents false.

nleroy917 commented 1 month ago

Pending creation of .bw files and inspecting in IGV

donaldcampbelljr commented 1 month ago

Just ran it now and it seems to work! Very briefly... I was wondering if we could make that -o flag a boolean just by itself. I wonder if saying -o true is a tad redundant because we can just say -o and that represents true. The absence of the flag, therefore, represents false.

Yes. I would prefer that, but CLAP was giving me issues with it last week. I suppose I was just doing it wrong? Can you shed some light on how the argument should be wired up? .default_value(true) or .default_value('true') or .default_value(1) all seemed to give me a compiler error.

nleroy917 commented 1 month ago

https://stackoverflow.com/a/60458834/13175187

I think you can set, on your Arg struct:

.num_args(0)
nleroy917 commented 1 month ago

So, maybe this?

.arg(
    Arg::with_name("metal")
        .long("metal-micky")
        .required(false)
        .num_args(0)
        .help("I want metal micky"),
)
donaldcampbelljr commented 1 month ago

This one worked: https://stackoverflow.com/a/77643381

.arg(
    Arg::new("metal")
        .long("metal-micky")
        .short('m')
        .action(ArgAction::SetTrue)
        .help("I want metal micky"),
)