-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patholigo_design_meth.pl
78 lines (62 loc) · 1.81 KB
/
oligo_design_meth.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
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
74
75
76
77
#!/usr/bin/perl -w
use strict;
use warnings;
use Getopt::Long;
use Data::Dumper;
use FindBin qw($Bin $Script);
use File::Basename qw(basename dirname);
require "/data/bioit/biodata/zenghp/bin/perl_mylib/tool.lib.pl";
my $BEGIN_TIME=time();
my $version="1.0.0";
#######################################################################################
# ------------------------------------------------------------------
# GetOptions
# ------------------------------------------------------------------
my ($fseq, $fmark,$fkey,$outdir);
GetOptions(
"help|?" =>\&USAGE,
"is:s"=>\$fseq,
"im:s"=>\$fmark,
"k:s"=>\$fkey,
"od:s"=>\$outdir,
) or &USAGE;
&USAGE unless ($fseq and $fmark and $fkey);
$outdir||="./";
`mkdir $outdir` unless (-d $outdir);
$outdir=AbsolutePath("dir",$outdir);
my ($min_len, $max_len, $scale_len)=split /,/, $range_len;
## get template seq containing snp
my %seq_snp;
if(defined $ftem_snp){
open(I, $ftem_snp) or die $!;
$/=">";
while(<I>){
chomp;
next if(/^$/);
my ($id_info, @line)=split /\n/, $_;
my $seq = join("", @line);
my ($id)=split /\s+/, $id_info;
$seq_snp{$id}=$seq;
}
}
#######################################################################################
print STDOUT "\nDone. Total elapsed time : ",time()-$BEGIN_TIME,"s\n";
#######################################################################################
# ------------------------------------------------------------------
# sub function
# ------------------------------------------------------------------
sub USAGE {#
my $usage=<<"USAGE";
Program:
Version: $version
Contact:zeng huaping<huaping.zeng\@genetalks.com>
Usage:
Options:
-i <file> Input file, forced
-k <str> Key of output file, forced
-od <dir> Dir of output file, default ./
-h Help
USAGE
print $usage;
exit;
}