in reply to Parsing .2bit DNA files
Also, it simplifies random access of the base stream directly from the file. You don't have to keep track of where you really are based on all the previous insertions.
The idea that .2bit files are more compressed is probably in relationship to the earlier .nib format which uses 4 bits per base. Clearly the frequency of N and M bases is such that the 2bit format is much more compact.
I think that a virtual api to a 2bit file would be useful. So you could do something like:
and minimal disk I/O is performed.my $twobit = new TwoBitFile('some/path.2bit'); # returns 1000 bases starting from base 40,000,000: my $bases = $twobit->range(40_000_000, 1000);
Update: Being able to treat the 2bit file as a virtual string with the ability to run regular expressions on it would also be really cool. Is that something we can do in Perl6?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing .2bit DNA files
by Limbic~Region (Chancellor) on Mar 05, 2008 at 23:23 UTC |