new file: cell2loc.py
[GalaxyCodeBases.git] / perl / etc / justonce / checkrange.pl
blob4d95f69326c8ee36ab9f8435fd1b4ec77769129e
1 #!/usr/bin/env perl
3 use strict;
4 use warnings;
6 use Data::Dump qw(ddx);
8 my %STRs;
9 while (my $data_string = <DATA>) {
10 chomp($data_string);
11 next if not length $data_string;
12 next if $data_string =~ /^#/;
13 #print "[$data_string]\n";
14 my @item = split /\t/,$data_string;
15 $STRs{$item[1]} = [$item[3],$item[4]];
17 ddx \%STRs;
19 # bcftools query -f '%CHROM\t%POS\t%ID\t%REF,%ALT[\t%TGT]\n' ALL.chrY.phase3_integrated_v2a.20130502.genotypes.vcf.gz|less -S
21 while (<>) {
22 chomp;
23 my ($chr,$pos,$id) = split /\t/;
24 #print "$chr,$pos,$id\n";
25 next if $chr ne 'Y';
26 for my $k (sort keys %STRs) {
27 my ($st,$ed) = @{$STRs{$k}};
28 #print "$st,$ed $pos\n";
29 if (($st <= $pos+200) and ($ed >= $pos-200)) {
30 print join("\t",$k,$st,$ed,$chr,$pos,$id),"\n";
34 __DATA__
35 #Tag ID Chr Start End
36 Y-STR AMEL Y 6868712 6868744
37 Y-STR DYF387S1a Y 23785361 23785500
38 Y-STR DYF387S1b Y 25884581 25884724
39 Y-STR DYF404S1a Y 23807934 23808051
40 Y-STR DYF404S1b Y 25862038 25862147
41 Y-STR DYS19 Y 9684380 9684443
42 Y-STR DYS385a Y 18639713 18639756
43 Y-STR DYS385b Y 18680632 18680687
44 Y-STR DYS388 Y 12635604 12635639
45 Y-STR DYS389I Y 12500448 12500495
46 Y-STR DYS389II Y 12500448 12500611
47 Y-STR DYS390 Y 15163067 15163162
48 Y-STR DYS391 Y 11982089 11982132
49 Y-STR DYS392 Y 20471987 20472025
50 Y-STR DYS393 Y 3263111 3263158
51 Y-STR DYS437 Y 12346267 12346326
52 Y-STR DYS438 Y 12825889 12825948
53 Y-STR DYS439 Y 12403517 12403564
54 Y-STR DYS444 Y 17114310 17114365
55 Y-STR DYS447 Y 13166829 13166953
56 Y-STR DYS448 Y 22218923 22219078
57 Y-STR DYS449 Y 8349973 8350138
58 Y-STR DYS456 Y 4402919 4402978
59 Y-STR DYS458 Y 7999839 7999902
60 Y-STR DYS459a Y 23932704 23932743
61 Y-STR DYS459b Y 25737373 25737408
62 Y-STR DYS460 Y 18888956 18888995
63 Y-STR DYS481 Y 8558337 8558402
64 Y-STR DYS510 Y 15188001 15188088
65 Y-STR DYS518 Y 15207988 15208145
66 Y-STR DYS522 Y 7547585 7547624
67 Y-STR DYS527a Y 23739650 23739733
68 Y-STR DYS527b Y 25930351 25930426
69 Y-STR DYS531 Y 8598154 8598197
70 Y-STR DYS533 Y 16281349 16281396
71 Y-STR DYS549 Y 19358338 19358389
72 Y-STR DYS557 Y 21072786 21072889
73 Y-STR DYS570 Y 6993190 6993257
74 Y-STR DYS576 Y 7185318 7185385
75 Y-STR DYS593 Y 16473882 16473956
76 Y-STR DYS596 Y 8519499 8519594
77 Y-STR DYS627 Y 8781984 8782055
78 Y-STR DYS635 Y 12258860 12258951
79 Y-STR DYS643 Y 15314132 15314186
80 Y-STR DYS645 Y 21166023 21166057
81 Y-STR YGATAA10 Y 16607009 16607060
82 Y-STR YGATAH4 Y 16631673 16631720
83 Y-STR Yindel Y 13396821 13396825