in reply to Re^2: RFC:Hacking Tie::File to read complex data
in thread RFC:Hacking Tie::File to read complex data
Where a module encapsulates several steps, and your inexperienced user knows exactly what to expect from said module, by all means use it. The trick comes when you change the rules (i.e. change the module) that the inexperienced user knows. By adapting the module for the special formats of the bioinformatics world, aren't you requiring an extra level of understanding? Whereas by being self-sufficient and learning the basics of Perl, "the 'official' language of bioinformatics", isn't the inexperienced user better positioned to handle whatever data processing need arises? Or have the minimal foundation necessary to glue in an appropriate Bio module from CPAN?
For getting a random line, while it may be wasteful of computer resources, it's certainly straightforward to simply do:
#open INFILE, '<', 'outfile.txt' or die "Could not open 'outfile.txt': + $!\n"; #my @seq_info = <INFILE>; #close INFILE; my @seq_info = <DATA>; print $seq_info[int rand ($#seq_info)]; __DATA__ seq_1 1 33 gene seq_1 1 20 exon seq_1 21 27 exon seq_1 28 33 exon seq_2 1 80 gene seq_2 1 80 exon seq_3 1 55 gene seq_3 1 30 exon seq_3 31 50 exon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: RFC:Hacking Tie::File to read complex data
by citromatik (Curate) on Jun 15, 2007 at 13:16 UTC |