[BioRuby] Sequence Documentation Patch
Ryan Raaum
rlr215 at nyu.edu
Wed Mar 8 15:04:18 UTC 2006
Good Morning,
Jan and I were able to reconcile our respective documentation attempts
into a single documentation patch. Here's an example of the final
format:
(documentation for the Bio::Sequence::Common#subseq method)
# Returns a new sequence containing the subsequence identified by the
# start and end numbers given as parameters. *Important:* Biological
# sequence numbering conventions (one-based) rather than ruby's
# (zero-based) numbering conventions are used.
#
# s = Bio::Sequence::NA.new('atggaatga')
# puts s.subseq(1,3) #=> "atg"
#
# Start defaults to 1 and end defaults to the entire existing string,
so
# subseq called without any parameters simply returns a new sequence
# identical to the existing sequence.
#
# puts s.subseq #=> "atggaatga"
# ---
# *Arguments*:
# * (optional) _s_(start): Integer (default 1)
# * (optional) _e_(end): Integer (default current sequence length)
# *Returns*:: new Bio::Sequence::NA/AA object
Hopefully this will be useful for new users.
Those changes from the first version of this patch that Toshiaki noted
as being wrong or against the API were removed.
I also made two more bug fixes (in addition to those already described).
1. Added 'U' and 'u' to the bases counted towards the nucleic acid
total in Bio::Sequence#guess. (Without this, RNA sequences were
"guessed" to be Amino Acid sequences).
2. Changed the arguments for method_missing in Bio::Sequence from
(*arg) to (sym, *args, &block). With this argument set, blocks will be
properly passed through to the encapsulated object.
Cheers!
-Ryan
-------------- next part --------------
On Mar 7, 2006, at 12:34 PM, Toshiaki Katayama wrote:
> Ryan,
>
> Thank you for your quick fix.
> I quote your mail as it was not posted to the list.
>
>> Also, in the last round of editing, I made a small change to the
>> Bio::Sequence#guess function.
>
> Thanks. This bug was introduced when I added length and index
> arguments...
>
> Toshiaki
>
>
> On 2006/03/08, at 0:56, Ryan Raaum wrote:
>
>> Hi All,
>>
>>
>>>
>>> On 2006/03/07, at 0:14, Ryan Raaum wrote:
>>>> # s = Bio::Sequence::Generic.new('atggaatga')
>>>
>>> If you will utilize this documentation, please change
>>> this example to use Bio::Sequence::NA.
>>>
>>
>> Done. (For this and all other examples using Bio::Sequence::Generic)
>>
>>> Bio::Sequence::Generic is just for developers - to hold
>>> gaps, spaces etc. intact - mainly for multiple alignment.
>>>
>>
>> Made Bio::Sequence::Generic :nodoc:
>>
>>>>
>>>> 1. Added a whitespace stripping initialize method to
>>>> Bio::Sequence::Generic to make it consistent with Bio::Sequence::AA
>>>> and Bio::Sequence::NA in that respect.
>>>
>>>
>>> The Bio::Sequence::Generic is not intended to strip.
>>
>> Removed the added method.
>>
>>>
>>> In addition to this, why you made Bio::Sequence#guess method as
>>> :nodoc: ?
>>> Seuence type guessing is not perfect so there need to be an interface
>>> to change threshold etc.
>>
>> Documented the guess methods.
>>
>>> On March 1, Jan also sent me a documented version of sequence.rb.
>>> I'm sorry that I should post it on the list as soon as possible.
>>>
>>> Anyway, could you contact him to merge your documentations?
>>> If both of you are agreed, I'll commit your patch.
>>
>> If Jan will send me his sequence.rb, I can merge it with mine and
>> send the merged file back to Jan. After he's edited the merge to his
>> liking, we can put it all together and send it in as a unified patch.
>>
>>
>> Also, in the last round of editing, I made a small change to the
>> Bio::Sequence#guess function. In the line where the "total" is
>> calculated, the original version used the length of the @seq as the
>> starting length, but for the length and index parameters to work
>> properly with the threshold value, the length of the guess string
>> (`str` is the local method variable) is what should be the base
>> length.
>>
>> Best,
>>
>> -Ryan
>>
>
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
More information about the BioRuby
mailing list