In C or C# programming : In this project. you arc expected to write a program (G
ID: 3677069 • Letter: I
Question
In C or C# programming :
In this project. you arc expected to write a program (GUI is preferred) to study the Secondary Structures (helices and sheets) from a protein structure. Your program is expected to extract the secondary structures from a given PDB file according to a user's preferences (either using its ID and your program fetch it from online or uploaded locally from the computer). You program is expected to search through the input protein structure and extract the secondary structure portions of the protein. In Task 1. your program will write a PDB file for each secondary structure extracted. This allows us to load the extracted secondary structure into Chimera and visualize just this secondary structure. The name of the output file should include the PDB ID of the protein. H for helix and S for a sheet and the index of the secondary structure for clear reference. For example if the user loads a protein file from C:DocumcntsFAR that has 3 helices and 2 beta sheets, your program should write 5 separate files that include these secondary structures separately into the same directory where your executable is. The names of these files will be 1FAR_H_I, 1FAR_H_2. 1 FAR_H_3, 1FAR_S_1. and 1FAR_S_2. The input includes one file for a secondary structure written by your task 1 (i.e.. IFAR_H_2). Your program should calculate the angles between each three consecutive CA atoms (i.e., CA1-CA2-CA3, CA2-CA3-CA4...ctc.) and the distance between each two consecutive CA atoms (i.e., CAI-CA2, CA2-CA3...ctc.). Then your program should report the angles and distances in a table similar to the ones below including number of amino acids in the secondary structure. Please note that the examples given arc for explanation and may not be correct for secondary structures in 1FAR protein.Explanation / Answer
Answer=1
#include<iostream.h>
#include <Conio.h>
#include<string>
Void input()
Int parsecommand(int argc, char**argv, );
Void display()
char primary;
char secondary;
char *primary_num;
char*secondary_num;
int version;
int main(int argc, char*argv[])
{
if(parsecommand(argc, argv))
{
display();
return 1;
}
else
return 0;
}
ifstream input_file(“input.txt”);
string line;
int offset=0;
ofstream outdata;
ofstream temp;
vector<char> pri_seq;
vector<char> sec_seq;
temp.open(“temp.data”);
if(!outdata)
{
cout<< “file not be open”;
return 1;
}
if (input file is open())
{
while(!input_file.eof())
{
getline(input_file.line);
if(offset=line.find(search,0))
{
getline(input_file,line);
while(input_file.eof())
{
if(isalpha(line[13]))
primary=(Char)(line[13]);
else primary=line[13];
secondary=line[16];
if(version==1)
cout<<primary_num<<”,”<<secondary_num<<”;
getline(input_file, line);
}
If (version==1)
}
}
}
input_file.close();
if (version==2)
{
for(int k=0; k<primary_seq(); k++)
{
cout<<primary_seq.at(k);
}
cout<<endl;
for(int k=0; k< sec_seq.size(); k++)
{
break:
case ‘N’:
primary_num=”3”;
break:
case ‘D’:
primary_num= “4”:
break:
case ‘E’:
primary_num=”6”:
break:
case ‘L’ :
primary_num=”11”;
}
switch (secondary)
{
Case ‘H’:
Case’G’:
Secondary_num = “1”:
break:
Case ‘E’:
Case’B’:
Secondary_num = “2”:
break:
default:
Secondary_num= “3”:
break:
}
}
char map_sec(Char seC)
{
if (sec==’H’ || sec==’G’ || sec’I’)
return ‘H’:
}
else if (sec==’B’ || sec==’E’)
{
return ‘E’:
}
else
return ‘C’:
}
Answer=2
#include<stdio.h>
#include<Conio.h>
#define num_amino 22
#define num_ss 5
Struct protein
{
int * primary_seq;
int *secondary_seq;
int size;
};
if (helix_history_in.is_open())
{
While(!helix_history_in.eof())
{
getline(helix_history_in, line);
if (strlen(line.c_str()!=0))
read_history(line, false);
}
helix_history_in.close();
}
else
{
cout<<not open the file;
return 1;
}
case ‘a’:
alpha_only=true:
Break:
Case ‘t’:
table=true:
break:
Case’m’:
main_only=true:
Break:
default:
err=0:
Break:
}
}
return(err):
}
Void init_array()
{
for(int i=0; i<num_amino; i++)
{
for(int j=0; j<num_amino; j++)
{
for(int k=0; k<num_ss; k++)
{
for(int l=0; l<num_ss; l++)
{
Helix_Count_array[i][j][k][l] =0;
Count_array[i][j][k][l] =0;
}
Event_spaCe[i][j][k] =0;
Helix_event_spaCe[i][j][k] =0;
}
int_Count_array[i][j] =0;
Helix_int_Count_array[i][j]=0;
}
Int_event_space[i] =0;
Helix_int_event_space[i] =0;
}
}