JohnFKarlson
IS-IT--Management
The problem is that i have a file i get from
a database, that contain the names i need more info about
and then i need to extract the data that contain the info from anotter file..
Well and as the n00bi i am, i cant get the code to work,..
So there fore i ask you pepole about some help,...
##################################################
part of file 1: (the names i need more info about)
##################################################
252831_at
253333_at
261933_at
247138_at
258908_at
263897_at
252900_at
258281_at
266608_at
248819_at
260818_at
246627_s_at
245832_at
257746_at
250407_at
267035_at
263714_at
262825_at
259254_at
266257_at
252652_at
249910_at
261758_at
263845_at
251984_at
245690_at
259149_at
267470_at
256186_at
258047_at
261907_at
258037_at
259568_at
250207_at
251827_at
252123_at
#######################################
end of part of file 1: (the names i need more info about)
#######################################
#######################################
exampel the file2: (data i need to extract)
#######################################
244901_at AtMg00640 -1,1 D -0,3 NC 15,1 P 61,1 P 16,9 P 28,7 P hypothetical protein
244902_at AtMg00650 -0,7 D -0,3 NC 13,9 P 65,8 P 11,1 P 37,3 P NADH dehydrogenase subunit 4L
244903_at AtMg00660 -0,5 NC -0,6 NC 20,2 P 39 P 14 P 23,7 P hypothetical protein
244904_at ATMG00670 0,4 NC -1,5 NC 3,6 A 6,2 A 1,4 A 8,5 A hypothetical protein
244905_at AtMg00680 3,3 NC 0,3 NC 8 A 0,9 A 12,3 A 11,4 A hypothetical protein
244906_at AtMg00690 -1,6 D -0,7 NC 39,3 A 92 P 24,6 A 31,4 P hypothetical protein
244907_at AtMg00710 -0,6 NC -1 NC 5,9 A 0,6 A 2,6 A 0,5 A hypothetical protein
244908_at AtMg00720 -0,9 NC -0,9 NC 1 A 2,4 A 0,3 A 0,6 A hypothetical protein
244909_at ATMG00740 -0,5 NC -0,2 NC 10,9 A 13,6 A 11,8 A 8,8 A hypothetical protein
244910_s_at ATMG00750 -0,3 NC -0,5 NC 10,2 P 9,2 A 8 P 6 A hypothetical protein
244911_at ATMG00820 -2,1 NC -2,1 NC 7,4 P 4,6 A 1,6 A 1 A hypothetical protein
#######################################
end of exampel of the file2: (data i need to extract)
#######################################
Okey so below i have try to write a code to extract parts of the info, but with out anny luck,...
#######################################
#!/usr/bin/perl -w
$targets1 = 'target_genes_at.txt'; #the data i need more info about
open(TAG,$targets1);
@targets1 = <TAG>;
close TAG;
$cal1 = 'solfanelli_data.txt'; #were the info is stored
open(CAL,$cal1);
@cal1 = <CAL>;
close CAL;
$i=1;
$ts= @targets1;
print "there is $ts array valuges in this file";
print "\n";
while ($i<($ts-1))
{
$i=$i+1;
$hell = @targets1[$i];
print $hell; #well it print out my targets,
for my $line (@cal1) {
if($line =~ /^$hell/) { #But it dont do it here
$line =~ /^$hell/;
$loc = $line;
}elsif($line =~ /^255056_at/) {
$line =~ /^255056_at/;
$def = $line;
}elsif($line =~ /\s/) {
$line =~ s/\s*//;
$NoMORE = $line;
}
}
print "*** The found target from the Import of the Target list @hell ***\n";
print "The hitt from the target list shud be here!: $loc Why not?";
}
;
exit;
a database, that contain the names i need more info about
and then i need to extract the data that contain the info from anotter file..
Well and as the n00bi i am, i cant get the code to work,..
So there fore i ask you pepole about some help,...
##################################################
part of file 1: (the names i need more info about)
##################################################
252831_at
253333_at
261933_at
247138_at
258908_at
263897_at
252900_at
258281_at
266608_at
248819_at
260818_at
246627_s_at
245832_at
257746_at
250407_at
267035_at
263714_at
262825_at
259254_at
266257_at
252652_at
249910_at
261758_at
263845_at
251984_at
245690_at
259149_at
267470_at
256186_at
258047_at
261907_at
258037_at
259568_at
250207_at
251827_at
252123_at
#######################################
end of part of file 1: (the names i need more info about)
#######################################
#######################################
exampel the file2: (data i need to extract)
#######################################
244901_at AtMg00640 -1,1 D -0,3 NC 15,1 P 61,1 P 16,9 P 28,7 P hypothetical protein
244902_at AtMg00650 -0,7 D -0,3 NC 13,9 P 65,8 P 11,1 P 37,3 P NADH dehydrogenase subunit 4L
244903_at AtMg00660 -0,5 NC -0,6 NC 20,2 P 39 P 14 P 23,7 P hypothetical protein
244904_at ATMG00670 0,4 NC -1,5 NC 3,6 A 6,2 A 1,4 A 8,5 A hypothetical protein
244905_at AtMg00680 3,3 NC 0,3 NC 8 A 0,9 A 12,3 A 11,4 A hypothetical protein
244906_at AtMg00690 -1,6 D -0,7 NC 39,3 A 92 P 24,6 A 31,4 P hypothetical protein
244907_at AtMg00710 -0,6 NC -1 NC 5,9 A 0,6 A 2,6 A 0,5 A hypothetical protein
244908_at AtMg00720 -0,9 NC -0,9 NC 1 A 2,4 A 0,3 A 0,6 A hypothetical protein
244909_at ATMG00740 -0,5 NC -0,2 NC 10,9 A 13,6 A 11,8 A 8,8 A hypothetical protein
244910_s_at ATMG00750 -0,3 NC -0,5 NC 10,2 P 9,2 A 8 P 6 A hypothetical protein
244911_at ATMG00820 -2,1 NC -2,1 NC 7,4 P 4,6 A 1,6 A 1 A hypothetical protein
#######################################
end of exampel of the file2: (data i need to extract)
#######################################
Okey so below i have try to write a code to extract parts of the info, but with out anny luck,...
#######################################
#!/usr/bin/perl -w
$targets1 = 'target_genes_at.txt'; #the data i need more info about
open(TAG,$targets1);
@targets1 = <TAG>;
close TAG;
$cal1 = 'solfanelli_data.txt'; #were the info is stored
open(CAL,$cal1);
@cal1 = <CAL>;
close CAL;
$i=1;
$ts= @targets1;
print "there is $ts array valuges in this file";
print "\n";
while ($i<($ts-1))
{
$i=$i+1;
$hell = @targets1[$i];
print $hell; #well it print out my targets,
for my $line (@cal1) {
if($line =~ /^$hell/) { #But it dont do it here
$line =~ /^$hell/;
$loc = $line;
}elsif($line =~ /^255056_at/) {
$line =~ /^255056_at/;
$def = $line;
}elsif($line =~ /\s/) {
$line =~ s/\s*//;
$NoMORE = $line;
}
}
print "*** The found target from the Import of the Target list @hell ***\n";
print "The hitt from the target list shud be here!: $loc Why not?";
}
;
exit;