ankita_ribose 0 Newbie Poster

Q:The genome of an organism is inscribed in DNA, or in some viruses RNA. The portion of the genome that codes for a protein or an RNA is referred to as a gene. Those genes that code for proteins are composed of tri-nucleotide units called codons, each coding for a single amino acid. Information about the twenty amino acids found in proteins, along with the single-letter code and DNA codons representing these amino acids in protein data bases is given to you.All 64 possible 3-letter combinations of the DNA coding units T, C, A and G are used either to encode one of these amino acids or as one of the three stop codons that signals the end of a sequence.

Start codon(AUG), Stop codon (UAG , UGA and UAA ).


You have to write a program, that takes a DNA sequence of arbitrary length and amino acid-codon table and output information about what all amino acids are present in that sequence. Design /Structure the input data, output data and processing data. You may add more queries.
PLEASE HELP ME FIND MISTAKES IN THE FOLLOWING PROGRAM:

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<alloc.h>

struct node
{
char data[4];//3 for codon nd one for null
struct list * next;
}
 main()
{
struct node *head,*trav;
FILE *fp;
char sq[50];
int i,n;
fp=fopen("sequence.txt","w");
 clrscr();
head=malloc(sizeof(struct node));
printf("enter the length of the sequence:");
scanf("%d",&n);
printf("enter the sequence:");
scanf("%s",sq);
fputs(sq,fp);//copies into file
printf("the sequence you have entered is:"); //prints data on screen
for(i=0;i<=n;i++)
{
printf("\t%c",sq[i]);
}
linked_list(head,fp);
fclose(fp);
getch();
}
      linked_list(struct node* head,FILE *fp)
    {

    int i;
    char data[4];
     struct node *newnode=malloc(sizeof(struct node));
     fp=fopen("sequence.txt","r");
     if(!fp)
     printf("cannot open file");
      exit(0);
     rewind(fp);

     for(i=0;i<4;i++)
    {
    fscanf(fp,"%c",data[i] );
    printf("%c",data[i]);
    if(feof(fp))
    exit(0);
    }
    data[3]='\0';
    if((strcmp(data,"AUG"))!=0)
    {
    fseek(fp,-2,1);
    }
    newnode->next=head;
    head=newnode;
    linked_list(newnode->next,fp);
    getch();

    fclose(fp);
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.