Clear Filters
Clear Filters

How to search a gene from genome using gene ID?

3 views (last 30 days)
I have saved the whole genome fasta file and the gene fasta file into a folder.
Now I want to search whether the gene is available in that genome or not and how many time if yes.
Is there any function available in matlab for this kind of application?
  2 Comments
KSSV
KSSV on 13 Mar 2017
Is it that you have strings and you need to search for a specific string?
Matt C
Matt C on 25 Jul 2018
I think this can be accomplished by using the fastaread() and count() functions.
The fastaread() function accepts the name of the fasta file as an input and returns a struct containing the header information and the actual sequence in the file. Optional parameters can also be added to the function call. For instance, the function could be called like fastaread('fileName', 'IgnoreGaps', true) in order to remove the gap symbols from the sequence.
The documentation for fastaread() is found here: https://www.mathworks.com/help/bioinfo/ref/fastaread.html
The count() function accepts a string and a substring and returns how many times the substring occurs in the larger string.
The documentation for count() is found here: https://www.mathworks.com/help/matlab/ref/count.html
I think the number of occurrences of the gene in the genome could be calculated by the following pseudo-code:
% Reads the gene fasta file
geneData = fastaread('geneFileName');
% Reads the genome fasta file
genomeData = fastaread('genomeFileName');
% Counts the occurrences of the gene sequence in the genome sequence
numberOfOccurrences = count(genomeData.Sequence, geneData.Sequence);

Sign in to comment.

Answers (0)

Categories

Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!