Hi guys.

i am getting this error, which is due to line 132. $recall = system("c:/perl/sam/fasta34.exe -O $compare -Q $querry $library");

first time the system command runs perfectly fine, i dont know whats happening when it runs for the 2nd time

following is my code

can anybody please help me out

#!usr/bin/perl -w print"\n********Running Fasta34********** \n \n"; print"\n Please enter the file sequence \n"; my $seqfile = <STDIN>; #initial file querry sequence print "\n Please Enter the library file name \n"; #initial library my $library = <STDIN>; my @orgarr; my @inparr; my $recall; my $main = "c:/perl/sam/main.fasta"; #main.fasta stores the output to the fasta program $result = system("c:/perl/sam/fasta34.exe -O $main -Q $seqfile $librar +y"); if ($result >> 0) { warn "fasta34.exe ended with non-zero exit status \n"; } open(FASTA,"$main") or die "cant open the output file \n"; my $seqname; my $org = "c:/perl/sam/orginal.fasta"; #original.fasta stores the header and the sequences of all the matches + in fasta file my $input = "c:/perl/sam/input.txt"; #input.txt stores the header and the sequences of matches above cut o +ff print "Enter your cut off percentage"; $cut = <STDIN>; while (<FASTA>) { #compare the line of matching sequence if(m/>>(.{4,6})(.*)/) { $seqname = $1; $laterhalf = $2; } #print "SKIP A LINE iF A MATCH \n"; next if /^ini/; if (m/(\d+\.\d+)% identity/) { $per = $1; #check if match is above the cutoff percentage if ($per > $cut) { #print "\n\n$seqname$laterhalf \n"; #print "identity match $per % \n"; #store the first line of the input file open(ORG,">>$org"); open(INPUT,">>$input"); print INPUT ">$seqname$laterhalf \n"; print ORG ">$seqname$laterhalf \n"; #print all the sequences which matched the cutoff while(<FASTA>) { if (m/^($seqname)(.*)/) { #store the match sequence print INPUT "$2 \n"; print ORG "$2 \n"; } if(m/>>/) { #check if next sequence if so rewind one line back +"; seek(FASTA,-100,1); #break command last; } } print INPUT "\n"; print ORG "\n"; close(INPUT); close(ORG); } else { #printing all the sequences which is showed in fasta o/p f +ile open(ORG,">>$org"); print ORG ">$seqname$laterhalf \n"; while(<FASTA>) { if (m/^($seqname)(.*)/) { #store the match sequence print ORG "$2 \n"; } if(m/>>/) { #print "end of given loop"; seek(FASTA,-100,1); last; } } print ORG "\n"; close(ORG); } } } close (FASTA); open(ORG,"$org"); open(INPUT,"$input"); @inparr = <INPUT>; @orgarr = <ORG>; close(INPUT); close(ORG); $length=@inparr; print "length of inparr array is $length \n"; $querry = "c:/perl/sam/querry.aa"; $compare = "c:/perl/sam/compare.fasta"; $segcompare = "c:/perl/sam/segcompare.txt"; my $seqname1; my $laterhalf1; open(QUERRY,">$querry") or die "cannot open querry file\n"; open(SEGCOMPARE,">$segcompare") or die "cannot open segcompare file\n" +;; my $temp=0; while($temp<=$length) { while ($inparr[$temp] ne "\n") { print QUERRY "$inparr[$temp]"; $temp++; } $recall = system("c:/perl/sam/fasta34.exe -O $compare -Q $querry $ +library"); print "hi \n"; if ($recall > 0) { warn "fasta34.exe ended with non-zero exit status \n"; } open(COMPARE,"$compare")or die "cant open the output file \n"; while(<COMPARE>) { if(m/>>(.{4,6})(.*)/) { print SEGCOMPARE "\n"; $seqname1 = $1; $laterhalf1 = $2; print SEGCOMPARE "$seqname1$laterhalf1 \n"; } elsif (m/^($seqname1)(.*)/) { #store the match sequence print SEGCOMPARE "$2 \n"; } } my @segcomp = <SEGCOMPARE>; #$count++; #$temp++; } close(COMPARE); close(SEGCOMPARE); close(QUERRY);

In reply to could not open c by FarTech

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.