Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Parsing .2bit DNA files

by blokhead (Monsignor)
on Mar 06, 2008 at 05:49 UTC ( #672371=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my @CONV = glob( "{T,C,A,G}" x 4 );
    my $dna = join "", @CONV[ unpack "C*", $raw ];
  2. or download this
    ## takes 16 bits (= 8 bases = unsigned short) at a time
    my @CONV = glob( "{T,C,A,G}" x 8 );
    my $dna = join "", @CONV[ unpack "S*", $raw ];
  3. or download this
    substr($dna, $_, $mblock{$_}, lc(substr($dna, $_, $mblock{$_})))
  4. or download this
    substr($dna, $_, $mblock{$_}) ^= (" " x $mblock{$_});

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://672371]
[Corion]: choroba: Well, at least the above is user-defined, not implicitly by Perl ;)
LanX globalization is evil! Lets Perlxit!
[stevieb]: "Yeah, let's ban dot in INC, but add glob to it!" LOL!!!

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-01-19 15:44 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.