1 The field of Genome annotation pay a lot of attentions where the ability to collect and analysis genomical data can provide strong indicator for the study of life\cite{Eisen2007}. A lot of genome annotation centres present various types of annotation tools (i.e cost-effective sequencing methods\cite{Bakke2009}) on different annotation levels. Methods of gene finding in annotated genome can be categorized as: Alignment-based, composition based or combination of both\cite{parra2007cegma}. The Alignment-based method is used when we try to predict a coding gene (i.e. Genes that produce proteins) by aligning DNA sequence of gene to the protein of cDNA sequence of homolog\cite{parra2007cegma}, this approache used in GeneWise\cite{birney2004genewise} with known splicing signals. Composition-based mothod (known as \textit{ab initio} is based on a probabilistic model of gene structure to find genes and/or new genes accoding to the probility gene value, this method like GeneID\cite{parra2000geneid}. In this section, we will consider a new method of finding core genes from large amount of chloroplast genomes, as a solution of the previous method where stated in section two. This method is based on extracting gene features. The question now is how can we have good annotation genome? To answer this question, we need to focusing on studying the annotation's accuracy (systematically\cite{Bakke2009}) of the genome. The general overview of the system is illustrated in Figure \ref{Fig1}.\\
4 \caption{A general overview of the system}
6 \includegraphics[width=0.5\textwidth]{generalView}
10 In Figure 1, we illustrate the general overview of the system. In this system, there are three main stages: \textit{Database, Gene extraction ,} and \textit{relationships}. There are many international nucleotide sequence databases like (GenBank/NCBI in USA at (http://www.ncbi.nlm.nih.gov/genbank/),\\ EMBL-Bank/ENA/EBI in Europe at (http://www.ebi.ac.uk/ena/), and DDBJ in Japon at (http://www.ddbj.nig.ac.jp/)). In our work, the database must be any confident data source that store annotated or unannotated chloroplast genomes. We will consider GenBank/NCBI database as our nucleotide sequences database. Extract Gene Features, we refer to our main process of extracting needed information to find core genome from well large annotation genomes. Thanks to good annotation tool that lead us to extract good gene features. Here, Gene features can be anything like (genes names, gene sequences, protein sequence,...etc). To verify the results from our system, we need to organize and represent our results in the form of (tables, phylogenetic trees, graphs,...,etc), and compare these results with another annotation tool like Dogma\cite{RDogma}. All this work is to see the relationship among our large population of chloroplast genomes and find the core genome for root ancestral node. Furthermore, in this part we can visualize the evolution relationships of different chloroplast organisms.\\
11 The output from each stage in our system will be considered to be an input to the second stage and so on. The rest of this section, in section 3.1, we will introduce some annotation problem with NCBI chloroplast genomes and we will discuss our method for how can we extract useful data. Section 3.2 we will present here our system for calculating evolutionary core genome based on another annotation tool than NCBI.
13 \subsection{Genomes Samples}
14 In this research, we retrieved 107 genomes of Chloroplasts from NCBI where 9 genomes considered as not good. These 99 genomes lies in the 11 types of chloroplast families, divided as 11 for Algues Brunes, 3 Algue Rouges, 17 Algues Vertes, 45 Angiospermes, 3 Brypoytes, 2 Dinoflagelles, 2 Euglenes, 5 Filicophytes, 7 Gymnosperms, 2 Lycophytes, and 1 Haptophytes, as show in Table 1.
16 \footnotesize % Switch from 12pt to 11pt; otherwise, table won't fit
17 \setlength\LTleft{-30pt} % default: \fill
18 \setlength\LTright{-30pt} % default: \fill
19 \begin{longtable}{@{\extracolsep{\fill}}llllllllll@{}}
22 Category & Counts & Accession No & Scientific Name\\
25 & & NC\_001713.1 & Odontella sinensis \\
26 & & NC\_008588.1 & Phaeodactylum tricornutum \\
27 & & NC\_010772.1 & Heterosigma akashiwo \\
28 & & NC\_011600.1 & Vaucheria litorea \\
29 & & NC\_012903.1 & Aureoumbra lagunensis \\
31 & NC\_014808.1 & Thalassiosira oceanica \\
32 & & NC\_015403.1 & Fistulifera sp \\
33 & & NC\_016731.1 & Synedra acus \\
34 & & NC\_016735.1 & Fucus vesiculosus \\
35 & & NC\_018523.1 & Saccharina japonica \\
36 & & NC\_020014.1 & Nannochloropsis gadtina \\ [1ex]
37 %Entering second group
38 & & NC\_000925.1 & Porphyra purpurea \\
40 & NC\_001840.1 & Cyanidium caldarium \\
41 & & NC\_006137.1 & Gracilaria tenuistipitata \\ [1ex]
43 & & NC\_000927.1 & Nephroselmis olivacea \\
44 & & NC\_002186.1 & Mesotigma viride \\
45 & & NC\_005353.1 & Chlamydomonas reinhardtii \\
46 & & NC\_008097.1 & Chara vulgaris \\
47 & & NC\_008099.1 & Oltmannsiellopsis viridis \\
48 & & NC\_008114.1 & Pseudoclonium akinetum \\
49 & & NC\_008289.1 & Ostreococcus tauri \\
50 & & NC\_008372.1 & Stigeoclonium helveticum \\
52 & NC\_008822.1 & Chlorokybus atmophyticus \\
53 & & NC\_011031.1 & Oedogonium cardiacum \\
54 & & NC\_012097.1 & Pycnococcus provaseolii \\
55 & & NC\_012099.1 & Pyramimonas parkeae \\
56 & & NC\_012568.1 & Micromonas pusilla \\
57 & & NC\_014346.1 & Floydiella terrestris \\
58 & & NC\_015645.1 & Schizomeris leibleinii \\
59 & & NC\_016732.1 & Dunaliella salina \\
60 & & NC\_016733.1 & Pedinomonas minor \\ [1ex]
61 %Entering fourth group
62 & & NC\_001319.1 & Marchantia polymorpha \\
64 & NC\_004543.1 & Anthoceros formosae \\
65 & & NC\_005087.1 & Physcomitrella patens \\ [1ex]
67 & & NC\_014267.1 & Kryptoperidinium foliaceum \\
69 & NC\_014287.1 & Durinskia baltica \\ [1ex]
71 & & NC\_001603.2 & Euglena gracilis \\
73 & NC\_020018.1 & Monomorphina aenigmatica \\ [1ex]
74 %Entering seventh group
75 & & NC\_003386.1 & Psilotum nudum \\
76 & & NC\_008829.1 & Angiopteris evecta \\ [1ex]
78 & NC\_014348.1 & Pteridium aquilinum \\
79 & & NC\_014699.1 & Equisetum arvense \\
80 & & NC\_017006.1 & Mankyua chejuensis \\ [1ex]
81 % Entering eighth group
82 & & NC\_001568.1 & Epifagus virginiana \\
83 & & NC\_001666.2 & Zea Mays \\
84 & & NC\_005086.1 & Amborella trichopoda \\
85 & & NC\_006050.1 & Nymphaea alba \\
86 & & NC\_006290.1 & Panax ginseng \\
87 & & NC\_007578.1 & Lactuca sativa \\
88 & & NC\_007957.1 & vitis vinifera \\
89 & & NC\_007977.1 & Helianthus annuus \\
90 & & NC\_008325.1 & Daucus carota \\
91 & & NC\_008336.1 & Nandina domestica \\
92 & & NC\_008359.1 & Morus indica \\
93 & & NC\_008407.1 & Jasminum nudiflorum \\
94 & & NC\_008456.1 & Drimys granadensis \\
95 & & NC\_008457.1 & Piper cenocladum \\
96 & & NC\_009601.1 & Dioscorea elephantipes \\
97 & & NC\_009765.1 & Cuscuta gronovii \\
98 & & NC\_009808.1 & Ipomea purpurea \\
100 & NC\_010361.1 & Oenothera biennis \\
101 & & NC\_010433.1 & Manihot esculenta \\
102 & & NC\_010442.1 & Trachelium caeruleum \\
103 & & NC\_013707.2 & Olea europea \\
104 & & NC\_013823.1 & Typha latifolia \\
105 & & NC\_014570.1 & Eucalyptus \\
106 & & NC\_014674.1 & Castanea mollissima \\
107 & & NC\_014676.2 & Theobroma cacao \\
108 & & NC\_015830.1 & Bambusa emeiensis \\
109 & & NC\_015899.1 & Wolffia australiana \\
110 & & NC\_016433.2 & Sesamum indicum \\
111 & & NC\_016468.1 & Boea hygrometrica \\
112 & & NC\_016670.1 & Gossypium darwinii \\
113 & & NC\_016727.1 & Silene vulgaris \\
114 & & NC\_016734.1 & Brassica napus \\
115 & & NC\_016736.1 & Ricinus communis \\
116 & & NC\_016753.1 & Colocasia esculenta \\
117 & & NC\_017609.1 & Phalaenopsis equestris \\
118 & & NC\_018357.1 & Magnolia denudata \\
119 & & NC\_019601.1 & Fragaria chiloensis \\
120 & & NC\_008796.1 & Ranunculus macranthus \\
121 & & NC\_013991.2 & Phoenix dactylifera \\
122 & & NC\_016068.1 & Nicotiana undulata \\ [1ex]
123 %Entering ninth group
124 & & NC\_009618.1 & Cycas taitungensis \\
125 & & NC\_011942.1 & Gnetum parvifolium \\
126 & & NC\_016058.1 & Larix decidua \\
127 Gymnosperms & 7 & NC\_016063.1 & Cephalotaxus wilsoniana \\
128 & & NC\_016065.1 & Taiwania cryptomerioides \\
129 & & NC\_016069.1 & Picea morrisonicola \\
130 & & NC\_016986.1 & Gingko biloba \\
134 \subsection{Gene Extraction Techniques from annotated NCBI genomes}
135 With NCBI, the idea is to use the existing annotations of NCBI with chloroplast genomes. To extract the core and pan genes: Core extraction techniques with NCBI are based on two techniques: Gene count and Gene contents based on some similarity issues.
137 \subsubsection{Core genes based on NCBI Gene names and Counts}
138 The trivial and simple idea to construct the core genome is based on the extraction of Genes names (as gene presence or absence). For instant, in this stage neither sequence comparison nor new annotation were made, we just want to extract all gene counts stored in each chloroplast genome then find the intersection core genes based on gene names.\\
140 \textbf{Step I: pre-processing}\\
141 The objective from this step is to organize, solve genes duplications, and generate sets of genes for each genome. The input to the system is a list genomes from NCBI stored as a \textit{.fasta} file that include a collection of coding genes\cite{parra2007cegma}(genes that produce protein) with its coding sequences.
142 As a preparation step to achieve the set of core genes, we need to translate these genomes and extracting all information needed to find the core genes. This is not an easy job. The output from this operation is a lists of genes stored in a local database for genomes, their genes names and genes counts. In this stage, we will accumulate some Gene duplications with each genome treated. In other words, duplication in gene name can comes from genes fragments as long as chloroplast DNA sequences. Identical state, which it is the state that each gene present only one time in a genome (i.e Gene has no copy) without considering the position or gene orientation can be reached by filtering the database from redundant gene name. To do this, we have two solutions: first, we made an orthography checking. Orthography checking is used to merge fragments of a gene to be one gene so that we can solve a duplication.
143 Second, we convert the list of genes names for each genome (i.e. after orthography check) in the database to be a set of genes names. Mathematically speaking, if $g=\left[g_1,g_2,g_3,g_1,g_3,g_4\right]$ is a list of genes names, by using the definition of a set in mathematics, we will have $set(g)=\{g_1,g_2,g_3,g_4\}$, where each gene represented only ones. With NCBI genomes, we do not have a problem of genes fragments because they already treated it, but there are a problem of genes orthography. This can generate the problem of gene lost in our method and effect in turn the core genes.
144 The whole process of extracting core genome based on genes names and counts among genomes is illustrate in Figure \ref{Fig2}.
148 \includegraphics[width=0.9\textwidth]{NCBI_GeneName}
150 \caption{Extracting Core genes based on NCBI Gene name and Counts}
154 \textbf{Step II: Gene Intersection}\\
155 The main objective of this step is try to find best core genes from sets of genes in the database. The idea for finding core genes is to collect in each iteration the maximum number of common genes. To do this, the system build an intersection core matrix(ICM). ICM here is a two dimensional symmetric matrix where each row and column represent the list of genomes in the local database. Each position in ICM stores the \textit{intersection scores}. Intersection Score(IS), is the score by intersect in each iteration two sets of genes for two different genomes in the database. Taking maximum score from each row and then taking the maximum of them will result to draw the two genomes with their maximum core. Then, the system remove these two genomes from ICM and add the core of them under a specific name to ICM for the calculation in next iteration. The core genes generated with its set of genes will store in a database for reused in the future. this process repeat until all genomes treated. If maximum intersection core(MIC) equal to 0, the system will avoid this intersection operation and ignore the genome that smash the maximum core genes.\\
156 We observe that ICM will result to be very large because of the huge amount of data that it stores. In addition, this will results to be time and memory consuming for calculating the intersection scores by using just genes names. To increase the speed of calculations, we can calculate the upper triangle scores only and exclude diagonal scores. This will reduce whole processing time and memory to half. The time complexity for this process after enhancement changed from $O(n^2)$ to $O((n-1)\log{n})$.\\
157 The Algorithm of construction the matrix and extracting maximum core genes where illustrated in Algorithm \ref{Alg1}. The output from this step is the maximum core genes with its genomes to draw it in a tree.
160 \caption{Extract Maximum Intersection Score}
163 \REQUIRE $L \leftarrow sets of genomes genes$
164 \ENSURE $B1 \leftarrow Max core$
165 \FOR{$i \leftarrow 0:len(L)-1$}
166 \STATE $core1 \leftarrow set(GenomeList[L[i]])$
167 \STATE $score1 \leftarrow 0$
168 \STATE $g1,g2 \leftarrow$ " "
169 \FOR{$j \leftarrow i+1:len(L)$}
170 \STATE $core2 \leftarrow set(GenomeList[L[i]])$
172 \STATE $Core \leftarrow core1 \cap core2$
173 \IF{$len(Core) > score1$}
174 \STATE $g1 \leftarrow L[i]$
175 \STATE $g2 \leftarrow L[j]$
176 \STATE $Score \leftarrow len(Core)$
177 \ELSIF{$len(Core) == 0$}
178 \STATE $g1 \leftarrow L[i]$
179 \STATE $g2 \leftarrow L[j]$
180 \STATE $Score \leftarrow -1$
184 \STATE $B1[score1] \leftarrow (g1,g2)$
190 \textit{GenomeList} represents the database.\\
192 \textbf{Step III: Drawing the Tree}\\
193 The main objective here is to the results for visualizing a tree of evolution. We use here a directed graph from Dot graph package\cite{gansner2002drawing} from Graphviz library. The system can produce this tree automatically by using all information available in a database. Core genes generated with their genes can be very important information in the tree, because they can be represented as an ancestor information for two genomes or more. Further more, each node represents a genome or a core as \textit{(Genes count:Family name,Scientific name,Accession number)}, Edges represent the number of lost genes from genomes-core or core-core relationship. The number of lost genes here can be an important factor for evolution, it represents how much lost of genes for the species in same or different families. By the principle of classification, small genes lost among species can say that these species are closely together and belongs to same family, while big genes lost means that species is far to be in the same family. To see the picture clearly, Phylogenetic tree is an evolutionary tree generated also by the system. Generating this tree is based on the distances among genes sequences. There are many resources to build such tree (for example: PHYML\cite{guindon2005phyml}, RAxML{\cite{stamatakis2008raxml,stamatakis2005raxml}, BioNJ , and TNT\cite{goloboff2008tnt}}. We consider to use RAxML\cite{stamatakis2008raxml,stamatakis2005raxml} to generate this tree.
195 The main drawback from this method is that we can not depending only on genes names because of three causes: first, the genome may have not totally named (This can be found in early versions of NCBI genomes), so we will have some lost sequences. Second, we may have two genes sharing the same name, while their sequences are different. Third, we need to annotate all the genomes.
197 \subsubsection{Extracting Core genome from NCBI gene contents}
200 \subsection{Core genes from Dogma Annotation tool}
203 \subsubsection{Core genes based on Genes names and count}
206 \caption{Extracting Core genome based on Gene Name}
208 \includegraphics[width=0.7\textwidth]{Dogma_GeneName}
212 \subsubsection{Core genome from Dogma gene contents}
215 \caption{Extracting Core genome based on Gene Name}
217 \includegraphics[width=0.7\textwidth]{Dogma_GeneContent}