Hi guys.

Thanks for all the people who helped me

I am trying to find the exhaustive homologous match of a given sequence against a given library.

I run the fasta34.exe from my perl script,input the sequence & library file name which is stored in the perl folder and other input values .i got a output in the fasta format, which I parse thru and get the best sequence match above a given threshold value and store the match each at a time in a file. Now use this extracted sequence file to run the fasta again against the same library and inputs and try to call the fasta34 again and repeat the same procedure till u get the exhaustive homologous match. If u find any new sequence comparded to the original one, append to the original fasta file.

Using my code I am able to extract the sequence from the orginal file which fits the criteria above a threshold using the system command in the perl with the command line i can avoid reentring the inputs

The main problem the system command with the command line is not storing in a file.

has anybody experienced in using the command line in fasta as well as comparing the original file with new file generated and appending the new contents to the original file

Following is my code
#!usr/bin/perl -w print"\n********Running Fasta34********** \n \n"; print"\n Please enter the file sequence \n"; my $seqfile = <STDIN>; print "\n Please Enter the library file name \n"; my $library = <STDIN>; #my $library = defined $ARGV[1] ? $ARGV[1] : "$default_library"; # get library from command line, or use default my $output = "c:/perl/sam/out.fasta"; open(FASTA,"$output") or die "cant open the output file \n"; $result = system("c:/perl/sam/fasta34.exe -Q $seqfile $library -o $out +put"); #print"\n\n*****enter the output file name you have given***\n"; #$output = <STDIN>; my $seqname; my $iteration; my $orig = "c:/perl/sam/orginal.fasta"; my $out2in = "c:/perl/sam/output1.aa"; my $compare = "c:/perl/sam/compare.fasta"; 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,">>$orig"); open(OUT2IN,">$out2in"); print OUT2IN "$seqname$laterhalf \n"; print ORG "$seqname$laterhalf \n"; while(<FASTA>) { if (m/^($seqname)(.*)/) { #store the match sequence print OUT2IN "$2 \n"; print ORG "$2 \n"; } if(m/>>/) { #print "end of given loop"; print "rerunning the fasta program"; $iteration = system("c:/perl/sam/fasta34.exe -Q $o +ut2in $library -O $compare"); open(COMPARE,$compare); seek(FASTA,-100,1); last; } }close(OUT2IN); } } } close (FASTA); close (COMPARE); print $result; #print $iteration;

In reply to OUTPUT FILE 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.