[Bioperl-l] Bio::AlignIO::Mase
Chris Fields
cjfields at illinois.edu
Wed Jun 8 14:51:48 UTC 2011
On Jun 8, 2011, at 8:38 AM, Jun Yin wrote:
> Hi, Tristan,
>
> For your first two questions,
>
> $entry =~ s/[^A-Za-z0-9\.\-]//g; # It recursively remove all non
> "A-Za-z0-9.-"
> If you change it to $entry =~ m/[^A-Za-z0-9\.\-]/; #It will find the first
> non "A-Za-z0-9.-", and do nothing (except return 1).
>
> '/[^' and '/^[' are two different things in the reg-exp. [^abc] means
> non-abc in the string. ^[abc] means the string should start with abc.
>
> I don't understand why you are looking for $/. $/ is OUTPUT_FIELD_SEPARATOR.
> You can set it in your own script, for example:
>
> $old_seperator=$/;
> $/="\t";
>
> Then the line should end with "\t". After that, you can change it back
> using:
> $/=$old_seperator;
or you can localize it to a block/sub, which is considered safer:
{
local $/ = undef;
# do rotten things here
}
# outside the block $/ returns to prior setting
> For your patch, I think it is written well. Since you don't want to remove
> the digits in your sequence, this is why
>
> $entry =~ s/[^A-Za-z\.\-]//g;
> is changed into
> $entry =~ s/[^A-Za-z0-9\.\-]//g;
>
> Otherwise, all your digits will be removed.
>
> Cheers,
> Jun Yin
> Ph.D. student in U.C.D.
We do have a nice suite of regression tests; I would check to see whether changes affect the test results, then (upon a failure) determine why the tests fail. In many cases the tests are possibly wrong or aren't complete. The latter may be the case for mase tests (seem pretty minimal):
[cjfields at pyrimidine bioperl-live (master)]$ ./Build test --test-files t/AlignIO/mase.t --verbose
...
t/AlignIO/mase.t ..
1..3
ok 1 - use Bio::AlignIO::mase;
ok 2 - The object isa Bio::Align::AlignI
ok 3 - mase input test
ok
All tests successful.
Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.17 cusr 0.02 csys = 0.23 CPU)
Result: PASS
[cjfields at pyrimidine bioperl-live (master)]$
chris
PS - nice to hear from you Jun! Need to talk to you about last year's GSoC code at some point.
More information about the Bioperl-l
mailing list