Perl 6 - the future is here, just unevenly distributed

IRC log for #bioperl, 2014-06-25

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
09:00 mkad joined #bioperl
09:00 mkad Hi
09:00 mkad Any bioperl AlignI developers here?
09:00 mkad I would like to change default behaviour of consensus_string function from preferring residus to gaps when its 50% of either one
09:01 mkad but I am also quite new to perl, so help would be appreciated
11:13 carandraug joined #bioperl
11:15 prevost joined #bioperl
11:40 mnb joined #bioperl
11:40 mkad joined #bioperl
11:40 mkad hi
11:40 mkad anyone here from bioperl ?
13:27 trs mkad: patience.
13:28 trs folks aren't always around at the same time, so just idle here and wait. :)
13:55 mkad trs, well I fixed my problem
13:55 mkad but I modified library
13:55 mkad I was wondering if its possible to avoid that
14:03 trs subclass?
14:04 trs that is, subclass the library you modified and make your modification via method inheritence rather than direct edits.
14:13 mkad hmm ok what do you mean by subclass?
14:14 mkad I want to modify SimpleAlign and sub _consensus_aa
14:14 mkad just that one function
14:16 trs mkad: are you familiar with object-oriented programming?  http://en.wikipedia.org/wiki/Subclass_(com​puter_science)#Subclasses_and_superclasses
14:17 carandraug mkad, clone the github repo, make the modification, and ask for a pull request
14:17 mkad trs, yes but not with the perl, I am new to perl
14:18 trs carandraug: that assumes the change is reasonable for core BioPerl
14:18 trs carandraug: and since it's a change in behaviour, I'd doubt it.
14:18 trs carandraug: but I'm not on the dev team, I just submit patches. :)
14:19 mkad trs, if someone could make this as an option, that would be nice
14:19 carandraug trs, requesting a pull request does not mean it will be accepted. He said he had a problem and fixed my modifying the library. I assumed a bugfix
14:19 mkad carandraug, bascialy I want > $threshold instead of >=
14:20 mkad carandraug, so that changes the default behaviour when I for example have two sequences in alignment and one is gap and one is residue, what to do as default ?
14:20 mkad carandraug, now library prefers residue
14:20 trs mkad: package Bio::SimpleAlign::mkad; use base 'Bio::SimpleAlign'; sub _consensus_aa { ... }  # just try to avoid copying too much
14:21 mkad carandraug, and that preference is hardcoded
14:21 * trs & for a while
14:23 carandraug mkad, well, you could argue that threshold is "the magnitude or intensity that must be exceeded for a certain reaction, phenomenon, result, or condition to occur or be manifested.". The definition is very explicit, it must be ">" and not ">="
14:24 mkad carandraug, by default it is >=
14:24 mkad if( $hash{$key} > $count && $hash{$key} >= $threshold) {
14:24 mkad right ?
14:24 mkad i wanted
14:24 mkad if( $hash{$key} > $count && $hash{$key} > $threshold) {
14:25 mkad of course I could use 50.00001 as threshold but thats not elegant I guess
14:25 mkad or not?
14:25 carandraug mkad, yes, I am seeing the source now. But according to the definition of threshold by the Oxford dictionary of English, this is a bug in bioperl
14:28 mkad I would make it an option
14:28 mkad because one might also want to prefer residues over gaps in some cases
14:28 mkad so >= and > should be selectable
14:28 carandraug mkad, an option to choose between ">" and ">=" seems overkill to me. And this is unlikely to be of much importance as you shouldn't be bothering with the precision of the = in floating points anyway
14:29 mkad if you have two residues
14:29 mkad gap or residue
14:29 mkad >= and > makes a difference how the consensus looks like
14:30 mkad either big chunk of consensus is there (in many cases for me almost half of it) or not
14:32 mkad ok will talk to you later
14:32 mkad trs, thanks
15:17 trs carandraug: there are also dictionary entries supporting >=.  there may be an argument that this is a bug (I don't see it personally), but claiming the OED makes this a bug is silly.
15:18 trs it doesn't really matter what the dictionary claims if changing the behaviour in a stable version of softwawre might dramatically change the results on people using it.
15:25 carandraug trs, I mentioned that dictionary because that's the one I had. I didn't meant it as if it was the dictionary to go by. Anyway, the comparison here is between floating points so no user should be counting on equality. Just change the machine and you may get a different answer.
15:26 trs carandraug: my issue isn't with any particular dictionary, it's with the suggestion that a dictionary should be the arbiter of bug or not bug here. :)
15:28 trs carandraug: it's only a float if the integers don't divide without a remainder, no?
15:28 trs carandraug: but yeah, I agree that in general with your sentiment about floats.
15:28 trs s/that //
15:29 carandraug trs, which is probably the case since $threshold is $n_sequences * $precentage / 100
15:30 carandraug trs, well, english is not my native language so I checked the dictionary about what a native would expect threshold to mean. Makes sense to me. You could argue that at the moment it's an "established API" but if documentation says threshold what do you do? Change the documentation or keep the documentation and fix the code? I really really don't like when projects keep bugs because of "established API"
15:31 trs to a native, threshold doesn't mean inherently > or >=.
15:31 trs that is, the documentation isn't the precise.
15:32 trs isn't *that* precise.
15:36 trs there are also lots of values for which $n_sequences * $percentage / 100 is just integer arithmetic.

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary