Skip to content

Instantly share code, notes, and snippets.

@MattOates
Created August 3, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattOates/b983d9cb97886861b5c10f89715f9431 to your computer and use it in GitHub Desktop.
Save MattOates/b983d9cb97886861b5c10f89715f9431 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use Compress::Zlib;
use IO::String;
my $DATA_DIR = %*ENV<DATA_DIR> // '/Users/matt/data/reference/GRCh37/sequence/dna';
for dir($DATA_DIR).grep(/chr\d+\.fa\.gz/) -> $file {
my $out_file = $file.IO.extension('txt', :2parts).open(:w);
my $chromosome = IO::String.new(buffer=>gzslurp($file));
for $chromosome.lines -> $line {
FIRST { next }
chomp $line;
$out_file.print($line);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment