################################################ # 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 HUGO name and gene name. #Column 3 of file [2] is gene name col 4 [3] is the pathway gene is associated with open (DUMMY_GENEFILE, 'DummyGenes.txt') or die "cannot open file containing 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 HUGO 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 of the columns [5]-[8] in the HUGO ID file. #check col 6, if found print, if not found, check next column. If never found, print "not found". foreach () #Changed from () { #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 HUGO ID\n"; } } close (DUMMYHUGO); close (DUMMY_GENEFILE); close (OUT); exit;