samtools sort $i.bam -o $i.sorted.bam ## sort by position
java -jar ~/anaconda2/share/picard-2.21.6-0/picard.jar \ ##picard.jar absolute path
MarkDuplicates REMOVE_DUPLICATES \ ## function
-I $i.sorted.bam -O $i.dedup.bam -M picard1.txt \ ## input and output
samtools sort -n $i.dedup.bam -o $i.dedup.sorted.bam ## resort by reads name
extraction_DNA_methylatiuon
bismark_methylaiton_extractor -p \ ##paired-end
--no_overlap \ ##avoids scoring overlapping methylation calls twice
--comprehensive \ ##merge all four possible strand-specific methylation info into context-dependent output files
--report \ ##methylation summary
-o ./ \ ## output file
--gzip \ ## gzip output
--multicore 4 \ ## use multicores 4*4
--buffer_size 20G \ ## main memory sort buffer when sorting the methylation information
--CX \ ##information on every single cytosine in the genome irrespective of its context
--cytosine_report \ ## genome-wide methylation report for all cytosines in the genome
--genome_folder ../genomefolder/ \ ## reference genome path
--zero_based \ ## 0-based or 1-based
$i.dedup.sorted.bam