10 Einträge, 1 Seite |
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
#!/usr/bin/perl -w
my @raw_data;
my $wrestler;
my @work_array;
print "Starting Program......Hopefully.....\n";
open (bigShot, "BigOne.txt") || die ("Could not open file. $!");
print "File bigShot openend successfully \n";
@raw_data = <bigShot>;
print "stored entire file in Array \n";
close (bigShot);
print "closed file bigShot \n";
print "trying to enter foreach....\n";
foreach $wrestler (@raw_data) {
print "entered foreach successfully \n";
print $wrestler, "\n";
#@work_array = $wrestler;
print "trying to enter if Condition....\n";
if ($wrestler =~ m/^>sp/ || $wrestler =~ m/^Query/ || $wrestler =~ m/^Sbjct/) {
print "if condition entered successfully\n";
open (cuttedFile, ">cuttedFile.txt") || die ("Could not open file. $!");
print "File cuttedFile opend successfully \n";
print $wrestler;
close (cuttedFile);
}
}
print "finished foreach \n";
1
2
3
4
5
6
7
open (cuttedFile, ">cuttedFile.txt") || die ("Could not open file. $!");
foreach $wrestler(@array){
print "File cuttedFile opend successfully \n";
print cuttedFile $wrestler;
}
close (cuttedFile);
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
#!/usr/bin/perl -w
my @raw_data;
my $wrestler;
my @work_array;
my $wrestlerPrevious = '';
print "Starting Program......Hopefully.....\n";
open (sortedFile, "Out.txt") || die ("Could not open file. $!");
print "File sortedFile openend successfully \n";
@raw_data = <sortedFile>;
print "stored entire file in Array \n";
close (sortedFile);
print "closed file sortedFile \n";
print "\n";
print "trying to enter foreach....\n";
print "\n";
#======================================================================================
foreach $wrestler (@raw_data) {
print "entered foreach successfully \n";
#print $wrestler, "\n";
#@work_array = $wrestler;
#print "trying to enter if Condition....\n";
if ($wrestler !~ m/$wrestlerPrevious/) {
print "if condition entered successfully\n";
open (cleaned_Blasthits_wo_AlignmentsFile, ">>cleaned_Blasthits_wo_AlignmentsFile.txt") || die ("Could not open file. $!");
print "File cleaned_Blasthits_wo_AlignmentsFile opend successfully \n";
print cleaned_Blasthits_wo_AlignmentsFile $wrestler;
close (cleaned_Blasthits_wo_AlignmentsFile);
} else {
print "THAT WAS A DOUBLED ONE....SORRY \n";
}
$wrestlerPrevious = $wrestler;
}
print "finished foreach \n";
1
2
3
4
5
6
7
8
if($bedingung){
#zwei leerzeichen
my $return = machwas();
if($return){
#noch zwei Leerzeichen mehr
machwasanderes();
}
}
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
>sp|O00398|P2Y10_HUMAN Putative P2Y purinoceptor 10 (P2Y10) (P2Y-like receptor)
>sp|O00507|USP9Y_HUMAN Probable ubiquitin carboxyl-terminal hydrolase FAF-Y (Ubiquitin
>sp|O00507|USP9Y_HUMAN Probable ubiquitin carboxyl-terminal hydrolase FAF-Y (Ubiquitin
>sp|O08967|CYH3_MOUSE Cytohesin-3 (ARF nucleotide-binding site opener 3) (ARNO3 protein)
>sp|O15321|TM9S1_HUMAN Transmembrane 9 superfamily protein member 1 precursor (hMP70)
>sp|O28970|TF2B_ARCFU Transcription initiation factor IIB (TFIIB)
>sp|O35902|DSG3_MOUSE Desmoglein-3 precursor (130 kDa pemphigus vulgaris antigen homolog)
>sp|O55112|AFF2_MOUSE AF4/FMR2 family member 2 (Fragile X mental retardation protein
>sp|O59248|RNP4_PYRHO Ribonuclease P protein component 4 (RNase P component 4)
>sp|O59248|RNP4_PYRHO Ribonuclease P protein component 4 (RNase P component 4)
>sp|O59425|RNP1_PYRHO Ribonuclease P protein component 1 (RNase P component 1)
>sp|O59425|RNP1_PYRHO Ribonuclease P protein component 1 (RNase P component 1)
>sp|O60563|CCNT1_HUMAN Cyclin-T1 (Cyclin-T) (CycT1)
>sp|O65388|PEL2_ARATH Putative pectate lyase 2 precursor
>sp|O70582|LX12B_MOUSE Arachidonate 12-lipoxygenase, 12R type (Epidermis-type lipoxygenase
>sp|O70582|LX12B_MOUSE Arachidonate 12-lipoxygenase, 12R type (Epidermis-type lipoxygenase
>sp|O70582|LX12B_MOUSE Arachidonate 12-lipoxygenase, 12R type (Epidermis-type lipoxygenase
>sp|O73700|CAC1D_CHICK Voltage-dependent L-type calcium channel alpha-1D subunit (Voltage-gated
>sp|O73700|CAC1D_CHICK Voltage-dependent L-type calcium channel alpha-1D subunit (Voltage-gated
>sp|O75923|DYSF_HUMAN Dysferlin (Dystrophy associated fer-1-like protein) (Fer-1-like
>sp|O84630|END4_CHLTR Probable endonuclease IV (Endodeoxyribonuclease IV)
>sp|O91734|POLG_EC01F Genome polyprotein [Contains: Coat protein VP4 (P1A); Coat protein
>sp|O91734|POLG_EC01F Genome polyprotein [Contains: Coat protein VP4 (P1A); Coat protein
>sp|O94761|RECQ4_HUMAN ATP-dependent DNA helicase Q4 (RecQ protein-like 4) (RecQ4) (RTS)
>sp|O94880|PHF14_HUMAN PHD finger protein 14
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
#!/usr/bin/perl -w
use strict;
my @raw_data;
my $wrestler;
my @work_array;
my $wrestlerPrevious = '';
print "Starting Program......Hopefully.....\n";
open (SORTEDFILE, "Out.txt") || die ("Could not open file. $!");
print "File sortedFile openend successfully \n";
@raw_data = <SORTEDFILE>;
print "stored entire file in Array \n";
close (SORTEDFILE);
print "closed file sortedFile \n";
print "\n";
print "trying to enter foreach....\n";
print "\n";
#======================================================================================
foreach $wrestler (@raw_data) {
print "entered foreach successfully \n";
if ($wrestler !~ m/$wrestlerPrevious/) {
print "if condition entered successfully\n";
open (CLEANED_BLASTHITS_WO_ALIGNMENTSFILE, ">>cleaned_Blasthits_wo_AlignmentsFile.txt") || die ("Could not open file. $!");
print "File cleaned_Blasthits_wo_AlignmentsFile opend successfully \n";
print CLEANED_BLASTHITS_WO_ALIGNMENTSFILE $wrestler;
close (CLEANED_BLASTHITS_WO_ALIGNMENTSFILE);
} else {
print "THAT WAS A DOUBLED ONE....SORRY \n";
}
$wrestlerPrevious = $wrestler;
}
print "finished foreach \n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
use strict;
use warnings;
my $infile = '/path/to/infile.fa';
my $outfile = '/out/outfile.txt';
my %single_hash;
open(INFILE,"<$infile") or die $!;
while(my $line = <INFILE>){
chomp $line;
$single_hash{$line} = 1;
}
close INFILE;
open(OUTFILE,">$outfile") or die $!;
for my $key(keys(%single_hash)){
print OUTFILE $key,"\n";
}
close OUTFILE;
10 Einträge, 1 Seite |