Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Getting (famous) error during running perl script

by Random_Walk (Prior)
on Jul 04, 2015 at 10:56 UTC ( [id://1133143]=note: print w/replies, xml ) Need Help??


in reply to Getting (famous) error during running perl script

may we see the code please? This error tells us a variable has no value assigned to it. A wild guess, when you are printing it in some output. Without the code, it's not possible to help much though

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Replies are listed 'Best First'.
Re^2: Getting (famous) error during running perl script
by Kati (Initiate) on Jul 04, 2015 at 20:09 UTC

    Of course, I updated my question with the code. This code is for replacing sequences of interest from one fasta file to another. Another thing that may be useful to know is that I can see sequence of interest before running the script, but after the running the script, the output file just showed the header of sequence not sequence itself, as if there isn't such a sequence at all. Please let me know if you need further information.Thanks for your help

    .
      Are you sure that $hash1{$list{$1} } is defined?

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        Hi, sorry, I'm not sure, honestly I'm so new here and I don't know what you mean! However, it sounds that script is correct because it works fine on short fasta file, say 5 sequences, but when I tried to run it on my original fasta file composed of about 150, 000 sequences, the error appeared

        .

      In Re: Getting (famous) error during running perl script, BillKSmith suggests blank lines in your input file -- and there's a decent chance that's it.

      However, dissecting the line with the issue into digestible form:

      if (/>(.*)/) { if (defined $list{$1}) { print $_. "\n" . $hash1{$list{$1}} . "\n"; $x = 1 } else { $x = 0 } } #e print $_ . "\n" if $x == 0; #e

      I can't help but wonder: You check to see if $list{$1}is defined, but make no attempt to ascertain if $hash1{$list{$1}}is defined -- but that's what you're using there.

      Could it be that you need to change that line to:

      if (defined $hash1{$list{$1}})

      If it might help you a bit?

        thanks friend, I'm basically a biologist and really new in this field.Could you please let me know what should exactly I do, please tell me in simple language, if I add the code, which you wrote, to the script? Thanks for your kindness

        .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1133143]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found