Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
________________################################################ # Declare an outfile to print to my $outfile = "HUGO_dummyResults.txt"; # Open the outfile using a file handle open( OUT, "> $outfile" ) or die "cannot create the output file"; ################################################# # Open file of list of neurotransmission genes where ENST has not been + found # FILENOTES::: File created in access using a query against approved H +UGO name and gene name. #Column 3 of file [2] is gene name col 4 [3] is the pathway gene is as +sociated with open (DUMMY_GENEFILE, 'DummyGenes.txt') or die "cannot open file conta +ining genes"; ################################################# # 2- Open HUGO tabbed file # FILENOTES:::: Approved gene name is in col 2 [1] open (DUMMYHUGO,'DummyHugo.txt') or die "cannot open file containing H +UGO IDs"; ################################################# #Operations ################################################# #make array genes #@genes = DUMMY_GENEFILE; #No longer done here, see below #make array HUGO @hugo = DUMMYHUGO; #for each line in genefile, try to match gene name [2] to one column o +f the columns [5]-[8] in the HUGO ID file. #check col 6, if found print, if not found, check next column. If neve +r found, print "not found". foreach (<DUMMY_GENEFILE>) #Changed from (<DUMMY_GENEFILE>) { #make array genes @genes = DUMMY_GENEFILE; for ($i = 4; $i < @hugo; $i++) { if ($genes[2] eq $hugo[$i]) #If found first print result { print OUT "$genes[0]\t$genes[1]\t$genes[2]\tgenes[ +3]\t$hugo[1]\n"; } # HUGO ID not found, print print OUT "$genes[0]\t$genes[1]\t$genes[2]\tgenes[3]\tNo H +UGO ID\n"; } } close (DUMMYHUGO); close (DUMMY_GENEFILE); close (OUT); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Failing) script to return an official ID
by toolic (Bishop) on Apr 11, 2008 at 13:08 UTC | |
by Anonymous Monk on Apr 11, 2008 at 14:03 UTC | |
by Anonymous Monk on Apr 12, 2008 at 16:27 UTC | |
by toolic (Bishop) on Apr 12, 2008 at 20:01 UTC | |
by Anonymous Monk on Apr 13, 2008 at 18:07 UTC | |
|
Re: (Failing) script to return an official ID
by apl (Monsignor) on Apr 11, 2008 at 13:13 UTC | |
|
Re: (Failing) script to return an official ID
by starbolin (Hermit) on Apr 11, 2008 at 16:35 UTC | |
by Anonymous Monk on Apr 12, 2008 at 14:38 UTC |