Changes between Version 1 and Version 2 of SOPs/coordinates


Ignore:
Timestamp:
12/18/14 15:46:57 (10 years ago)
Author:
byuan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/coordinates

    v1 v2  
    151151}
    152152 }}}
     153
    153154=== Convert blat to gff ===
    154155
    155156  * Use /nfs/BaRC_Public/BaRC_code/Perl/blat2gff/blat2gff.pl
     157
    156158 
    157159 {{{
    158160   Convert BLAT output file (PSL format) into GFF format (v1.1 14 Dec 2010)
    159161    blat2gff.pl blatFile dataSource(ex:WIBR) > gffFile
    160 }}
     162}}}
     163
     164
     165=== create wiggle files for visualizing paired-end data mapping to the + and - strands ===
     166
     1671. split by strand by matched strand
     168
     169{{{
     170# input:        accepted_hits.bam
     171# output:       accepted_hits_negStrand.bam: mapped to negative strand
     172#               accepted_hits_posStrand.bam: mapped to positive strand
     173
     174bsub "samtools view -f 16 -b accepted_hits.bam >| accepted_hits_negStrand.bam"
     175bsub "samtools view -F 16 -b accepted_hits.bam >| accepted_hits_posStrand.bam"
     176
     177}}}
     178
     1792. split reads by pair
     180{{{
     181# input:        accepted_hits_posStrand.bam or accepted_hits_negStrand.bam
     182# output:       1st pair: *_1stPair.bam
     183#                       2nd pair: *_2ndPair.bam
     184bsub "samtools view -b -f 0x0040 accepted_hits_posStrand.bam > accepted_hits_posStrand_1stPair.bam"
     185bsub "samtools view -b -F 0x0040 accepted_hits_posStrand.bam > accepted_hits_posStrand_2ndPair.bam"
     186bsub "samtools view -b -f 0x0040 accepted_hits_negStrand.bam > accepted_hits_negStrand_1stPair.bam"
     187bsub "samtools view -b -F 0x0040 accepted_hits_negStrand.bam > accepted_hits_negStrand_2ndPair.bam"
     188}}}
     189
     1903. convert from bam to bedgraph format
     191{{{
     192# input:        bam format: accepted_hits_*Strand_*Pair.bam
     193#                       /nfs/genomes/mouse_gp_jul_07/anno/mm9.size: length of each chromosome, format like
     194#                                   chr1    197195432
     195# output:       bedgraph format: accepted_hits_*Strand_*Pair.bedgraph
     196bsub "genomeCoverageBed -split -bg -ibam accepted_hits_posStrand_1stPair.bam -g mm9.size >| accepted_hits_posStrand_1stPair.bedgraph"
     197bsub "genomeCoverageBed -split -bg -ibam accepted_hits_posStrand_2ndPair.bam -g mm9.size >| accepted_hits_posStrand_2ndPair.bedgraph"
     198bsub "genomeCoverageBed -split -bg -ibam accepted_hits_negStrand_1stPair.bam -g mm9.size >| accepted_hits_negStrand_1stPair.bedgraph"
     199bsub "genomeCoverageBed -split -bg -ibam accepted_hits_negStrand_2ndPair.bam -g mm9.size >| accepted_hits_negStrand_2ndPair.bedgraph"
     200}}}
     201
     2024. join the reads sharing the same strand
     203{{{
     204# This step is for fr-firststrand library (such as dUTP). which is
     205    1+-,1-+,2++,2--
     206
     207    read1 mapped to ‘+’ strand indicates parental gene on ‘-‘ strand
     208    read1 mapped to ‘-‘ strand indicates parental gene on ‘+’ strand
     209    read2 mapped to ‘+’ strand indicates parental gene on ‘+’ strand
     210    read2 mapped to ‘-‘ strand indicates parental gene on ‘-‘ strand
     211 
     212# input:        bedgraph file from the same strand
     213# output:       merged bedgraph: pos.bedgraph or neg.bedgraph
     214unionBedGraphs -i accepted_hits_posStrand_2ndPair.bedgraph accepted_hits_negStrand_1stPair.bedgraph |awk '{ print $1"\t"$2"\t"$3"\t"$4+$5 }' >|pos.bedgraph
     215unionBedGraphs -i accepted_hits_posStrand_1stPair.bedgraph accepted_hits_negStrand_2ndPair.bedgraph |awk '{ print $1"\t"$2"\t"$3"\t-"$4+$5 }' >|neg.bedgraph
     216}}}
     217
     218  * To check how reads were stranded for strand-specific RNA-seq data, you can use infer_experiment.py from  [http://rseqc.sourceforge.net/ RSeQC]
     219
     220{{{
     221infer_experiment.py -r mm9.refseq.bed12 -i accepted_hits.bam
     222}}}
     223
     2245. convert bedgraph to bigwig
     225
     226{{{
     227# get rid of header lines of mm9.size: the header line with "chrom   size" is removed
     228# input:        mm9.size: length of each chromosome
     229# output:       mm9.size_noHeader
     230tail --line=+2 mm9.size > mm9.size_noHeader
     231# convert bedgraph to bigwig
     232# input:        bedgraph file: neg.bedgraph or pos.bedgraph
     233#                       mm9.size_noHeader: length of each chromosome
     234# *output:      bigwig format: neg.bw or pos.bw
     235#                       neg.bw or pos.bw can be visualized with IGV/UCSC genome browser
     236bsub bedGraphToBigWig neg.bedgraph mm9.size_noHeader neg.bw
     237bsub bedGraphToBigWig pos.bedgraph mm9.size_noHeader pos.bw
     238}}}