Setp 1. Create an index
./Segemehl. X-x Chr. ctidx-y Chr. gaidx-D Chr. Fa-f [1 or 2]
Setp 2. Generate a SAM File
./Segemehl. X-I Chr. ctidx-J Chr. gaidx-D Chr. Fa-Q myreads. Fa-O mymap. Sam-f [1 or 2]
Setp 3. Further analysis using the callmajormethyl. pl script
Samtools view-HS target. Sam | awk '/^ @/|/XB: Z: f .. CT/'> tmp.tar get. Ct. Sam
Samtools view-BS tmp.tar get. Ct. Sam> tmp.tar get. Ct. Bam
Samtools sort tmp.tar get. Ct. Bam tmp.tar get. Ct. Sorted
Samtools mpileup-BF Chr. Fa tmp.tar get. Ct. Sorted. Bam> tmp.tar get. Test
Perl callmajormethyl. pl-S 1-I tmp.tar get. Test-O tmp.target.test.txt
========================================================== ======================================
Samtools mpileup needs to be executed cyclically in setp3, and shell script is required
#! /Bin/bash
If [$ UID-Ne 0];
Then
Echo "please run as root"
Exit 1
Fi
# Define the path of the. Fa File
Fa_path = $1
# Define the path of the. Sam File
Sam_path = $2
# Match the required entries in the SAM File
Samtools view-HS $ {sam_path} | awk '/^ @/|/XB: Z: f .. CT/'> TMP. Ct. Sam
# Convert a SAM file to a BAM File
Samtools view-bs tmp. Ct. Sam> TMP. Ct. Bam
# Process the BAM file sort
Samtools sort TMP. Ct. Bam TMP. Ct. Sorted
# Compare different chromosomes in the FA folder
For fa in $ {fa_path} *. Fa; do
Name =$ {fa ##*/}
Samtools mpileup-BF $ {fa} TMP. Ct. Sorted. Bam> TMP
Perl/home/dklv/segemehl/callmajormethyl. pl-S 1-I TMP-O too many name1_.txt
Echo "$ {name} has been processed"
Done
# Delete temporary files
Rm-rf tmp *
Rm-RF $ {fa_path} *. Fai
Echo ""
Echo ""
Echo ""
Echo "============================================== ===="
Echo "all. Fa file have been processed"
Echo ""
========================================================== ============
Appendix 1 segemehl Manual
Http://pan.baidu.com/s/1nt5bJXf
Appendix 2 segemehl project Homepage
Http://www.bioinf.uni-leipzig.de/Software/segemehl/
How to Use segemehl