Dinh:COMPUTATIONAL/bisReadMapper: Difference between revisions

From ZhangLabWiki
Jump to navigation Jump to search
>Dinh
No edit summary
>Dinh
mNo edit summary
Line 1: Line 1:
==How to perform bisulfite reads mapping with bisReadMapper==
==To perform bisulfite reads mapping with bisReadMapper==
# Know where the following files and software are:
# Know where the following files and software are:
   1) Reference index
   1) Reference index
   2) soap
   2) soap or bowtie2
    currently I have bowtie2 running with --fast setting, which seems to be a lot slower than soap. this setting may be changed to --very-fast in the future for mapping BSPP data.
   3) samtools
   3) samtools
   4) reads (do not need to copy the reads to the current directory, nor concatenate them)
   4) reads (do not need to copy the reads to the current directory, nor concatenate them)
# Master shell script: 1 - perform mapping.
  We need to perform mapping and make sure that all reads mapped properly.


# Write the parameters file:
# This master script process bisulfite reads.
  Required:
  reads=s_5_1_sequence.txt,s_5_2_sequence.txt
  qualBase=[64/33]
  alignMode=[S/P]
  refDir=/path/to/bisRef
  soapDir=/path/to/soap
  samtoolsDir=/path/to/samtools
  soap2sam=/path/to/samtools/misc/soap2sam.pl
  name=Sample_Name (no space)


  Optional:
My_ref="/projects/zhang-lab/ddiep/bisHg19"
  numCPU=[#], number of processors to use for mapping
# Remember to use the correct number of nodes! Don't use too many nodes because this is slow
  allC=[yes/no], calls all methylation in all contexts?
# Remember to set the correct temporary directory for sorting in this script!
  rmdup=[yes/no], remove PCR duplicates using samtools rmdup?
bisReadMapper="/home/ddiep/scripts/MethylationPipeline/bisReadMapper_Bowtie2.pl"
  snp=/path/to/dbSNP/snp134.txt
  mapOnly=[yes/no], perform mapping only to generate sam files.
  trim5=[#], number of bases to trim from 5'
  trim3=[#], number of bases to trim from 3'
  qualTrim=[#], perform quality trimming using this quality score
  minDepth=[#], the minimum reads depth to call methylation in BED file.
  bam=[yes/no], the input reads file are already mapped and sorted bam files.


# To run the software anywhere:
for f in list_*
  nohup /path/to/bisReadMapper.pl sample_name.params > sample_name.log &
do
        g=`echo $f | sed 's/list_//g'`
        /home/ddiep/scripts/MethylationPipeline/wBOWTIE/submitBSPPMapJobs.pl $g $My_ref $bisReadMapper < $f
done


# To run the mapping on Triton, you need to write a *.job file!
# now we need to check that all jobs finished without error.
  #!/bin/csh
  #PBS -q small
  #PBS -l nodes=1:ppn=2
  #PBS -l walltime=36:00:00
  #PBS -o bisReadMapper_RL-KH4-Tn5mC_hg19.log
  #PBS -e bisReadMapper_RL-KH4-Tn5mC_hg19.err
  #PBS -V
  #PBS -M hdinhdp@gmail.com
  #PBS -m abe
  #PBS -A zhang-lab
  cd /phase1/ddiep/Working/WGBS_Rui_mm9/test_Hg19
  /home/ddiep/softwares/bisReadMapper_v1.1/bisReadMapper.pl RL-KH4-Tn5mC.params
 
  To submit the job:
  qsub name_of_file.job
 
Note about running Triton job:
  - for each job file, modify the *.log and *.err file names to make it specific to the sample or run
  - wall time may needs to be increased for more reads. Longer walltime may put the job later in the queue, jobs with shorter walltimes will get processed faster.
  - change the email to your specific email address
  - change the "cd .. " to go to the current working directory.
  - change the *.params file name, you can use the bisReadMapper in my directory.
  - Since bisReadMapper generate a large amount of intermediate files, it is better to run on Oasis (ie. phase1/ddiep ) because it have a large storage capacity. Final methyl frequency files can be copied over to zhang-lab.
  - When calling all C methylation. I would run with "mapOnly=yes" in the parameters file. Post processing steps can be later be run in parallel on Triton.
    Post processing:
    (1) Convert sam to sorted bam (since samtools sort can't run in parallel, we will do this one at a time), but using just 1 node on Triton
    (2) Run multiple jobs of bisReadMapper with "bam=yes" in parallel for each chromosome. Note that each chromosome have a pair of *.bam files that is required for bisReadMapper

Revision as of 01:43, 21 July 2012

To perform bisulfite reads mapping with bisReadMapper

  1. Know where the following files and software are:
 1) Reference index
 2) soap or bowtie2
    currently I have bowtie2 running with --fast setting, which seems to be a lot slower than soap. this setting may be changed to --very-fast in the future for mapping BSPP data.
 3) samtools
 4) reads (do not need to copy the reads to the current directory, nor concatenate them)
  1. Master shell script: 1 - perform mapping.
 We need to perform mapping and make sure that all reads mapped properly.
  1. This master script process bisulfite reads.

My_ref="/projects/zhang-lab/ddiep/bisHg19"

  1. Remember to use the correct number of nodes! Don't use too many nodes because this is slow
  2. Remember to set the correct temporary directory for sorting in this script!

bisReadMapper="/home/ddiep/scripts/MethylationPipeline/bisReadMapper_Bowtie2.pl"

for f in list_* do

       g=`echo $f | sed 's/list_//g'`
       /home/ddiep/scripts/MethylationPipeline/wBOWTIE/submitBSPPMapJobs.pl $g $My_ref $bisReadMapper < $f

done

  1. now we need to check that all jobs finished without error.