ID and name conversion is one of the common tasks in Bioinformatics. In this problem, you will write a function symbol=geneidtosymbol(id,filename) that will return the symbol of a gene, given its GeneID. The GeneID to symbol conversion should be looked up from a file named "gene_info.txt". Each line in this file contains tab-delimited information for a gene. The first line of the file specifies what type of information is available in each column. Download and use the file available from http://sacan.biomed.drexel.edu/ftp/bmes201/final.20123/gene_info.txt (which contains the first 100 lines of the file available from: <ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene_info.gz)>.
If filename is not given, use gene_info.txt. If it is given (may be different than gene_info.txt), use the filename provided as input.
Here is what I have so far:
function out = geneidtosymbol(x)fid=fopen('gene_info.txt','r'); %open file
if fid<0 fprintf('I am not able to open the pdb file'); out=[]; return;endsymbol=[];if ~feof(fid) line=fgetl(fid); str2num(line(3:10)) = x; line=strsplit(line); symbol=line{3};endout = symbol;
Best Answer