BSMAP-methatio-methykit workflow

Assumptions- as with most worflows in development - a working directory is used.

In [1]:
#SR edits - adding direct link to ipynb viewer and raw files
!date 
Thu Feb 27 13:25:30 PST 2014

In [2]:
filename='BSMAP2MK_workflow_T3D3'

ipynb viewer format:

In [3]:
!echo 'http://nbviewer.ipython.org/github/sr320/ipython_nb/blob/master/''{filename}''.ipynb'
http://nbviewer.ipython.org/github/sr320/ipython_nb/blob/master/BSMAP2MK_workflow_T3D3.ipynb

ipynb file:

In [4]:
!echo 'http://nbviewer.ipython.org/github/sr320/ipython_nb/blob/master/''{filename}''.ipynb'
http://nbviewer.ipython.org/github/sr320/ipython_nb/blob/master/BSMAP2MK_workflow_T3D3.ipynb

Setting Variables

In [5]:
#file ID
fid="CgLarvT3D3"

#TIMESTAMP
date=!date +%m%d_%H%M
#working directory (parent)
wd="/Volumes/web-1/Mollusk/bs_larvae_exp/"

#where is bsmap
bsmap="/Users/Shared/Apps/bsmap-2.73/"

#fastq files location R1 location
R1="/Volumes/web-1/Mollusk/bs_larvae_exp/Concatenated_Files_R1/T3D3_R1.fastq"

#fastq files location R2 location
#comment out if SE
R2="/Volumes/web-1/Mollusk/bs_larvae_exp/Concatenated_Files_R2/T3D3_R2.fastq"


#genome file 
genome="/Volumes/web-1/whale/ensembl/ftp.ensemblgenomes.org/pub/release-21/metazoa/fasta/crassostrea_gigas/dna/Crassostrea_gigas.GCA_000297895.1.21.dna_sm.genome.fa"
In [6]:
cd {wd}
/Volumes/web-1/Mollusk/bs_larvae_exp

In [7]:
mkdir {fid}_{date}
In [*]:
cd {fid}_{date}
/Volumes/web-1/Mollusk/bs_larvae_exp/CgLarvT3D3_[0227_1325]

In [*]:
#option - number of processes 
!{bsmap}bsmap -a {R1} -b {R2} -d {genome} -o bsmap_out.sam -p 1

BSMAP v2.73
Start at:  Thu Feb 27 13:25:31 2014

Input reference file: /Volumes/web-1/whale/ensembl/ftp.ensemblgenomes.org/pub/release-21/metazoa/fasta/crassostrea_gigas/dna/Crassostrea_gigas.GCA_000297895.1.21.dna_sm.genome.fa 	(format: FASTA)
Load in 7658 db seqs, total size 557717710 bp. 12 secs passed
total_kmers: 43046721
Create seed table. 61 secs passed
max number of mismatches: read_length * 8% 	max gap size: 0
kmer cut-off ratio:5e-07
max multi-hits: 100	max Ns: 5	seed size: 16	index interval: 4
quality cutoff: 0	base quality char: '!'
min fragment size:28	max fragemt size:500
start from read #1	end at read #4294967295
additional alignment: T in reads => C in reference
mapping strand (read_1): ++,-+
mapping strand (read_2): +-,--
Pair-end alignment(1 threads)
Input read file #1: /Volumes/web-1/Mollusk/bs_larvae_exp/Concatenated_Files_R1/T3D3_R1.fastq 	(format: FASTQ)
Input read file #2: /Volumes/web-1/Mollusk/bs_larvae_exp/Concatenated_Files_R2/T3D3_R2.fastq 	(format: FASTQ)
Output file: bsmap_out.sam	 (format: SAM)
Thread #0: 	50000 read pairs finished. 94 secs passed

In [*]:
!python {bsmap}methratio.py -d {genome} -u -z -g -o methratio_out.txt -s {bsmap}samtools bsmap_out.sam

Filter the methratio output file so that I'm only obtaining the context '_CG' and loci with at least 5x coverage

In [*]:
#command for only obtaining the context '__CG_'
!grep "[A-Z][A-Z]CG[A-Z]" <methratio_out.txt> methratio_out_CG.txt
In [*]:
#obtaining a filtered file with at least 5x coverage
!awk '$8 >= 5' <methratio_out_CG.txt> methratio_out_CG5x.txt
In [*]:
#Now I need to format my files to be read into the methylKit package in R
In [*]:
#!/Volumes/web/Mollusk/bs_larvae_exp/methratio.awk.sh methratio_out_CG5x.txt > methratio_out_CG_mkit.txt
In [*]:
#!head methratio_out_CG_mkit.txt
In [*]: