Commit 28cbfd71 authored by Aaron's avatar Aaron
Browse files

fix blocked_intervals merge conflicts

parents 0ac3897a 5184b441
......@@ -61,6 +61,7 @@ UTIL_SUBDIRS = $(SRC_DIR)/utils/lineFileUtilities \
$(SRC_DIR)/utils/tabFile \
$(SRC_DIR)/utils/BamTools \
$(SRC_DIR)/utils/BamTools-Ancillary \
$(SRC_DIR)/utils/BlockedIntervals \
$(SRC_DIR)/utils/Fasta \
$(SRC_DIR)/utils/VectorOps \
$(SRC_DIR)/utils/genomeFile
......
......@@ -15,12 +15,9 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= annotateMain.cpp annotateBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= annotateMain.cpp annotateBed.cpp annotateBed.h
OBJECTS= annotateMain.o annotateBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= annotateBed
all: $(BUILT_OBJECTS)
......@@ -31,14 +28,9 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/annotateMain.o $(OBJ_DIR)/annotateBed.o
.PHONY: clean
......@@ -10,7 +10,7 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
-I$(UTILITIES_DIR)/lineFileUtilities/ \
-I$(UTILITIES_DIR)/fileType/ \
-I$(UTILITIES_DIR)/BamTools/include \
-I$(UTILITIES_DIR)/BamTools-Ancillary \
-I$(UTILITIES_DIR)/BlockedIntervals \
-I$(UTILITIES_DIR)/version/
......@@ -18,11 +18,8 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# define our source and object files
# ----------------------------------
SOURCES= bamToBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=BamAncillary.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
OBJECTS= bamToBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= bamToBed
all: $(BUILT_OBJECTS)
......@@ -33,11 +30,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamAncillary/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/bamToBed.o
.PHONY: clean
......@@ -11,7 +11,7 @@
******************************************************************************/
#include "api/BamReader.h"
#include "api/BamAux.h"
#include "BamAncillary.h"
#include "BlockedIntervals.h"
#include "bedFile.h"
#include "version.h"
using namespace BamTools;
......@@ -289,50 +289,10 @@ void ConvertBamToBedpe(const string &bamFile, const bool &useEditDistance) {
}
void ParseCigarBed12(const vector<CigarOp> &cigar, vector<int> &blockStarts, vector<int> &blockLengths, unsigned int &alignmentEnd) {
int currPosition = 0;
int blockLength = 0;
// Rip through the CIGAR ops and figure out if there is more
// than one block for this alignment
vector<CigarOp>::const_iterator cigItr = cigar.begin();
vector<CigarOp>::const_iterator cigEnd = cigar.end();
for (; cigItr != cigEnd; ++cigItr) {
switch (cigItr->Type) {
case ('M') :
blockLength += cigItr->Length;
currPosition += cigItr->Length;
case ('I') : break;
case ('S') : break;
case ('D') : break;
blockLength += cigItr->Length;
currPosition += cigItr->Length;
case ('P') : break;
case ('N') :
blockStarts.push_back(currPosition + cigItr->Length);
blockLengths.push_back(blockLength);
currPosition += cigItr->Length;
blockLength = 0;
case ('H') : break; // for 'H' - do nothing, move to next op
default :
printf("ERROR: Invalid Cigar op type\n"); // shouldn't get here
exit(1);
}
}
// add the kast block and set the
// alignment end (i.e., relative to the start)
blockLengths.push_back(blockLength);
alignmentEnd = currPosition;
}
string BuildCigarString(const vector<CigarOp> &cigar) {
stringstream cigarString;
for (size_t i = 0; i < cigar.size(); ++i) {
//cerr << cigar[i].Type << " " << cigar[i].Length << endl;
switch (cigar[i].Type) {
case ('M') :
case ('I') :
......@@ -449,16 +409,18 @@ void PrintBed(const BamAlignment &bam, const RefVector &refs, bool useEditDista
// Report each chunk of the BAM alignment as a discrete BED entry
// For example 10M100N10M would be reported as two seprate BED entries of length 10
else {
// parse the CIGAR string and figure out the alignment blocks
vector<BED> bedBlocks;
// Load the alignment blocks in bam into the bedBlocks vector.
// Don't trigger a new block when a "D" (deletion) CIGAR op is found.
getBamBlocks(bam, refs, bedBlocks, false);
vector<BED>::const_iterator bedItr = bedBlocks.begin();
vector<BED>::const_iterator bedEnd = bedBlocks.end();
for (; bedItr != bedEnd; ++bedItr) {
printf("%s\t%d\t%d\t\%s\t%d\t%s\n", refs.at(bam.RefID).RefName.c_str(), bedItr->start,
bedItr->end, name.c_str(), bam.MapQuality, strand.c_str());
string chrom = refs.at(bam.RefID).RefName;
// extract the block starts and lengths from the CIGAR string
GetBamBlocks(bam, chrom, bedBlocks);
unsigned int i;
for (i = 0; i < bedBlocks.size(); ++i) {
BED curr = bedBlocks[i];
printf("%s\t%d\t%d\t\%s\t%d\t%s\n",
chrom.c_str(), curr.start, curr.end,
name.c_str(), bam.MapQuality, strand.c_str());
}
}
}
......@@ -476,14 +438,11 @@ void PrintBed12(const BamAlignment &bam, const RefVector &refs, bool useEditDist
if (bam.IsSecondMate()) name += "/2";
// parse the CIGAR string and figure out the alignment blocks
unsigned int alignmentEnd;
vector<int> blockLengths;
vector<int> blockStarts;
blockStarts.push_back(0);
vector<BED> bedBlocks;
string chrom = refs.at(bam.RefID).RefName;
CHRPOS alignmentEnd = bam.GetEndPosition();
// extract the block starts and lengths from the CIGAR string
ParseCigarBed12(bam.CigarData, blockStarts, blockLengths, alignmentEnd);
alignmentEnd += bam.Position;
GetBamBlocks(bam, chrom, bedBlocks);
// write BED6 portion
if (useEditDistance == false && bamTag == "") {
......@@ -514,20 +473,20 @@ void PrintBed12(const BamAlignment &bam, const RefVector &refs, bool useEditDist
}
// write the colors, etc.
printf("%d\t%d\t%s\t%d\t", bam.Position, alignmentEnd, color.c_str(), (int) blockStarts.size());
printf("%d\t%d\t%s\t%d\t", bam.Position, alignmentEnd, color.c_str(), (int) bedBlocks.size());
// now write the lengths portion
unsigned int b;
for (b = 0; b < blockLengths.size() - 1; ++b) {
printf("%d,", blockLengths[b]);
for (b = 0; b < bedBlocks.size() - 1; ++b) {
printf("%d,", bedBlocks[b].end - bedBlocks[b].start);
}
printf("%d\t", blockLengths[b]);
printf("%d\t", bedBlocks[b].end - bedBlocks[b].start);
// now write the starts portion
for (b = 0; b < blockStarts.size() - 1; ++b) {
printf("%d,", blockStarts[b]);
for (b = 0; b < bedBlocks.size() - 1; ++b) {
printf("%d,", bedBlocks[b].start - bam.Position);
}
printf("%d\n", blockStarts[b]);
printf("%d\n", bedBlocks[b].start - bam.Position);
}
......
......@@ -9,17 +9,16 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
-I$(UTILITIES_DIR)/lineFileUtilities/ \
-I$(UTILITIES_DIR)/gzstream/ \
-I$(UTILITIES_DIR)/fileType/ \
-I$(UTILITIES_DIR)/BamTools/include \
-I$(UTILITIES_DIR)/BlockedIntervals \
-I$(UTILITIES_DIR)/version/
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= bed12ToBed6.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
OBJECTS= bed12ToBed6.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= bed12ToBed6
all: $(BUILT_OBJECTS)
......@@ -30,14 +29,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/bed12ToBed6.o
.PHONY: clean
......@@ -10,6 +10,7 @@
Licenced under the GNU General Public License 2.0 license.
******************************************************************************/
#include "lineFileUtilities.h"
#include "BlockedIntervals.h"
#include "bedFile.h"
#include "version.h"
#include <vector>
......@@ -140,7 +141,7 @@ void ProcessBed(istream &bedInput, BedFile *bed) {
if (bed->_status == BED_VALID) {
bedVector bedBlocks; // vec to store the discrete BED "blocks" from a
splitBedIntoBlocks(bedEntry, bedBlocks);
GetBedBlocks(bedEntry, bedBlocks);
for (int i = 0; i < (int) bedBlocks.size(); ++i) {
if (addBlockNums == false) {
......
......@@ -19,9 +19,7 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# define our source and object files
# ----------------------------------
SOURCES= bedToBam.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o genomeFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
OBJECTS= bedToBam.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= bedToBam
......@@ -34,16 +32,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/genomeFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/bedToBam.o
.PHONY: clean
......@@ -17,9 +17,7 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# define our source and object files
# ----------------------------------
SOURCES= bedToIgv.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o genomeFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
OBJECTS= bedToIgv.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= bedToIgv
......@@ -32,15 +30,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/genomeFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/bedToIgv.o
.PHONY: clean
......@@ -13,12 +13,9 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= closestMain.cpp closestBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= closestMain.cpp closestBed.cpp closestBed.h
OBJECTS= closestMain.o closestBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= closestBed
all: $(BUILT_OBJECTS)
......@@ -28,14 +25,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/closestMain.o $(OBJ_DIR)/closestBed.o
.PHONY: clean
......@@ -14,10 +14,8 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= clusterMain.cpp clusterBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= clusterMain.cpp clusterBed.cpp clusterBed.h
OBJECTS= clusterMain.o clusterBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
......@@ -29,15 +27,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/clusterMain.o $(OBJ_DIR)/clusterBed.o
.PHONY: clean
\ No newline at end of file
......@@ -16,10 +16,8 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= complementMain.cpp complementBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o genomeFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= complementMain.cpp complementBed.cpp complementBed.h
OBJECTS= complementMain.o complementBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= complementBed
......@@ -32,15 +30,9 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/genomeFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/complementMain.o $(OBJ_DIR)/complementBed.o
.PHONY: clean
......@@ -11,18 +11,14 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
-I$(UTILITIES_DIR)/lineFileUtilities/ \
-I$(UTILITIES_DIR)/fileType/ \
-I$(UTILITIES_DIR)/BamTools/include \
-I$(UTILITIES_DIR)/BamTools-Ancillary \
-I$(UTILITIES_DIR)/BlockedIntervals \
-I$(UTILITIES_DIR)/version/
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= coverageMain.cpp coverageBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o lineFileUtilities.o gzstream.o fileType.o BamAncillary.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= coverageMain.cpp coverageBed.cpp coverageBed.h
OBJECTS= coverageMain.o coverageBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= coverageBed
all: $(BUILT_OBJECTS)
......@@ -32,16 +28,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools-Ancillary/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/coverageMain.o $(OBJ_DIR)/coverageBed.o
.PHONY: clean
......@@ -62,7 +62,7 @@ void BedCoverage::CollectCoverageBed() {
// split the BED into discrete blocksand process each independently.
else {
bedVector bedBlocks;
splitBedIntoBlocks(a, bedBlocks);
GetBedBlocks(a, bedBlocks);
// use countSplitHits to avoid over-counting each split chunk
// as distinct read coverage.
_bedB->countSplitHits(bedBlocks, _sameStrand, _diffStrand, _countsOnly);
......@@ -117,7 +117,7 @@ void BedCoverage::CollectCoverageBam(string bamFile) {
bedVector bedBlocks;
// since we are counting coverage, we do want to split blocks when a
// deletion (D) CIGAR op is encountered (hence the true for the last parm)
getBamBlocks(bam, refs, bedBlocks, true);
GetBamBlocks(bam, refs.at(bam.RefID).RefName, bedBlocks, true);
// use countSplitHits to avoid over-counting each split chunk
// as distinct read coverage.
_bedB->countSplitHits(bedBlocks, _sameStrand, _diffStrand, _countsOnly);
......
......@@ -16,7 +16,7 @@
#include "api/BamReader.h"
#include "api/BamAux.h"
#include "BamAncillary.h"
#include "BlockedIntervals.h"
using namespace BamTools;
#include <vector>
......
......@@ -17,12 +17,9 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= fastaFromBedMain.cpp fastaFromBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o sequenceUtils.o lineFileUtilities.o gzstream.o fileType.o Fasta.o split.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= fastaFromBedMain.cpp fastaFromBed.cpp fastaFromBed.h
OBJECTS= fastaFromBedMain.o fastaFromBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= fastaFromBed
all: $(BUILT_OBJECTS)
......@@ -33,16 +30,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/sequenceUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/Fasta/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/fastaFromBedMain.o $(OBJ_DIR)/fastaFromBed.o
.PHONY: clean
\ No newline at end of file
......@@ -16,13 +16,9 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= flankBedMain.cpp flankBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o genomeFile.o lineFileUtilities.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= flankBedMain.cpp flankBed.cpp flankBed.h
OBJECTS= flankBedMain.o flankBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= flankBed
all: $(BUILT_OBJECTS)
......@@ -31,16 +27,9 @@ all: $(BUILT_OBJECTS)
$(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/genomeFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/flankBedMain.o $(OBJ_DIR)/flankBed.o
.PHONY: clean
......@@ -11,17 +11,14 @@ INCLUDES = -I$(UTILITIES_DIR)/bedFile/ \
-I$(UTILITIES_DIR)/lineFileUtilities/ \
-I$(UTILITIES_DIR)/fileType/ \
-I$(UTILITIES_DIR)/BamTools/include \
-I$(UTILITIES_DIR)/BamTools-Ancillary \
-I$(UTILITIES_DIR)/BlockedIntervals \
-I$(UTILITIES_DIR)/version/
# ----------------------------------
# define our source and object files
# ----------------------------------
SOURCES= genomeCoverageMain.cpp genomeCoverageBed.cpp
OBJECTS= $(SOURCES:.cpp=.o)
_EXT_OBJECTS=bedFile.o genomeFile.o lineFileUtilities.o BamAncillary.o gzstream.o fileType.o
EXT_OBJECTS=$(patsubst %,$(OBJ_DIR)/%,$(_EXT_OBJECTS))
SOURCES= genomeCoverageMain.cpp genomeCoverageBed.cpp genomeCoverageBed.h
OBJECTS= genomeCoverageMain.o genomeCoverageBed.o
BUILT_OBJECTS= $(patsubst %,$(OBJ_DIR)/%,$(OBJECTS))
PROGRAM= genomeCoverageBed
all: $(BUILT_OBJECTS)
......@@ -32,17 +29,8 @@ $(BUILT_OBJECTS): $(SOURCES)
@echo " * compiling" $(*F).cpp
@$(CXX) -c -o $@ $(*F).cpp $(LDFLAGS) $(CXXFLAGS) $(INCLUDES)
$(EXT_OBJECTS):
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/lineFileUtilities/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/bedFile/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/genomeFile
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/BamTools-Ancillary/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/gzstream/
@$(MAKE) --no-print-directory -C $(UTILITIES_DIR)/fileType/
clean:
@echo "Cleaning up."
@rm -f $(OBJ_DIR)/* $(BIN_DIR)/*
@rm -f $(OBJ_DIR)/genomeCoverageMain.o $(OBJ_DIR)/genomeCoverageBed.o
.PHONY: clean
......@@ -172,7 +172,7 @@ void BedGenomeCoverage::CoverageBed() {
if (_obeySplits == true) {
bedVector bedBlocks; // vec to store the discrete BED "blocks"
splitBedIntoBlocks(a, bedBlocks);
GetBedBlocks(a, bedBlocks);
AddBlockedCoverage(bedBlocks);
}
else if (_only_5p_end) {
......@@ -247,7 +247,7 @@ void BedGenomeCoverage::CoverageBam(string bamFile) {
bedVector bedBlocks;
// since we are counting coverage, we do want to split blocks when a
// deletion (D) CIGAR op is encountered (hence the true for the last parm)
getBamBlocks(bam, refs, bedBlocks, true);
GetBamBlocks(bam, refs.at(bam.RefID).RefName, bedBlocks, true);
AddBlockedCoverage(bedBlocks);
}
else if (_only_5p_end) {
......
......@@ -12,7 +12,7 @@ Licenced under the GNU General Public License 2.0 license.
#include "bedFile.h"
#include "genomeFile.h"
#include "B<