Skip to content
Snippets Groups Projects
Commit 6ae90161 authored by arq5x's avatar arq5x
Browse files

update NewChromSweep signature to support fisher. May have conflicts with...

update NewChromSweep signature to support fisher. May have conflicts with @nkindlon's upcoming changes. Will resolve then.
parent 205db6a6
No related branches found
No related tags found
No related merge requests found
......@@ -11,3 +11,4 @@ src/utils/version/version_git.h
.project
.cproject
nbproject
sandbox
......@@ -12,8 +12,6 @@
#ifndef NEW_CHROMSWEEP_H
#define NEW_CHROMSWEEP_H
using namespace std;
#include <string>
#include "BTlist.h"
#include "RecordKeyList.h"
......@@ -31,7 +29,7 @@ class ContextIntersect;
class NewChromSweep {
public:
NewChromSweep(ContextIntersect *context);
NewChromSweep(ContextIntersect *context, bool useMergedIntervals = false);
~NewChromSweep(void);
......@@ -60,7 +58,9 @@ protected:
int _numDBs; //don't really need this stored, but here for code brevity.
vector<FileRecordMgr *> _dbFRMs;
unsigned long _queryRecordsTotalLength;
bool _useMergedIntervals;
unsigned long _queryRecordsTotalLength;
vector<unsigned long> _dbFileRecordsLength; //each value in this vector have the
//length of all records in the corresponding db file.
......
chr1 10 20
chr1 30 40
chr1 51 52
chr1 15 25
chr1 51 52
chr1 500
chr1 60
BT=${BT-../../bin/bedtools}
check()
{
if diff $1 $2; then
echo ok
return 1
else
echo fail
return 0
fi
}
echo " fisher.t1...\c"
echo \
"# Number of query intervals: 3
# Number of db intervals: 2
# Number of overlaps: 2
# Number of possible intervals (estimated): 34
# phyper(2 - 1, 3, 34 - 3, 2, lower.tail=F)
# Contingency Table Of Counts
#_________________________________________
# | in -b | not in -b |
# in -a | 2 | 1 |
# not in -a | 0 | 31 |
#_________________________________________
# p-values for fisher's exact test
left right two-tail ratio
1 0.0053476 0.0053476 inf" > exp
$BT fisher -a a.bed -b b.bed -g t.500.genome > obs
check obs exp
rm obs exp
echo " fisher.t2...\c"
echo \
"# Number of query intervals: 3
# Number of db intervals: 2
# Number of overlaps: 2
# Number of possible intervals (estimated): 4
# phyper(2 - 1, 3, 4 - 3, 2, lower.tail=F)
# Contingency Table Of Counts
#_________________________________________
# | in -b | not in -b |
# in -a | 2 | 1 |
# not in -a | 0 | 1 |
#_________________________________________
# p-values for fisher's exact test
left right two-tail ratio
1 0.5 1 inf" > exp
$BT fisher -a a.bed -b b.bed -g t.60.genome > obs
check obs exp
rm obs exp
......@@ -22,6 +22,9 @@ cd expand; bash test-expand.sh; cd ..
echo " Testing bedtools flank:"
cd flank; bash test-flank.sh; cd ..
echo " Testing bedtools fisher:"
cd fisher; bash test-fisher.sh; cd ..
echo " Testing bedtools genomecov:"
cd genomecov; bash test-genomecov.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