Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: noyk
  • Order by date
  1. noyk

    loop in hash

    thanks, i get it now
  2. noyk

    loop in hash

    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>) {...
  3. noyk

    loop in hash

    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); }...
  4. noyk

    convert format

    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...
  5. noyk

    convert text

    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 ?
  6. noyk

    convert text

    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.
  7. noyk

    convert text

    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>) {...
  8. noyk

    random pair generator

    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...
  9. noyk

    random pair generator

    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...
  10. noyk

    random pair generator

    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...
  11. noyk

    invoking perl from perl

    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...
  12. noyk

    append multiple file

    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
  13. noyk

    append multiple file

    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...
  14. noyk

    append multiple file

    a similar error occur in Kevin's and prex's code i still cannot open the files open(SRC,$_) or die "cant open $_: $!";
  15. noyk

    append multiple file

    thanks but the script cannot open the second file
  16. noyk

    append multiple file

    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...
  17. noyk

    append multiple file

    i need a quick script to open multiple files in a directory and copy all the content to a new file. thanks in advance
  18. noyk

    edit text file

    can you explain these lines <code> while (<FH>) { ($key, @values)=split /\s+/, $_; foreach (@values) { print OF, "$key\t$_"; } </code>
  19. noyk

    edit text file

    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
  20. noyk

    open(DAT, &quot;&lt;$annotation_scheme_filepath&quot;)

    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>

Part and Inventory Search

Back
Top