-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_grch38_nonpseudoautosomal_regions_bed
executable file
·73 lines (56 loc) · 1.28 KB
/
create_grch38_nonpseudoautosomal_regions_bed
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/perl
use warnings;
use strict;
use POSIX qw(ceil floor);
use File::Basename;
use File::Path;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
create_grch37_nonpseudoautosomal_region_bed
=head1 SYNOPSIS
create_grch37_nonpseudoautosomal_region_bed [options] <filename>
-v verbose
-d debug
-o output contig directory.
usage: convert_vcf_2_bed input.vcf
Creates a BED file containing the nonpseudoautosomal regions for GRCh38.
=head1 DESCRIPTION
=cut
#option variables
my $help;
my $outputBEDFile;
#initialize options
Getopt::Long::Configure ('bundling');
if(!GetOptions ('h'=>\$help,
'o:s'=>\$outputBEDFile)
|| scalar(@ARGV)!=0)
{
if ($help)
{
pod2usage(-verbose => 2);
}
else
{
pod2usage(1);
}
}
if ($outputBEDFile =~ /bed.gz$/)
{
open(OUT, "| bgzip -c > $outputBEDFile");
}
else
{
open(OUT, ">$outputBEDFile");
}
#GRCh38 pseudoautosomal regions
#PAR1 X 10,001 2,781,479 Xp22
# Y 10,001 2,781,479 Yp11
#PAR2 X 155,701,383 156,030,895 Xq28
# Y 56,887,903 57,217,415 Yq12
#chrX 156040895 /gbdb/hg38/hg38.2bit
#chrY 57227415 /gbdb/hg38/hg38.2bit
#note that positions are 0 based exclusive
print OUT "chrX\t2781479\t155701383\n";
print OUT "chrY\t2781479\t56887903\n";
close(OUT);