forked from Paciorkowski-Lab/SOLVE-Brain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_index.pl
32 lines (27 loc) · 842 Bytes
/
print_index.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
#
#print_index.pl
#10/30/2013
#this is intended to help the user confirm the index number of samples in larger vcfs
#skips the first line of a vcf (in case there is a header line) and prints the index number and the content of each column in this second line
#prints to stdout
#usage: perl determine_index.pl <vcf_file>
#Dalia Ghoneim
use strict;
use warnings;
my $index_num=0;
my $line_num=0;
my $index;
my $file = shift;
open my ( $F ), $file or die $!;
LINE: while ($_=<$F>) {
my @line = split /\t/;
next if /^##/;
$line_num++;
if( $line_num == 2){
my $arraySize = scalar(@line);
for( $index=0; $index<$arraySize; $index++){
print "[$index] \t$line[$index]\n";
}
}
}