Write a function that will read the atoms for a protein, Programming Languages

Assignment Help:

Write a function readPDBfile('filename') that will read the atoms for a protein stored in a PDB file, whose name is provided as an input to the function (note that this name should be a string; i.e., specified in quotes). For this part, you should save your function in an m-file called readPDBfile.m. The function declaration should be

function [anum, aname, resno, coords] = readPDBfile(infile);

From the above declaration, you'll notice that your function should have four outputs. These output variables represent the following:

anum: An n×1 column vector with the serial number for each atom as integers

aname: An n×4 string array with the 4-letter atom uppercase name for each atom

resno: An n×1 vector with a residue sequence number for each atom as integers

coords: An n×3 matrix with xyz coordinates (in angstroms) for each atom as doubles In the above, 'n' stands for the number of atoms (or ATOM commands) in the .PDB file.

What to submit: Your m-file containing code for the readPDBfile function. I will run and test this on real data, so test and make sure your function works (i.e., by calling this function on the two provided PDB files, and making sure your output looks fine). In other words, for this part, once you've written your readPDBfile() function, you would call it from the command line as follows:

>> [anum, aname, resno, coords] = readPDBfile('1GFL-pdb.txt');  

and  

>> [anum, aname, resno, coords] = readPDBfile('7HVP-pdb.txt');  

For each case, you should visually inspect the output variables (double-click on the variables in the MATLAB Workspace window), and make sure that the values for these variables are the same as the ones stored in the respective PDB files.   

Note: For the above two lines to work,  the provided PDB  files must be in the same folder as your readPDBfile.m MATLAB m-file. Alternatively, you could provide the full path to the PDB file when calling the function; e.g., readPDBfile('e:/code/data/a7/1GFL-pdb.txt');  

Note: You can double-click to open and manually inspect the PDB files.


Related Discussions:- Write a function that will read the atoms for a protein

Create procedures for accessing the root, (a)  Create procedures for access...

(a)  Create procedures for accessing the root, left subtree and right subtree, and also mutators for changing the root, left subtree and right subtree of an avl argument. (b) Wr

Define parameter passing mechanism - computer programming, Define the Param...

Define the Parameter Passing Mechanism - Computer Programming? The Parameters are syntactically identifiers and they are used within the body of the function and sometimes the

Program to change date format, Write a program that accepts a date from the...

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the name of the month. Enter a date (mm/d

Formulas, how do I change a existing formula with a new formula and it show...

how do I change a existing formula with a new formula and it show the result

Matlab project - beginners level, Can you provide help in solving error pro...

Can you provide help in solving error problems, with my matlab project?

Genetic algorithm, I need help I want to implement the Genetic Algorithm f...

I need help I want to implement the Genetic Algorithm for Shortest path Kindly Help me I will be thankful to you

Programs to solve the nonlinear algebraic equations, Introduction Each...

Introduction Each module of the course includes a programming project. However, for Modules 5 and 6 we will do a single project to cover both. The purpose of the programming p

Oop, Using OOP,write a sample program to get the factorial of a number ente...

Using OOP,write a sample program to get the factorial of a number entered by a user

Use an insertion sort to sort an array, Use an insertion sort to sort an ar...

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd