-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbedToAlign.pl
executable file
·125 lines (99 loc) · 2.86 KB
/
bedToAlign.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env perl
##---------------------------------------------------------------------------##
## File:
## @(#) bedToAlign.pl
## Author:
## Robert M. Hubley [email protected]
## Description:
## A simple script to convert alignment BED format to RepeatMasker
## *.align files.
##
#******************************************************************************
#* This software is provided ``AS IS'' and any express or implied *
#* warranties, including, but not limited to, the implied warranties of *
#* merchantability and fitness for a particular purpose, are disclaimed. *
#* In no event shall the authors or the Institute for Systems Biology *
#* liable for any direct, indirect, incidental, special, exemplary, or *
#* consequential damages (including, but not limited to, procurement of *
#* substitute goods or services; loss of use, data, or profits; or *
#* business interruption) however caused and on any theory of liability, *
#* whether in contract, strict liability, or tort (including negligence *
#* or otherwise) arising in any way out of the use of this software, even *
#* if advised of the possibility of such damage. *
#* *
#******************************************************************************
#
# ChangeLog
#
# $Log$
#
###############################################################################
#
# To Do:
#
=head1 NAME
bedToAlign.pl - Convert BED to *.align
=head1 SYNOPSIS
bedToAlign.pl [-version]
=head1 DESCRIPTION
A simple script for reversing the ./alignToBed -fullAlign *.align
conversion to a BED file.
The options are:
=over 4
=item -version
Displays the version of the program
=back
=head1 SEE ALSO
=head1 COPYRIGHT
Copyright 2021 Robert Hubley, Institute for Systems Biology
=head1 LICENSE
This code may be used in accordance with the Open Source License v. 3.0
http://opensource.org/licenses/OSL-3.0
=head1 AUTHOR
Robert Hubley <[email protected]>
=cut
#
# Module Dependence
#
use strict;
use Getopt::Long;
use Data::Dumper;
my $Version = "1.0";
#
# Magic numbers/constants here
# ie. my $PI = 3.14159;
#
my $DEBUG = 0;
#
# Option processing
# e.g.
# -t: Single letter binary option
# -t=s: String parameters
# -t=i: Number paramters
#
my @getopt_args = (
'-version', # print out the version and exit
);
my %options = ();
Getopt::Long::config("noignorecase", "bundling_override");
unless (GetOptions(\%options, @getopt_args)) {
usage();
}
sub usage {
print "$0 - $Version\n\n";
exec "pod2text $0";
exit;
}
if ($options{'version'}) {
print "$Version\n";
exit;
}
while (<>)
{
if ( /^\S+\t\d+\t\d+\t(\S.*)/ )
{
my $align_str = $1;
$align_str =~ s/\$/\n/g;
print "$align_str\n";
}
}