Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi again, I'm back.. much further in my program - but stuck again - 8 hours of solid playing around and still nothing.

my ($left_of_boundary, $intron_from_boundary, $new_left, $seq, $col7, +$col_alt, $matchID); my $i = 0; open (INTRONS_five, '>fasta_introns_five_non'); open (INTRONS_three, '>fasta_introns_three_non'); foreach $col7(@col7) { ##50bp seq in var file $seq = ''; $col7[$i] =~ s/\[[ACTG]\]/$col_ref[$i]/i; if ($intron_from_boundary[$i] =~ m/\-/) { &three_prime; } elsif ($intron_from_boundary[$i] =~ m/\+/) { &five_prime; } my $length = length($seq); if ($length == 9) { print INTRONS_five (">" . "$match{$col_NM[$i]}" . "\n", lc +($seq),"\n"); } elsif ($length != '') { print INTRONS_three (">" . "$col_NM[$i]" . "\n", lc($seq), +"\n"); } ++$i; } close (INTRONS_five); close (INTRONS_three); sub three_prime { if ($strands{$ID[$i]} =~ m/\+/) { ## !!!PROBLEM!!! - $seq prints to file INTRONS_three when $strands{$ID[$i]} = + or - ### ### BUT if I print out $ID[$i] here, it only pulls out + (shows the hash is working) ### $left_of_boundary = 20; ##$right_of_boundary = 3; $left_of_boundary = $left_of_boundary + $intron_from_bound +ary[$i]; $new_left = 51 - $left_of_boundary; $seq = substr( $col7[$i], $new_left, 23); } elsif ($strands{$ID[$i]} =~ m/\-/) { if ($intron_from_boundary[$i] >= -6) { $left_of_boundary = 3; #$right_of_boundary = 6; $left_of_boundary = $left_of_boundary - $intron_from_bound +ary[$i]; $new_left = 51 - $left_of_boundary; $seq = substr( $col7[$i], $new_left, 9); $matchID = $ID[$i] . "\t" . $intron_from_boundary[$i] +. "\t" . "on the negative strand"; } } }

I know this is a lot of code (and not all of it), but I have commented out "problem" where the issue lies. My %strands works, but when I open the INTRONS_three file it is printing out sequences for both when $ID[$i] is + or -. I thought maybe it was to do with when I am calling my variables i.e. my $seq? I've tried using/not using a subroutine, data::dumping, hitting the keyboard, prayer.. but still to no avail...

In reply to error calling variables? Going insane... by lecb

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [erix]: not the best way to make friends, though (I suppose)
    LanX Fun with Flags anyone?

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (8)
    As of 2018-03-22 18:53 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (283 votes). Check out past polls.