snystrom / memes

An R interface to the MEME Suite
https://snystrom.github.io/memes/
Other
43 stars 5 forks source link

runmeme breaks when providing control #114

Open seb-mueller opened 7 months ago

seb-mueller commented 7 months ago

Hi @snystrom, apologies for another issue, but since I'm playing around with this nice package I keep hitting edge cases I suppose.

This time it's about runMeme, which breaks given a control parameter, below is a reprducible example which is from the help file from runMeme (with with the parameter, using the same sequences


     seqs <- universalmotif::create_sequences("CCRAAAW", seqnum = 4)
     seqsc <- universalmotif::create_sequences("CCCCCCAAW", seqnum = 40)
     names(seqs) <- 1:length(seqs)
     names(seqsc) <- 1:length(seqsc)
     runMeme(seqs, parse_genomic_coord = FALSE, control = seqsc)

Writing results to output directory '/tmp/RtmpgC6gwc/file11f8ed53f38c13_vs_file11f8ed63d830f7'.
You may not use option '-neg' with option '-objfun classic'.

Error: Shell process had non-zero exit status.

I've checked the output dir which only has an empty meme.txt. Note that Streme works as expected, so maybe a typo somewhere? runStreme(seqs, parse_genomic_coord = FALSE, control = seqsc)

Update: Playing around a little, it seems it works by setting objfun differntly: runMeme(seqsc, parse_genomic_coord = FALSE, control = seqsc, objfun = "se") So it seems a meme cmd issues rather than for this package. Leaving this here anyways since it might bite others.

snystrom commented 7 months ago

~Can you share which meme version you are running? There may have been a change to default arguments or something in the cli.~

snystrom commented 7 months ago

Oh, actually. This isn't really a "bug" per-se, but a documented requirement. I should add a better warning message, though.

see the runMeme docs

control any data type as in input, or a character vector of names(input) to use those regions as control sequences. Using sequences as background requires an alternative objective function. Users must pass a non-default value of objfun to ... if using a non-NA control set (default: NA)

seb-mueller commented 7 months ago

Indeed, thanks for the feedback. Indeed, a few examples or clarifications could be beneficial, if you want, I can try to add some examples/clarifications in the doc as a PR?

snystrom commented 7 months ago

If you'd like to add extra docs, I'd happily consider a PR. I also sketched out a fix over at 5c2079e that I can test & finish tonight.