Skip to content
Snippets Groups Projects
Commit 5a218193 authored by Aaron's avatar Aaron
Browse files

[NEW] Added new "reldist" tool to measure the distribution of relative distances between two files

parent 8696c988
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,7 @@ SUBDIRS = $(SRC_DIR)/annotateBed \
$(SRC_DIR)/pairToBed \
$(SRC_DIR)/pairToPair \
$(SRC_DIR)/randomBed \
$(SRC_DIR)/reldist \
$(SRC_DIR)/shuffleBed \
$(SRC_DIR)/slopBed \
$(SRC_DIR)/sortBed \
......
File added
This diff is collapsed.
......@@ -63,6 +63,7 @@ int nuc_main(int argc, char* argv[]);//
int pairtobed_main(int argc, char* argv[]);//
int pairtopair_main(int argc, char* argv[]);//
int random_main(int argc, char* argv[]); //
int reldist_main(int argc, char* argv[]); //
int shuffle_main(int argc, char* argv[]); //
int slop_main(int argc, char* argv[]); //
int sort_main(int argc, char* argv[]); //
......@@ -126,6 +127,7 @@ int main(int argc, char *argv[])
// statistics tools
else if (sub_cmd == "jaccard") return jaccard_main(argc-1, argv+1);
else if (sub_cmd == "reldist") return reldist_main(argc-1, argv+1);
// misc. tools
else if (sub_cmd == "overlap") return getoverlap_main(argc-1, argv+1);
......@@ -230,8 +232,9 @@ int bedtools_help(void)
cout << " tag " << "Tag BAM alignments based on overlaps with interval files.\n";
cout << endl;
cout << "[ Statistics tools ]" << endl;
cout << " jaccard " << "Calculates the Jaccard statistic b/w two sets of intervals.\n";
cout << "[ Statistical relationships ]" << endl;
cout << " jaccard " << "Calculate the Jaccard statistic b/w two sets of intervals.\n";
cout << " reldist " << "Calculate the distribution of relative distances b/w two files.\n";
cout << endl;
cout << "[ Miscellaneous tools ]" << endl;
......
BT=${BT-../../bin/bedtools}
check()
{
if diff $1 $2; then
echo ok
else
echo fail
fi
}
###########################################################
# Test a basic self intersection. The relative distances
# should all be 0 in this case.
############################################################
echo " reldist.t01...\c"
echo \
"reldist count total fraction
0.00 420889 420889 1.000" > exp
$BT reldist -a ../../data/refseq.hg19.exons.bed.gz \
-b ../../data/refseq.hg19.exons.bed.gz > obs
check obs exp
rm obs exp
###########################################################
# Test intervaks that are randomly distributed.
# The relative distances should equally represented .
############################################################
echo " reldist.t02...\c"
echo \
"reldist count total fraction
0.00 1930 420584 0.005
0.01 4937 420584 0.012
0.02 6021 420584 0.014
0.03 6774 420584 0.016
0.04 7403 420584 0.018
0.05 7152 420584 0.017
0.06 7824 420584 0.019
0.07 7818 420584 0.019
0.08 7679 420584 0.018
0.09 8275 420584 0.020
0.10 7886 420584 0.019
0.11 8308 420584 0.020
0.12 8335 420584 0.020
0.13 8532 420584 0.020
0.14 8486 420584 0.020
0.15 8335 420584 0.020
0.16 8207 420584 0.020
0.17 8674 420584 0.021
0.18 8541 420584 0.020
0.19 8795 420584 0.021
0.20 8718 420584 0.021
0.21 8731 420584 0.021
0.22 8464 420584 0.020
0.23 8627 420584 0.021
0.24 8766 420584 0.021
0.25 8927 420584 0.021
0.26 8860 420584 0.021
0.27 8876 420584 0.021
0.28 9285 420584 0.022
0.29 8882 420584 0.021
0.30 9092 420584 0.022
0.31 8882 420584 0.021
0.32 8887 420584 0.021
0.33 9296 420584 0.022
0.34 8895 420584 0.021
0.35 8964 420584 0.021
0.36 9106 420584 0.022
0.37 9377 420584 0.022
0.38 9199 420584 0.022
0.39 9240 420584 0.022
0.40 9268 420584 0.022
0.41 9443 420584 0.022
0.42 9541 420584 0.023
0.43 9287 420584 0.022
0.44 8998 420584 0.021
0.45 9238 420584 0.022
0.46 8892 420584 0.021
0.47 8859 420584 0.021
0.48 9033 420584 0.021
0.49 9028 420584 0.021
0.50 11 420584 0.000" > exp
$BT reldist -a ../../data/refseq.hg19.exons.bed.gz \
-b ../../data/aluY.hg19.bed.gz > obs
check obs exp
rm obs exp
###########################################################
# Test intervaks that are consistently closer to one another
# than expected. The distances should be biased towards 0.=
############################################################
echo " reldist.t03...\c"
echo \
"reldist count total fraction
0.00 156776 396736 0.395
0.01 33579 396736 0.085
0.02 17808 396736 0.045
0.03 11826 396736 0.030
0.04 8961 396736 0.023
0.05 7302 396736 0.018
0.06 5994 396736 0.015
0.07 5357 396736 0.014
0.08 5032 396736 0.013
0.09 4415 396736 0.011
0.10 4411 396736 0.011
0.11 4062 396736 0.010
0.12 3741 396736 0.009
0.13 3760 396736 0.009
0.14 3501 396736 0.009
0.15 3394 396736 0.009
0.16 3539 396736 0.009
0.17 3442 396736 0.009
0.18 3500 396736 0.009
0.19 3072 396736 0.008
0.20 3713 396736 0.009
0.21 3249 396736 0.008
0.22 3328 396736 0.008
0.23 3271 396736 0.008
0.24 3017 396736 0.008
0.25 3756 396736 0.009
0.26 3242 396736 0.008
0.27 3057 396736 0.008
0.28 3519 396736 0.009
0.29 3222 396736 0.008
0.30 3529 396736 0.009
0.31 3284 396736 0.008
0.32 3387 396736 0.009
0.33 3231 396736 0.008
0.34 3263 396736 0.008
0.35 3421 396736 0.009
0.36 3529 396736 0.009
0.37 3376 396736 0.009
0.38 3414 396736 0.009
0.39 3183 396736 0.008
0.40 3855 396736 0.010
0.41 3402 396736 0.009
0.42 3803 396736 0.010
0.43 3458 396736 0.009
0.44 3594 396736 0.009
0.45 3654 396736 0.009
0.46 3489 396736 0.009
0.47 3394 396736 0.009
0.48 3862 396736 0.010
0.49 2957 396736 0.007
0.50 805 396736 0.002" > exp
$BT reldist -a ../../data/refseq.hg19.exons.bed.gz \
-b ../../data/29way_pi.conservation.hg19.bed.gz > obs
check obs exp
rm obs exp
\ No newline at end of file
......@@ -43,6 +43,9 @@ cd merge; sh test-merge.sh; cd ..
echo " Testing bedtools multicov:"
cd multicov; sh test-multicov.sh; cd ..
echo " Testing bedtools reldist:"
cd reldist; sh test-reldist.sh; cd ..
echo " Testing bedtools slop:"
cd slop; sh test-slop.sh; cd ..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment