##Calculating the density of genomic elements as TEs or methylation sites around genes--------------------------------
perl process_count_elements_Nflank_NN_MG.pl TEs.gff Gene.5000.position Genome.fasta Genes TEs

perl process_stat_TEs_MG.pl Gene.5000.position.Genes.TEs Gene_subsetA.list TEs
perl process_SDoutlier_MG.pl Gene_subsetA.list.TEs.stat.ALL.sort

perl process_stat_TEs_MG.pl Gene.5000.position.Genes.TEs Gene_subsetB.list TEs
perl process_SDoutlier_MG.pl Gene_subsetB.list.TEs.stat.ALL.sort

perl process_genesElements_fig-6lines_MG.pl Gene_subsetA.list.TEs.stat.ALL.sort.full Gene_subsetA.list.TEs.stat.ALL.sort.gexon Gene_subsetA.list.TEs.stat.ALL.sort.gintron Gene_subsetB.list.TEs.stat.ALL.sort.full Gene_subsetB.list.TEs.stat.ALL.sort.gexon Gene_subsetB.list.TEs.stat.ALL.sort.gintron Gene_subsetAB.list.gene.TEs


##Calculating the methylation level around TEs--------------------------------
perl process_count_elements_Nflank_NN_MG-weightedMeth.pl CpG.txt.TypeLocation TEs.5000.position Genome.fasta ALL SamX.CpG.weightedMeth

perl process_stat_TEs_MG.pl TEs2ALL.SamX.CpG.weightedMeth TE_subsetA.list SamX.CpG.meth
perl process_SDoutlier_MG.pl TE_subsetA.list.SamX.CpG.meth.stat.ALL.sort

perl process_stat_TEs_MG.pl TEs2ALL.SamX.CpG.weightedMeth TE_subsetB.list SamX.CpG.meth
perl process_SDoutlier_MG.pl TE_subsetB.list.SamX.CpG.meth.stat.ALL.sort

perl process_genesElements_fig-6lines_MG.pl TE_subsetA.list.SamX.CpG.meth.stat.ALL.sort.full TE_subsetA.list.SamX.CpG.meth.stat.ALL.sort.gexon TE_subsetA.list.SamX.CpG.meth.stat.ALL.sort.gintron TE_subsetB.list.SamX.CpG.meth.stat.ALL.sort.full TE_subsetB.list.SamX.CpG.meth.stat.ALL.sort.gexon TE_subsetB.list.SamX.CpG.meth.stat.ALL.sort.gintron SamX.TEs_subsetAB.TEs.CpG.meth
