~ubuntu-branches/ubuntu/raring/bedtools/raring

« back to all changes in this revision

Viewing changes to docs/content/slopBed.rst

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2012-11-04 17:59:41 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20121104175941-hahqzy1w8uy650z0
Tags: 2.17.0-1
bb9012e Imported Upstream version 2.16.2.
9006b23 Imported Upstream version 2.17.0.
9112569 Documented BEDTools license as a whole.
325689c Removed Pre-Depends: dpkg (>= 1.15.6).
a781b14 Conforms with Policy 3.9.4.
84b1167 Use Debhelper 9. 
0bf572d Distribute the test suite.
422cd34 Bash completion for BEDTools.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###############
 
2
5.14 slopBed
 
3
###############
 
4
**slopBed** will increase the size of each feature in a feature file be a user-defined number of bases. While
 
5
something like this could be done with an "**awk '{OFS="\t" print $1,$2-<slop>,$3+<slop>}'**",
 
6
**slopBed** will restrict the resizing to the size of the chromosome (i.e. no start < 0 and no end >
 
7
chromosome size).
 
8
 
 
9
 
 
10
==========================================================================
 
11
5.14.1 Usage and option summary
 
12
==========================================================================
 
13
Usage:
 
14
::
 
15
  slopBed [OPTIONS] -i <BED/GFF/VCF> -g <GENOME> [-b or (-l and -r)]
 
16
  
 
17
===========================      ===============================================================================================================================================================================================================
 
18
 Option                           Description
 
19
===========================      ===============================================================================================================================================================================================================
 
20
**-b**                                       Increase the BED/GFF/VCF entry by the same number base pairs in each direction. *Integer*.                                                  
 
21
**-l**                                           The number of base pairs to subtract from the start coordinate. *Integer*.
 
22
**-r**                           The number of base pairs to add to the end coordinate. *Integer*.
 
23
**-s**                           Define -l and -r based on strand. For example. if used, -l 500 for a negative-stranded feature, it will add 500 bp to the *end* coordinate.
 
24
===========================      ===============================================================================================================================================================================================================
 
25
 
 
26
 
 
27
 
 
28
==========================================================================
 
29
5.14.2 Default behavior
 
30
==========================================================================
 
31
By default, **slopBed** will either add a fixed number of bases in each direction (**-b**) or an asymmetric
 
32
number of bases in each direction (**-l** and **-r**).
 
33
 
 
34
For example:
 
35
::
 
36
  cat A.bed
 
37
  chr1 5 100
 
38
  chr1 800 980
 
39
 
 
40
  cat my.genome
 
41
  chr1 1000
 
42
 
 
43
  slopBed -i A.bed -g my.genome -b 5
 
44
  chr1 0 105
 
45
  chr1 795 985
 
46
 
 
47
  slopBed -i A.bed -g my.genome -l 2 -r 3
 
48
  chr1 3 103
 
49
  chr1 798 983
 
50
  
 
51
 
 
52
However, if the requested number of bases exceeds the boundaries of the chromosome, **slopBed** will
 
53
"clip" the feature accordingly.
 
54
::
 
55
  cat A.bed
 
56
  chr1  5   100
 
57
  chr1  800 980
 
58
 
 
59
  cat my.genome
 
60
  chr1  1000
 
61
 
 
62
  slopBed -i A.bed -g my.genome -b 5000
 
63
  chr1  0   1000
 
64
  chr1  0   1000
 
65
 
 
66
  
 
67
  
 
68
==========================================================================
 
69
5.14.3 Resizing features according to strand
 
70
==========================================================================
 
71
**slopBed** will optionally increase the size of a feature based on strand.
 
72
 
 
73
For example:
 
74
::
 
75
  cat A.bed
 
76
  chr1 100 200 a1 1 +
 
77
  chr1 100 200 a2 2 -
 
78
 
 
79
  cat my.genome
 
80
  chr1 1000
 
81
 
 
82
  slopBed  -i A.bed -g my.genome -l 50 -r 80 -s
 
83
  chr1 50  280 a1 1 +
 
84
  chr1 20  250 a2 2 -