Help me please...!!!........
-
Dear all, I am off because my program is not working. I tried to combine the three arrays of gene expression to get single array. Then I tried to get a subset of array from the single combined array. So I wrote the following code: But the problem is this: Use of uninitialized value $val in scalar chomp at C:\manoj_bioinform\expression.pl line 33, <DIAMIDE> line 8808. Please help me what's wrong with my program..........!!! :( #!/usr/bin/perl -w #Open the three .txt file to the FILEHANDLE #and create the arrays for all the three file open (HYPEROSMOTIC, "hyperosmotic.txt")|| die "can't open the hyperosmotic file: $!\n"; @hyperosmotic = <HYPEROSMOTIC>; open (HEATSHOCK, "heatshock.txt")|| die "can't open the file heatshock: $!\n"; @heatshock = <HEATSHOCK>; open (DIAMIDE, "diamide.txt")|| die "can't open the file diamide: $!\n"; @diamide = <DIAMIDE>; #store all the expression data on the three array #into single @excomb array @excomb = (@hyperosmotic,@heatshock,@diamide); #print @excomb; #loop to split each line from the @expdata into a new tiny array #the columns of data in the original file are #separated by tabs as denoted by the /\t/ #then save only the info from column 0 and 2 as separate variable #also "chomp" each variable to remove unseen characters foreach $excomb(@excomb) { @tarray=split(/\t/, @excomb); $genename=$tarray[0]; $val=$tarray[1]; chomp $genename; chomp $val; } print @tarray;
-
Dear all, I am off because my program is not working. I tried to combine the three arrays of gene expression to get single array. Then I tried to get a subset of array from the single combined array. So I wrote the following code: But the problem is this: Use of uninitialized value $val in scalar chomp at C:\manoj_bioinform\expression.pl line 33, <DIAMIDE> line 8808. Please help me what's wrong with my program..........!!! :( #!/usr/bin/perl -w #Open the three .txt file to the FILEHANDLE #and create the arrays for all the three file open (HYPEROSMOTIC, "hyperosmotic.txt")|| die "can't open the hyperosmotic file: $!\n"; @hyperosmotic = <HYPEROSMOTIC>; open (HEATSHOCK, "heatshock.txt")|| die "can't open the file heatshock: $!\n"; @heatshock = <HEATSHOCK>; open (DIAMIDE, "diamide.txt")|| die "can't open the file diamide: $!\n"; @diamide = <DIAMIDE>; #store all the expression data on the three array #into single @excomb array @excomb = (@hyperosmotic,@heatshock,@diamide); #print @excomb; #loop to split each line from the @expdata into a new tiny array #the columns of data in the original file are #separated by tabs as denoted by the /\t/ #then save only the info from column 0 and 2 as separate variable #also "chomp" each variable to remove unseen characters foreach $excomb(@excomb) { @tarray=split(/\t/, @excomb); $genename=$tarray[0]; $val=$tarray[1]; chomp $genename; chomp $val; } print @tarray;
Old school so I don't know specifically what the following expression does foreach $excomb(@excomb) But I certainly can guess. It iterates through the array putting a value into $excomb And it would certainly seem reasonable to me that you would want to actually use $excomb somewhere. Say in the following statement. But you don't. @tarray=split(/\t/, @excomb); (Even if the specifics are wrong I am almost certain that using the array there is not what you want.)