|< 1 2 >| | 13 Einträge, 2 Seiten |
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
#!/usr/bin/perl -w
use Tie::File;
tie @array, 'Tie::File', 'BlastOutput_2.txt' or die ("Could not open File");
print "opened file and stored content in array \n";
$even = 2;
$odd = 1;
$oddfurther = 3;
print "intialized variables unique \n";
print "\n";
for ($count = 0, $count <= $#array, $count += 2) { #count from the first line to the last line in the file
print "entered for loop \n";
print "trying to perform 1 if \n"; &n
bsp; &n
bsp;
if ($array[$count] eq $array[$even] && $array[$odd] eq $array[$oddfurther]) { #0 eq 2 && 1 eq 3 => delete both
print "entered 1 if condition \n";
splice (@array,$even,1); &n
bsp; #delete 2
splice (@array,$oddfurther,1); &n
bsp; #delete 3
print "trying to perform 2 if \n";
if ($array[$count] eq $array[$even] && $array[$odd] ne $array[$oddfurther]) { #0 eq 2 && 1 ne 3 => delete 2
print "entered 2 if condition";
splice (@array,$even,1); &n
bsp; #delete 2
}
}
$even += 2; #starts with 2 and becomes 4 aso..
$odd += 2; #starts with 1 and becomes 3 aso..
$oddfurther += 2; #starts with 3 and becomes 5 aso..
print "increased variables \n";
print "\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
Seq: 746 WRWRWRWW 753
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
Seq: 744 WRWRWRW 750
dbj|BAD87001.1|-->hypothetical protein [Oryza sativa (japonica cultivar-group)] dbj|BAD86933.1| hypothetical protein [Oryza sativa (japonica cultivar-group)]
Seq: 51 WRWRWRWW 58
dbj|BAD87001.1|-->hypothetical protein [Oryza sativa (japonica cultivar-group)] dbj|BAD86933.1| hypothetical protein [Oryza sativa (japonica cultivar-group)]
Seq: 49 WRWRWRW 55
gb|AAX96019.1|-->hypothetical protein LOC_Os11g07590 [Oryza sativa (japonica cultivar-group)] gb|ABA91724.1| hypothetical protein LOC_Os11g07590 [Oryza sativa (japonica cultivar-group)]
Seq: 77 WWWRRRWW 84
ref|XP_463574.1|-->P0497A05.2 [Oryza sativa (japonica cultivar-group)] dbj|BAB92559.1| P0497A05.2 [Oryza sativa (japonica cultivar-group)]
Seq: 124 WRWRWRWW 131
ref|XP_720804.1|-->hypothetical protein CaO19_13829 [Candida albicans SC5314] gb|EAL01978.1| hypothetical protein CaO19.13829 [Candida albicans SC5314]
Seq: 28 WWKWRW 33
dbj|BAE44752.1|-->hypothetical protein [Candida albicans] ref|XP_721316.1| hypothetical protein CaO19.6475 [Candida albicans SC5314] gb|EAL02511.1| hypothetical protein CaO19.6475 [Candida albicans SC5314] ref|XP_888855.1| hypothetical protein CaJ7.0276 [Candida albicans SC5314]
Seq: 28 WWKWRW 33
ref|ZP_00245446.1|-->COG0665: Glycine/D-amino acid oxidases (deaminating) [Rubrivivax gelatinosus PM1]
Seq: 86 WRWLWRWW 93
gb|AAM90664.1|-->putative pyruvate kinase [Deschampsia antarctica]
Seq: 11 WWKWWLRRWW 20
gb|AAM90664.1|-->putative pyruvate kinase [Deschampsia antarctica]
Seq: 19 WWKWWLRRWW 28
gb|AAM90664.1|-->putative pyruvate kinase [Deschampsia antarctica]
Seq: 6 WWLRRWW 12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
Seq: 746 WRWRWRWW 753
Seq: 744 WRWRWRW 750
dbj|BAD87001.1|-->hypothetical protein [Oryza sativa (japonica cultivar-group)] dbj|BAD86933.1| hypothetical protein [Oryza sativa (japonica cultivar-group)]
Seq: 51 WRWRWRWW 58
Seq: 49 WRWRWRW 55
gb|AAX96019.1|-->hypothetical protein LOC_Os11g07590 [Oryza sativa (japonica cultivar-group)] gb|ABA91724.1| hypothetical protein LOC_Os11g07590 [Oryza sativa (japonica cultivar-group)]
Seq: 77 WWWRRRWW 84
ref|XP_463574.1|-->P0497A05.2 [Oryza sativa (japonica cultivar-group)] dbj|BAB92559.1| P0497A05.2 [Oryza sativa (japonica cultivar-group)]
Seq: 124 WRWRWRWW 131
ref|XP_720804.1|-->hypothetical protein CaO19_13829 [Candida albicans SC5314] gb|EAL01978.1| hypothetical protein CaO19.13829 [Candida albicans SC5314]
Seq: 28 WWKWRW 33
dbj|BAE44752.1|-->hypothetical protein [Candida albicans] ref|XP_721316.1| hypothetical protein CaO19.6475 [Candida albicans SC5314] gb|EAL02511.1| hypothetical protein CaO19.6475 [Candida albicans SC5314] ref|XP_888855.1| hypothetical protein CaJ7.0276 [Candida albicans SC5314]
Seq: 28 WWKWRW 33
ref|ZP_00245446.1|-->COG0665: Glycine/D-amino acid oxidases (deaminating) [Rubrivivax gelatinosus PM1]
Seq: 86 WRWLWRWW 93
gb|AAM90664.1|-->putative pyruvate kinase [Deschampsia antarctica]
Seq: 11 WWKWWLRRWW 20
Seq: 19 WWKWWLRRWW 28
Seq: 6 WWLRRWW 12
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
opened file and stored content in array
intialized variables unique
entered for loop
trying to perform 1 if
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
Seq: 746 WRWRWRWW 753
Seq: 744 WRWRWRW 750
increased variables
entered for loop
trying to perform 1 if
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
dbj|BAD87001.1|-->hypothetical protein [Oryza sativa (japonica cultivar-group)] dbj|BAD86933.1| hypothetical protein [Oryza sativa (japonica cultivar-group)]
Seq: 744 WRWRWRW 750
Seq: 51 WRWRWRWW 58
increased variables
entered for loop
trying to perform 1 if
ref|XP_473071.1|-->OSJNBa0014K14.2 [Oryza sativa (japonica cultivar-group)] emb|CAE02929.3| OSJNBa0014K14.1 [Oryza sativa (japonica cultivar-group)]
dbj|BAD87001.1|-->hypothetical protein [Oryza sativa (japonica cultivar-group)] dbj|BAD86933.1| hypothetical protein [Oryza sativa (japonica cultivar-group)]
Seq: 51 WRWRWRWW 58
Seq: 49 WRWRWRW 55
increased variables
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl
use strict;
use warnings;
use Tie::File;
my $file = 'BlastOutput.txt';
my %hash;
my $i = 1;
tie my @array,'Tie::File',$file or die $!;
chomp @array;
while($i < scalar(@array)-1){
push(@{$hash{$array[$i]}},$array[$i+1]);
$i += 2;
}
untie @array;
open(my $fh,$file) or die $!;
for my $key(keys(%hash)){
print $fh $key,"\n",join("\n",@{$hash{$key}}),"\n";
}
close $fh;
open(my $fh, "> $file") or die $!;
|< 1 2 >| | 13 Einträge, 2 Seiten |