Hi monks

Can anyone please explain to me the following error message

bash-2.05$ perl extract_seqs.pl main::check_gene() called too early to check prototype at extract_seqs +.pl line 22. main::check_gene_seq() called too early to check prototype at extract_ +seqs.pl line 27. main::extractseq() called too early to check prototype at extract_seqs +.pl line 32. syntax error at extract_seqs.pl line 106, near "$endpos) " Execution of extract_seqs.pl aborted due to compilation errors. bash-2.05$
With use of the code:
while (<INPUT>){ if ($_ =~ /\s{3}\<gene\sid\s\=\s\"(\d{1,6})\"\slabel\s\=\s\"([.|\. +]{1,40})\"\>/){ check_gene ($_); } if ($_ =~ /\s{4}\<gene_seq\sid\s\=\s\"(\d{0,6})\"\sstatus\s{0,2}\= +\s{0,2}\"(.{0,50})\"\s{0,2}CDS_number\s{0,2}\=\s{0,2}\"(\d{1,3})\"\s{ +0,2}number_of_CDSs\s{0,2}\=\s{0,2}\"(\d{0,5})\"\s{0,2}sequence_source +\s{0,2}\=\s{0,2}\"(.{0,300})\"\s{0,2}startpos\s{0,2}\=\s{0,2}\"(\d{0, +9})\"\s{0,2}endpos\s{0,2}\=\s{0,2}\"(\d{0,9})\"\s{0,2}startopen\s{0,2 +}\=\s{0,2}\"(\d{0,1})\"\sendopen\s{0,2}\=\s{0,2}\"(\d{0,1})\"\s{0,2}c +omplement\s{0,2}\=\s{0,2}\"(.{0,1})\"\>/){ check_gene_seq ($_); $label = "$gene_seq_id.$gene_seq_status.$gene_seq_CDS_number.$gene_se +q_number_of_CDSs.$gene_seq_sequence_source.$gene_seq_startpos.$gene_s +eq_endpos.$gene_seq_startopen.$gene_seq_endopen.$gene_seq_complement" +; } extractseq ($label,$gene_seq_sequence_source,$gene_seq_startpos,$g +ene_seq_endpos); }
In the context of
#!/usr/bin/perl -w ######### ### Programed 15_12_02_by Matthew Redden ######### #use strict; mkdir Output; $input = "new_out_again_12_12_02_B_hand_edit_15_12_02.txt"; open (INPUT, "<$input"); while (<INPUT>){ if ($_ =~ /\s{3}\<gene\sid\s\=\s\"(\d{1,6})\"\slabel\s\=\s\"([.|\. +]{1,40})\"\>/){ check_gene ($_); } if ($_ =~ /\s{4}\<gene_seq\sid\s\=\s\"(\d{0,6})\"\sstatus\s{0,2}\= +\s{0,2}\"(.{0,50})\"\s{0,2}CDS_number\s{0,2}\=\s{0,2}\"(\d{1,3})\"\s{ +0,2}number_of_CDSs\s{0,2}\=\s{0,2}\"(\d{0,5})\"\s{0,2}sequence_source +\s{0,2}\=\s{0,2}\"(.{0,300})\"\s{0,2}startpos\s{0,2}\=\s{0,2}\"(\d{0, +9})\"\s{0,2}endpos\s{0,2}\=\s{0,2}\"(\d{0,9})\"\s{0,2}startopen\s{0,2 +}\=\s{0,2}\"(\d{0,1})\"\sendopen\s{0,2}\=\s{0,2}\"(\d{0,1})\"\s{0,2}c +omplement\s{0,2}\=\s{0,2}\"(.{0,1})\"\>/){ check_gene_seq ($_); $label = "$gene_seq_id.$gene_seq_status.$gene_seq_CDS_number.$gene_se +q_number_of_CDSs.$gene_seq_sequence_source.$gene_seq_startpos.$gene_s +eq_endpos.$gene_seq_startopen.$gene_seq_endopen.$gene_seq_complement" +; } extractseq ($label,$gene_seq_sequence_source,$gene_seq_startpos,$g +ene_seq_endpos); } sub check_gene($) { # <gene id = "242" label = "SPCC576.16"> my $line = $_; if ($line =~ /\s{3}\<gene\sid\s\=\s\"(\d{1,6})\"\slabel\s\=\s\"([. +|\.]{1,40})\"\>/){ $gene_id = $1; $gene_label = $2; } else { print "ERROR. Somebody has altered the regular expression"; } return $gene_id; return $gene_label; } sub check_gene_seq($){ # <gene_seq id = "311" status = "Sanger source DNA code" CDS_number + = "3" number_of_CDSs = "" sequence_source = "" startpos = "2110545" +endpos = "2110823" startopen = "1" endopen = "1" complement = "C"/> if ($_ =~ /\s{4}\<gene_seq\sid\s\=\s\"(\d{0,6})\"\sstatus\s{0,2}\= +\s{0,2}\"(.{0,50})\"\s{0,2}CDS_number\s{0,2}\=\s{0,2}\"(\d{1,3})\"\s{ +0,2}number_of_CDSs\s{0,2}\=\s{0,2}\"(\d{0,5})\"\s{0,2}sequence_source +\s{0,2}\=\s{0,2}\"(.{0,300})\"\s{0,2}startpos\s{0,2}\=\s{0,2}\"(\d{0, +9})\"\s{0,2}endpos\s{0,2}\=\s{0,2}\"(\d{0,9})\"\s{0,2}startopen\s{0,2 +}\=\s{0,2}\"(\d{0,1})\"\sendopen\s{0,2}\=\s{0,2}\"(\d{0,1})\"\s{0,2}c +omplement\s{0,2}\=\s{0,2}\"(.{0,1})\"\>/){ my $gene_seq_id = $1; my $gene_seq_status = $2; my $gene_seq_CDS_number = $3; my $gene_seq_number_of_CDSs = $4; my $gene_seq_sequence_source = $5; my $gene_seq_startpos = $6; my $gene_seq_endpos = $7; my $gene_seq_startopen = $8; my $gene_seq_endopen = $9; my $gene_seq_complement = $10; } else { print "Error. Someone has altered the reguar expression"; } return $gene_seq_id; return $gene_seq_status; return $gene_seq_CDS_number; return $gene_seq_number_of_CDSs; return $gene_seq_sequence_source; return $gene_seq_startpoks; return $gene_seq_endpos; return $gene_seq_startopen; return $gene_seq_endopen; return $gene_seq_complement; } sub extractseq($$$$){ # Pass through the FASTA label, the location of +sequence, the start pos and the end pos. $label = $_[0]; $gene_seq_sequence_source = $_[1]; $startpos = $_[2]; $endpos) = $_[3]; print "$gene_seq_sequence_source\n"; sleep 1; print "system ('extractseq $gene_seq_sequence_source extracted_seq +_$label.txt -regions \"$startpos..$endpos\"')\;"; system ("extractseq $gene_seq_sequence_source extracted_seq_$label +.txt -regions \"$startpos..$endpos\""); }

In reply to called too early to check prototype by matth

Title:
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, details, 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, summary, 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.