CmhaDSO bedtools

使用例

###### cheetsheet

# Input List:
BAM
BED
GCF
VDF

# SUBCMD List
annotate
bamtobed
bamtofastq
bedtobam
bedpetobam
bed12tobed6
closest
cluster
complement
coverage
flank
genomecov
getfasta
groupby
intersect
jaccard
makewindows
map
maskfasta
merge
multicov
nuc
random
reldist
shift
shuffle
slop
sort
substract
unionbedg
window

# Common flags:
-s: same strandedness
-S: opposite starandedness
-f: minimum overlap required as a fraction of A
-F: minimum overlap required as a fraction of B
-r: minimum overlap to be satisfied for A AND B
-e: minimum overlap to be satisfied for A OR B
-split: treat "split" BAM or BED12 entries as distinct BED intervals
-abam: A is a BAM file

# General:
bedtools flank [OPT] -i  -g  [-b or (-l and -r)]
bedtools slop [OPT] -i  -g  [-b or (-l and -r)]
bedtools shift [OPT] -i  -g  [-s or (-m and -p)]
bedtools subtract [OPT] -a  -b 
bedtools complement -i  -g 
bedtools closest [OPT] -a  -b 
bedtools intersect [OPT] -a  -b 
bedtools window [OPT] [-a|-abam] -b 
bedtools cluster [OPT] -i 
bedtools merge [OPT] -i 
bedtools map [OPT] -a  -b 
bedtools groupby [OPT] -i  -g  -c  -o 

# Formatting:
bedtools getfasta [OPT] -fi  -bed 
bedtools maskfasta [OPT] -fi  -bed  -fo 
bedtools sort [OPT] -i 
bedtools bed12tobed6 
bedtools bamtofastq
bedtools bamtobed
bedtools bedpetobam
bedtools bedtobam

# Statistics:
bedtools jaccard [OPT] -a  -b 
bedtools random [OPT] -g 
bedtools reldist [OPT] -a  -b 
bedtools shuffle [OPT] -i  -g 
bedtools makewindows [OPT] [-g |-b ] [-w |-n ]
bedtools nuc 

# Coverage:
bedtools annotate [OPT] -i  -files FILES
bedtools coverage [OPT] -a  -b 
bedtools genomecov
bedtools multicov
bedtools unionbedg


###############
USAGE: bedtools intersect [OPT] -a A -b Bs
INPUT: A|Bs|stdin|-
OPT: -a
OPT: -b
OPT: -ubam
OPT: -bed
OPT: -wa
OPT: -wb
OPT: -loj
OPT: -wo
OPT: -wao
OPT: -u
OPT: -c
OPT: -C
OPT: -v
OPT: -sorted
OPT: -g
OPT: -header
OPT: -names
OPT: -filenames
OPT: -sortout
OPT: -nobuf
OPT: -iobuf

OPT: -abam
OPT: -f
OPT: -F
OPT: -r
OPT: -e
OPT: -s
OPT: -S
OPT: -split

bedtools intersect -a A -b B
bedtools intersect -a A -b B -loj
bedtools intersect -a A -b B -wa
bedtools intersect -a A -b B -wa -wb
bedtools intersect -a A -b B -wo
bedtools intersect -a A -b B -u
bedtools intersect -a A -b B -c
bedtools intersect -a A -b B -v
bedtools intersect -a A -b B -f 0.5

bedtools intersect -a A -b B1 B2 B3 -wa -wb
bedtools intersect -a A -b B1 B2 B3 -wa -wb -names l1 l2 l3 
bedtools intersect -a A -b B1 B2 B3 -wa -wb -filenames 

###############
USAGE: bedtools window [OPT] -a|-abam A -b B
INPUT: A|B|stdin|-
OPT: -ubam
OPT: -bed
OPT: -w
OPT: -l
OPT: -r
OPT: -sw
OPT: -u
OPT: -c
OPT: -v
OPT: -header

OPT: -abam
OPT: -sm
OPT: -Sm

bedtools window -a A -b B -w 
bedtools window -a A -b B -l  -r 
bedtools window -a A -b B -l  -r  -sw
bedtools window -a A -b B -w  -sm 
bedtools window -a A -b B -w  -Sm
#################
USAGE: bedtools merge [OPT] -i 
OPT: -s
OPT: -S <+|->
OPT: -d 
OPT: -header
OPT: -delim

OPT: -c
OPT: -o 
OPT: -o 

bedtools merge -i A
bedtools merge -i A -d 
bedtools merge -i A -s
bedtools merge -i A -S +
bedtools merge -i A -c 1 -o count
bedtools merge -i A -c 4 -o collapse
bedtools merge -i A -c 4 -o collapse -delim "|"
bedtools merge -i A -c 6 -o distinct