AWallBuilder has asked for the wisdom of the Perl Monks concerning the following question:
Dear all, I am getting a new error regarding the PRINT function. I have never had this error and have gotten no clue from a bit of googling. Any help is appreciated.
Can't locate object method "PRINT" via package "IO::File" at addFeatInfo2clusterinfo.pl line 63.
use strict; use warnings; use Data::Dumper; my $in_clustInfo=$ARGV[0] || "output.clusterinfo"; open (IN,"<" ,$in_clustInfo); my %HoMS2lines; while (my $line=<IN>){ chomp $line; my @cols=split(/\t/,$line); my $clust_indx=$cols[0]; my $mz=$cols[2]; my $rt=$cols[15]; $HoMS2lines{$clust_indx}{mz}=$mz; $HoMS2lines{$clust_indx}{rt}=$rt; $HoMS2lines{$clust_indx}{line}=$line; } #print Dumper(%HoMS2lines); close(IN); ## my $in_featsInfo=$ARGV[1]; open (IN,"<" ,$in_featsInfo); my %HoMS1feats; while (my $line=<IN>){ chomp $line; my @cols=split(/\t/,$line); my $mz=$cols[5]; my $rt=$cols[6]; my $feat=$cols[4]; my $metab=$cols[10]; $HoMS1feats{$feat}{mz}=$mz; $HoMS1feats{$feat}{rt}=$rt; $HoMS1feats{$feat}{metab}=$metab; $HoMS1feats{$feat}{line}=$line; } close(IN); #print Dumper(%HoMS1feats); ## my $out="$in_clustInfo.featsadded.txt"; open (OUT,">",$out); ## my $mz_ppmWin=10; my $rt_win=10; foreach my $clust (keys %HoMS2lines){ my $mz=$HoMS2lines{$clust}{'mz'}; my $mz_win=($mz*$mz_ppmWin)/1000000; my $rt=$HoMS2lines{$clust}{'rt'}; foreach my $feat (keys %HoMS1feats){ my $ftmz=$HoMS1feats{$feat}{'mz'}; my $ftrt=$HoMS1feats{$feat}{'rt'}; my $ftmetab=$HoMS1feats{$feat}{'metab'}; if (($ftmz < $mz+$mz_win && $ftmz > $mz-$mz_win) && ($ +ftrt < $rt+$rt_win && $ftrt > $mz-$rt_win)){ PRINT OUT join("\t",$HoMS2lines{$clust}{'line' +},$feat,$ftmz,$ftrt,$ftmetab)."\n"; } else{ PRINT OUT join("\t",$HoMS2lines{$clust}{'line' +},"no matchin feat","NA","NA","NA")."\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't locate print error
by choroba (Cardinal) on Dec 03, 2015 at 10:18 UTC | |
by Athanasius (Archbishop) on Dec 03, 2015 at 10:27 UTC | |
by choroba (Cardinal) on Dec 03, 2015 at 10:30 UTC | |
by Athanasius (Archbishop) on Dec 03, 2015 at 12:04 UTC | |
by choroba (Cardinal) on Dec 03, 2015 at 12:13 UTC | |
|
Re: Can't locate print error
by marto (Cardinal) on Dec 03, 2015 at 10:19 UTC | |
by AWallBuilder (Beadle) on Dec 03, 2015 at 10:27 UTC |