[emboss-dev] Enquiry about emboss needleall program

Tae-Kyung Kim misoh049 at gmail.com
Fri Jul 22 08:18:45 UTC 2011


Thank you for fast response.

When I first knew EMBOSS package a week ago, I have thought that needle is
only one global alignment program.

So I tried to perform many-to-many global alignment with needle. As you
know, it was inefficient with much I/O operation causing performance delay.

(To reduce overhead, I asked you about how to get the sequence parameter by
stdin ^^)

On studying other emboss program more, I identified the needleall program
for many-to-many alignment and tried to use it.

However, there was no description for result format in ./needleall --help
and it is the reason that I sent inquiry mail to you.

Fortunately, I have found the solution by googling as soon as sending email
to you.

sol)./needleall -asequence a.seq -bsequence b.seq  -nobrief -gapopen 10
-gapextend 0.5 -stdout -auto *-aformat3 srspair*

I am satisfied with much better performance than single needle after testing
with following test program.

Thank you again.

Best Regards,

Kim.



/*my test application*/
int get_needle_all_result(char *fname1, char *fname2){

  char cmd[10000], *cp1, *cp2, c1[1000], c2[1000];
  char seq1[100], seq2[100];
  int i=0, j=0, bar_cnt=0, dot_cnt=0, empty_line=0;

  FILE *fp;

  sprintf(cmd,"./needleall -asequence %s -bsequence %s  -nobrief -gapopen 10
-gapextend 0.5 -stdout -auto -aformat3 srspair",fname1, fname2);

  fp = popen(cmd,"r");
  if(fp==NULL){
    printf("Process Open Error!\n");
    exit(0);
  }

  while(1){
    cp1 = fgets(c1,1000,fp);
    if(cp1==NULL) break;
    if(strstr(c1,"1:")!=NULL){
       c1[strlen(c1)-1] = '\0';
       strcpy(seq1,c1+5);
    }else if(strstr(c1,"2:")!=NULL){
       c1[strlen(c1)-1] = '\0';
       strcpy(seq2,c1+5);

       for(i=0;i<16;i++) fgets(c1,1000,fp);

       bar_cnt=0;  dot_cnt=0;

       while(1){
         cp2 = fgets(c2,1000,fp);
         if(cp1==NULL) break;
         c2[strlen(c2)-1] = '\0';

         if(strstr(c2,"|")!=NULL || strstr(c2,".")!=NULL){
           for(j=0;j<71;j++) {
             if(c2[j]=='|') bar_cnt++;
             else if(c2[j]=='.') dot_cnt++;
           }
         }

         if(strlen(c2)==0) empty_line++;
         else empty_line=0;

         if(empty_line==2) {
          printf("%s:%s:%d:%d\n",seq1,seq2,bar_cnt,dot_cnt);     //liked
list
          empty_line=0;
          break;

         }
       }
    }
  }
  fclose(fp);
}





On Fri, Jul 22, 2011 at 4:30 PM, Peter Rice <pmr at ebi.ac.uk> wrote:

> On 22/07/2011 06:19, Tae-Kyung Kim wrote:
>
>> Hi,
>>
>> I am now trying to perform many-to-many global sequence alignment.
>> I know that *needleall* supports such a operation, but I would like to get
>> the same result with a needle program including alignment, identity.
>> Is there any method to get it?
>>
>
> Why do you want to use needle instead of needleall?
>
> needleall reads two sets of sequences (many to many)
>
> needle reads a single sequence, and a set of sequences to compare to (one
> to many).
>
> That should be the only diufference between the applications.
>
>
>  I have just used -[no]brief option. but I didn't get what I want.
>>
>
> The identity is in the header above each sequence alignment in the default
> output.
>
> There are other alignment output formats available with the -aformat
> option.
>
> Can you give an example of what you would like to see. We probably already
> have a format in needle and needleall that gives what you need.
>
> regards,
>
> Peter Rice
>



-- 
Tae-Kyung Kim, Ph.D.
Bio-Resource Information Team
Korea Bioinformation Center (KOBIC)
111 Gwahangno, Yuseong-gu, Daejeon 305-806, Korea
TEL: +82-42-879-8548
FAX: +82-42-879-8519



More information about the emboss-dev mailing list