Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
c3087343
Commit
c3087343
authored
21 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Yay! First commit.
Fixed comments, added gap counting.
parent
422fb232
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/protein_match/new_pmatch_wrapper.pl
+20
-9
20 additions, 9 deletions
misc-scripts/protein_match/new_pmatch_wrapper.pl
with
20 additions
and
9 deletions
misc-scripts/protein_match/new_pmatch_wrapper.pl
+
20
−
9
View file @
c3087343
...
...
@@ -78,25 +78,27 @@ close(PMATCH);
unlink
(
$pmatch_out
);
# Get rid of pmatch output file
# Sort the %hits hash on QSTART, then on TSTART.
# Also calculate the lengths of any overlaps in the query or target.
foreach
my
$query
(
values
(
%hits
))
{
foreach
my
$target
(
values
(
%
{
$query
}))
{
# Sort the %hits hash on QSTART, then on TSTART.
@
{
$target
->
{
HITS
}
}
=
sort
{
$a
->
{
QSTART
}
<=>
$b
->
{
QSTART
}
||
$a
->
{
TSTART
}
<=>
$b
->
{
TSTART
}
}
@
{
$target
->
{
HITS
}
};
# Figure out how long the query and target overlaps are.
# The first hit for any $qid<->$tid combination will never
# have QOVERLAP or TOVERLAP keys (since it's not preceeded
# by another hit). This loop also calculates the total
# length of the hits and the overlaps.
# Figure out how long the query and target overlaps
# are. This loop also calculates the total length of
# the hits and the overlaps.
my
$qoverlap
=
0
;
# Total query overlap length
my
$toverlap
=
0
;
# Total target overlap length
my
$totlen
=
0
;
# Total hit length
my
$qgaps
=
0
;
# Number of gaps in the query
my
$tgaps
=
0
;
# Number of gaps in the target
# Are these interesting?
my
@pair
;
foreach
my
$hit
(
@
{
$target
->
{
HITS
}
})
{
$totlen
+=
$hit
->
{
LENGTH
};
...
...
@@ -105,18 +107,27 @@ foreach my $query (values(%hits)) {
push
(
@pair
,
$hit
);
next
if
(
scalar
(
@pair
)
!=
2
);
$qoverlap
+=
my
$overlap
;
$overlap
=
overlap
([
$pair
[
0
]{
QSTART
},
$pair
[
0
]{
QEND
}],
[
$pair
[
1
]{
QSTART
},
$pair
[
1
]{
QEND
}]);
$qoverlap
+=
$overlap
;
++
$qgaps
if
(
$overlap
==
0
);
# ($overlap <= 1 ???)
$
t
overlap
+
=
$overlap
=
overlap
([
$pair
[
0
]{
TSTART
},
$pair
[
0
]{
TEND
}],
[
$pair
[
1
]{
TSTART
},
$pair
[
1
]{
TEND
}]);
$toverlap
+=
$overlap
;
++
$tgaps
if
(
$overlap
==
0
);
# ($overlap <= 1 ???)
}
# Calculate the query and target identities
$target
->
{
QIDENT
}
=
100
*
(
$totlen
-
$qoverlap
)
/
$target
->
{
QLEN
};
$target
->
{
TIDENT
}
=
100
*
(
$totlen
-
$toverlap
)
/
$target
->
{
TLEN
};
$target
->
{
QGAPS
}
=
$qgaps
;
$target
->
{
TGAPS
}
=
$tgaps
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment