Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- use strict;
- use warnings;
- my $data = $ARGV[0];
- my ($line, @line, $effect);
- print "Chr\tPos\tRef\tAlt\tEffect\tBeta\tBeta_SE\tBeta_pval\n";
- open(DATA, "<$data");
- while(<DATA>) {
- $line = $_;
- chomp($line);
- @line = split(" ", $line);
- ## Check for the header
- if ($line =~ m/CHR/) {
- next;
- }
- ## If it is a possible indel, next line
- if (length ($line[3]) > 1 or length ($line[4]) > 1) {
- next;
- }
- $effect = $line[3];
- #$line[8] = log($line[8])/log(10);
- if ($line[8] < 0) {
- $effect = $line[4];
- $line[8] = -$line[8];
- }
- print "$line[0]\t$line[2]\t$line[3]\t$line[4]\t$effect\t$line[8]\t$line[9]\t$line[10]\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement