FarTech has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Fasta Using Perl
by Errto (Vicar) on Jan 23, 2005 at 04:36 UTC
    I have a few suggestions.
    1. Rephrase your question using complete sentences, capitalization, punctuation, and maybe even paragraphs. We don't require that you use the Queen's English, but your post has to be basically intelligible, which yours isn't really right now.
    2. Provide at least a rough sketch, using code in what you know of Perl, of what your program is actually going to do. Posting real code that you've already written and explaining where you're stuck is even more helpful.
    3. Take a look at some documentation. system explains how to simply call an external program from Perl, and perlopentut explain ways of passing data back and forth from external programs, and also how to write or append data to text files. bioperl has a lot of resources for manipulating gene sequence data and the like with Perl.
Re: Fasta Using Perl
by talexb (Chancellor) on Jan 23, 2005 at 01:38 UTC

    Or, to paraphrase,

    Hi guys.

    I am amateur in perl, I need your help in solving one of my assignments.

    In my program i have to call a fasta program using my perl script, after getting an output file of fasta, parse through it, and store the best matching sequence above a cut off point one at a time in a temporary file.

    Now use this temporary file as the input to fasta and run the same process again.

    Now compare the original output and the new output. If you have any additional sequences in the new fasta output file, append it to the original file, and repeat the process until (not sure about how to translte the rest of this -- Ed.) all the best sequence match above cut off is inputted to the fasta and you have the exhaustive homologous match

    (Note sure if this helps or is just a reiteration of the original question. --Ed.) The input of 2nd phase to fasta is extracted from the output of the 1st fasta program.

    So, for those who don't know (and that would include me from ten minutes ago), fasta "Compares a protein sequence to another protein sequence or to a protein database, or a DNA sequence to another DNA sequence or a DNA library." (reference).

    Perhaps you can explain what your code is doing, and where you think it is breaking. Or, if you haven't written any code yet, tell use what you want to do is clearer terms. Are you trying to run the fast process yourself, or are you merely submitting your samples to a web front-end that is doing the processing?

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Fasta Using Perl
by stajich (Chaplain) on Jan 23, 2005 at 17:05 UTC
    You can parse all the ouput with Bio::SearchIO. Try reading about Bioperl. Many many incarnations on how to do this, but if you wanted to run it on the fly try the following code. You can also of course run the program and pipe the output to a file. The HOWTOs on the site give a good coverage on the SearchIO system. (Note: Due to snowstorm in Boston and power outage the bioperl.org site is down for a little while)
    use Bio::SearchIO. my $fh; open($fh, "fasta34 query.pep db |"); my $in = Bio::SearchIO->new(-format => 'fasta', -fh => $fh); while( my $r = $in->next_result ) { while( my $hit = $r->next_hit ) { while( my $hsp = $hit->next_hsp ) { } } }
A reply falls below the community's threshold of quality. You may see it by logging in.