annotate miranda2asko.pl @ 1:605bb64c2668 draft default tip

planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
author genouest
date Wed, 18 Apr 2018 06:26:33 -0400
parents 3f6cdc878f35
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
1 use strict;
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
2 use warnings;
1
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
3 use Getopt::Long;
0
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
4
1
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
5 my $miranda;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
6 my $mature;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
7
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
8 GetOptions ("miranda=s" => \$miranda,
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
9 "mature=s" => \$mature);
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
10
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
11
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
12 open MAT, $mature or die "failed to open $mature\n";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
13 open OUT_MIR, ">mirna.asko.tsv" or die "failed to open mirna.asko.tsv";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
14 my $mirna="";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
15 my $mirna_seq="";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
16 my $start=1;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
17 print OUT_MIR "mirna\tseq\n";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
18 while (<MAT>) {
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
19 chomp;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
20 if (/^>(\S+)/) {
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
21 unless ($start==1) {
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
22 print OUT_MIR $mirna, "\t", $mirna_seq, "\n";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
23 }
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
24 $start=0;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
25 $mirna=$1;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
26 $mirna_seq="";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
27 next;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
28 }
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
29 $mirna_seq.=$_;
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
30 }
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
31 print OUT_MIR $mirna, "\t", $mirna_seq, "\n";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
32
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
33
0
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
34 open MIRANDA, $miranda or die "failed to open $miranda\n";
1
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
35 open TARGET, ">target.asko.tsv" or die "failed to open target.asko.tsv\n";
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
36 print TARGET "target\ttargets\@mirna\ttargets\@mRNA\tscore\tenergy\talignment length\tglobal coverage\tseed coverage\n";
0
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
37
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
38 while (<MIRANDA>) {
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
39 chomp;
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
40 my ($mirna, $target, $score, $energy,$pos1, $pos2,$alnlength, $glcov, $seedcov)=split "\t";
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
41 $mirna=~ s/^>//;
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
42 $target=~s/_UTR3$//;
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
43 $glcov=~ s/\%$//;
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
44 $seedcov=~ s/\%$//;
1
605bb64c2668 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit dea4b3dfc2393e4f5b9945099cfec37afe471283
genouest
parents: 0
diff changeset
45 print TARGET join ("\t", $mirna.'.'.$target, $mirna, $target, $score, $energy,$alnlength, $glcov, $seedcov), "\n";
0
3f6cdc878f35 planemo upload for repository https://github.com/genouest/galaxy-tools/tree/master/tools/miranda2asko commit bd6737d0fba64ed6e7d3be5267868942674696ea
genouest
parents:
diff changeset
46 }