thanks..
but it doesn't work though.. i'm guessing there are some problems at these lines?
open (LIST1, "tab_delimited.txt");
while (<LIST1>) {
($id, $product, $ec) = split(/\t/, $_);
$hash{$id} = [$product, $ec];
}
close(LIST1);
open (LIST2, "tab.txt");
while(<LIST2>) {...
Hi, I am encountering some problem with looping here. How do get this line "if ($line =~ m ($gene)) {" to match all $gene in the hash?
open (LIST1, "tab_delimited.txt");
while (<LIST1>) {
($id, $product, $ec) = split(/\t/, $_);
$hash{$id} = ($product, $ec);
}...
hi,
i need to change this output
821 940 0.31 - 0 id "g1";
989 1205 0.53 - 1 id "g1";
2141 2621 0.37 - 2 id "g1";
2681 2847 0.89 - 1 id "g1";
2921 2925 0.71 - 0 id "g1";
5897 6076 0.55 + 0 id "g2";
6129 6202 0.58 + 0 id "g2";
6265 6381 0.57 + 1 id "g2";
into something like this. i.e. i need...
ok, thanks.
I was actually trying to do it the oppposite way
perl -pae 's/^$p +/, /;$p=$F[0]' infile.txt | sed "s/\n,/,/g" >outputfile.txt
doesnt work though.
btw, what is $F[0]' and -pae ?
thanks.
my infile would be somethiing like this
3834_t: g3498.t1
3834_t: ghmm.1
3835_t: g3499.t1
3835_t: g3500.t1
3835_t: ghmm.2
3835_t: ghmm.3
3836_t: g3500.t1
3836_t: ghmm.3
3836_t: ghmm.4
your one-liner works fine, just that i will need each key on a new line.
Hi, i'm trying to write a script to read this
YAL044W-A 0000004
YAL044W-A 0005554
YAL044W-A 0008372
and convert into this
YAL044W-A 0000004, 0005554, 0008372
unfortunately, this is as far as i get
open FH, "<infile.txt" or die $!;
open OF, ">outputfile.txt";
while (<FH>) {...
yes, i made some changes at
my $max = 10;
and
my $first_num = int(rand(10))+1;
my $second_num = int(rand(10))+1;
so that I can make sure that both conditions are met at a smaller number sets
i get this results
7-7 <--
10-6
1-3
8-6
2-7
2-3
7-9
3-9
2-6
10-1
repeat again...
thanks, not exactly what i want, but i get the idea
it is more like this
foreach $one (@uniqpair)
{
if ($i==${$one}[0] && $j==${$one}[1] || $j==${$one}[0] && $i==${$one}[1] )
{
$ok=0;
last;
}
}
Kevin, somehow your codes do not seems to satisfy either conditions at...
Hi!
i need to generate a pair of random numbers between 0 to 100
e.g. 0 - 2, 5 - 54, 98 - 100
there is two conditions, (1) the same number is not used as a pair e.g. 1-1, 2-2
(2) the same pair of number is not repeated and that would include 1-2, 2-1
the first condition is pretty easy, just...
Hi everyone.
I have a perl program that is invoked by the command
match.pl A B
the problem is that there is a few hundred combination of A and B that is possible
so, i am thinking of writing a new program with a small loop that generate the command to invoke the match.pl
so, how do I do...
this one works perfectly after correcting for the variable $dirPath..
so the reason, the first attempts fail is because I did not specify the path to my directory?
thanks a lot everybody
thanks for the advice.. i definitely had a lot of catching up to do.
the error read
cant open NC_004353.faa: No such file or directory at append3 line9.
this is line 9
open(SRC,$_) or die "cant open $_: $!";
i add the statement print "***@filesToRead***\n";
and get every files that i want...
thanks, i got up to here so far.. but it stl doesnt seems to work. btw i am actually a biologist, so i actually dont do a lot of programming
$dirPath = "c:/d_melanogaster/";
opendir DIR,"$dirPath" or die "Error Message:$!\n";
@filesToRead = (grep/N/i,readdir DIR);
closedir DIR;
if...
How do i change this
YAL044W-A 0000004, 0005554, 0008372
to this?
YAL044W-A 0000004
YAL044W-A 0005554
YAL044W-A 0008372
it doesnt have to be programmatic if there is a way doing it using 'replace with' function in any text editor
Thanks a lot
this is so embarassing, but i think that solve my problem
<quote>
Again, that is not a file name should be at least a name and extension ie. myfile.txt
</quote>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.