Thread empty Files (9 answers)
Opened by paidopoieo at 2005-12-07 03:12

paidopoieo
 2005-12-08 19:36
#60743 #60743
User since
2005-12-02
96 Artikel
BenutzerIn
[default_avatar]
Hallo renee,
ok, sorry, hier nocheinmal der "hoffentlich den Richtlinien angepasste Code" ;) mit Beispieldaten:

Out.txt
Code: (dl )
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


Code:

Code: (dl )
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";


Dankeschoen,
mfg
Hubert

View full thread empty Files