Advertisement
ProzacR

very simple vcf file filter

Aug 1st, 2018
3,435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.48 KB | None | 0 0
  1. #very simple vcf file filter
  2. #usage:
  3. #perl6 simple_filter.p6 filtered.vcf stock.vcf
  4. #VR
  5.  
  6. my @info;
  7.  
  8. #output:
  9. my $fh = open @*ARGS[0], :w;
  10.  
  11. for @*ARGS[1].IO.lines -> $line {
  12.         if $line ~~ /^\#/ {
  13.                 $fh.print("$line\n");
  14.         } else {
  15.                 @info = split(':', $line);
  16.                 #all you need is proper number here instead of 7 to catch investigated values and comparison
  17.                 $fh.print("$line\n") if @info[7] > 50;
  18.         }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement