NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <stdio.h>
#include <string.h>


int SearchStringInArray( char* array[], char* key, int size )
{
int n;
for ( n = 0; n < size; ++n ) {
if ( !strcmp(array[n], key) ) {

return n;
}
}
return -1;

}

int main(int argc,char *argv[]) {
char *fenilalanin[2] = {"UUU", "UUC"};
char *losin[6] = {"UUA", "UUG", "CUU", "CUC", "CUA", "CUG"};
char *izolosin[3] = {"AUU", "AUC", "AUA"};
char *metionin[1] = {"AUG"};
char *valin[4] = {"GUU", "GUC", "GUA", "GUG"};
char *serin[6] = {"UCU", "UCC", "UCA", "UCG", "AGU", "AGC"};
char *prolin[4] = {"CCU", "CCC", "CCA", "CCG"};
char *treonin[4] = {"ACU", "ACC", "ACA", "ACG"};
char *alanin[4] = {"GCU", "GCC", "GCA", "GCG"};
char *triozin[2] = {"UAU", "UAC"};
char *stop_codon[3] = {"UAA", "UAG", "UGA"};
char *histidin[2] = {"CAU", "CAC"};
char *glutamin[2] = {"CAA", "CAG"};
char *asparajin[2] = {"AAU", "AAC"};
char *lizin[2] = {"AAA", "AAG"};
char *aspartik_acid[2] = {"GAU", "GAC"};
char *glutamic_acid[2] = {"GAA", "GAG"};
char *sistein[2] = {"UGU", "UGC"};
char *triptofan[1] = {"UGG"};
char *arjinin[6] = {"CGU", "CGC", "CGA", "CGG", "AGA", "AGG"};
char *glisin[4] = {"GGU", "GGC", "GGA", "GGG"};
FILE *fp;
char protein[255];
fp = fopen(argv[1], "r");
fscanf(fp, "%[^n]", protein);
printf("fname: %sFile content: %sn",argv[1],protein );
printf("n") ;
char str1[4] ;
char str2[4] ;
char str3[4] ;
char str4[4] ;
char str5[4] ;
char str6[4] ;
char str7[4] ;
char str8[4] ;
char str9[4] ;
char str10[4] ;
memcpy(str1,protein, 3);
memcpy(str2, protein+3, 3);
memcpy(str3, protein+6, 3);
memcpy(str4, protein+9, 3);
memcpy(str5, protein+12, 3);
memcpy(str6, protein+15, 3);
memcpy(str7, protein+18, 3);
memcpy(str8, protein+21, 3);
memcpy(str9, protein+24, 3);
memcpy(str10, protein+27, 3);
char start[] = "AUG";
if (strcmp(str1,start) == 0 && ( strcmp(str10,stop_codon[0])== 0 || strcmp(str10,stop_codon[1])== 0 || strcmp(str10,stop_codon[2])== 0 ) ) {
if (SearchStringInArray(valin, str2, 4) != -1 && SearchStringInArray(alanin, str3, 4) != -1 &&
SearchStringInArray(glutamic_acid, str4, 2) != -1 &&
SearchStringInArray(glisin, str5, 4) != -1 &&
SearchStringInArray(treonin, str6, 4) != -1 &&
SearchStringInArray(lizin, str7, 2) != -1 &&
SearchStringInArray(arjinin, str8, 6) != -1 &&
SearchStringInArray(izolosin, str9, 3) != -1 &&
SearchStringInArray(stop_codon, str10, 3) != -1 )
{
printf("MyProteinA is identified in sequence.n");
printf("The amino acids of MyProteinA: M-V-A-E-G-T-K-R-In") ;
printf("proteinA: M-V-A-E-G-T-K-R-In") ;
}
else if ((SearchStringInArray(glisin, str2, 4) != -1) && (SearchStringInArray(glutamic_acid, str3, 2) != -1) &&
(SearchStringInArray(alanin, str4, 4) != -1) &&
(SearchStringInArray(valin, str5, 4) != -1) &&
(SearchStringInArray(arjinin, str6, 6) != -1) &&
(SearchStringInArray(lizin, str7, 2) != -1) &&
(SearchStringInArray(treonin, str8, 4) != -1) &&
(SearchStringInArray(izolosin, str9, 3) != -1) &&
(SearchStringInArray(stop_codon, str10, 3) != -1) )
{
printf("MyProteinB is identified in sequence.n") ;
printf("The amino acids of MyProteinB: M-G-E-A-V-R-K-T-In") ;
printf("proteinB: M-G-E-A-V-R-K-T-In") ;
}
else if ((SearchStringInArray(fenilalanin, str2, 2) != -1) && (SearchStringInArray(serin, str3, 6) != -1) &&
(SearchStringInArray(triozin, str4, 2) != -1) &&
(SearchStringInArray(sistein, str5, 2) != -1) &&
(SearchStringInArray(losin, str6, 6) != -1) &&
(SearchStringInArray(prolin, str7, 4) != -1) &&
(SearchStringInArray(glutamin, str8, 2) != -1) &&
(SearchStringInArray(arjinin, str9, 6) != -1) &&
(SearchStringInArray(stop_codon, str10, 3) != -1) )
{
printf("MyProteinC is identified in sequence.n") ;
printf("The aminoacids of MyProteinC: M-F-S-Y-C-L-P-Q-Rn");
printf("proteinC: M-F-S-Y-C-L-P-Q-Rn") ;
}
else if ((SearchStringInArray(fenilalanin, str2, 2) != -1) && (SearchStringInArray(losin, str3, 6) != -1) &&
(SearchStringInArray(valin, str4, 4) != -1) &&
(SearchStringInArray(prolin, str5, 4) != -1) &&
(SearchStringInArray(treonin, str6, 4) != -1) &&
(SearchStringInArray(triozin, str7, 2) != -1) &&
(SearchStringInArray(aspartik_acid, str8, 2) != -1) &&
(SearchStringInArray(histidin, str9, 2) != -1) &&
(SearchStringInArray(stop_codon, str10, 3) != -1) )
{
printf("MyProteinD is identified in sequence.n") ;
printf("The aminoacids of MyProteinD: M-F-L-V-P-T-Y-D-Hn") ;
printf("proteinD: M-F-L-V-P-T-Y-D-Hn");
}
else if ((SearchStringInArray(fenilalanin, str2, 2) != -1) && (SearchStringInArray(serin, str3, 6) != -1) &&
(SearchStringInArray(triozin, str4, 2) != -1) &&
(SearchStringInArray(sistein, str5, 2) != -1) &&
(SearchStringInArray(losin, str6, 6) != -1) &&
(SearchStringInArray(prolin, str7, 4) != -1) &&
(SearchStringInArray(lizin, str8, 2) != -1) &&
(SearchStringInArray(arjinin, str9, 6) != -1) &&
(SearchStringInArray(stop_codon, str10, 3) != -1) )
{
printf("MyProteinE is identified in sequence.n") ;
printf("The aminoacids of MyProteinE: M-F-S-Y-C-L-P-K-Rn") ;
printf("proteinE: M-F-S-Y-C-L-P-K-Rn") ;
}
else {
printf("It is not a known proteinn") ;
printf("It is probably a new protein. Mn") ;
}


}

else {
if (strcmp(str1,start)!= 0)
printf("Not start with AUG it is not a proteinn");
else
printf("It is not a protein! No Stop coden") ;
}
return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.