Mercurial > repos > abossers > mummer_toolsuite
annotate MUMmer/nucmer_coords2ACT_galaxy.pl @ 0:6753195df9e0 default tip
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
| author | abossers |
|---|---|
| date | Tue, 07 Jun 2011 17:49:58 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
|
0
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
1 #!/usr/bin/perl |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
2 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
3 # converts the MUMmer-nucmer coords file in a file readable for Artemis Comparison Tool |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
4 # Output format is like crunch of BLAST |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
5 # |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
6 # [nov 2010] Galaxy wrapped up version |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
7 # |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
8 # Alex.Bossers@wur.nl |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
9 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
10 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
11 use warnings; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
12 use strict; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
13 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
14 #$filename=shift; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
15 #$ARGV[0] =~ m/^([A-Z0-9_.-]+)$/ig; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
16 my $filename = $ARGV[0]; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
17 #$ARGV[1] =~ m/^([A-Z0-9_.-]+)$/ig; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
18 my $fileout = $ARGV[1]; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
19 #my $filename = "Curated_vs_noncurated_8067_01.nucmer.coords"; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
20 #my $fileout = "Curated_vs_noncurated_8067_01.nucmer.tab"; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
21 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
22 open (COORDS,$filename) || die "error opening input coords file"; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
23 open (OUT,">$fileout") || die "error opening tab output file"; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
24 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
25 while (<COORDS>) |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
26 { |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
27 unless ($_ =~ /^(\s*)\d/){next} |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
28 $_ =~ s/\|//g; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
29 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
30 my @f = split; |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
31 # create crude match score = ((length_of_match * %identity)-(length_of_match * (100 - %identity))) /20 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
32 my $crude_plus_score=($f[4]*$f[6]); |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
33 my $crude_minus_score=($f[4]*(100-$f[6])); |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
34 my $crude_score= int(($crude_plus_score - $crude_minus_score) / 20); |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
35 # reorganise columns and print crunch format to stdout |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
36 # score %id S1 E1 seq1 S2 E2 seq2 (description) |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
37 print OUT " $crude_score $f[6] $f[0] $f[1] $f[7] $f[2] $f[3] $f[8] nucmer comparison coordinates\n" |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
38 } |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
39 |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
40 close (COORDS); |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
41 close (OUT); |
|
6753195df9e0
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
abossers
parents:
diff
changeset
|
42 print "Done!\n\n"; |
