Skip to content

Commit

Permalink
Fixed previous workaround for non-overlapping peaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jenzopr committed Jan 21, 2015
1 parent f6add89 commit e6c8f5d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bedAnnotator.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ if( opt$strategy == 'overlap' ) {
#ovl_data = findOverlappingPeaks(peaks, annotation, maxgap=opt$maxgap, select=opt$select_strategy, annotate=1, NameOfPeaks1="peaks", NameOfPeaks2="annotation")
#printOverlap(ovl_data$OverlappingPeaks, annotationFormat, 'overlap-nonbi', opt$omit_full_annotation)
ovl = annotatePeakInBatch(peaks, AnnotationData = annotation, output = 'overlapping', maxgap = opt$maxgap, select=opt$select_strategy, FeatureLocForDistance = opt$featurelocation)
if ( all(ovl == peaks) ) {
cat(paste("No overlapping peaks found.."),file=stderr())
q(status=2)
if ( ncol(ovl) == ncol(peaks) ) {
if ( all(ovl == peaks) ) {
cat(paste("No overlapping peaks found.."),file=stderr())
q(status=2)
}
}
printOverlap(ovl, annotationFormat, opt$omit_full_annotation)
} else {
Expand All @@ -195,9 +197,11 @@ if( opt$strategy == 'overlap' ) {
} else {
if ( opt$strategy == 'nearest' ) {
ovl = annotatePeakInBatch(peaks, AnnotationData = annotation, output = 'nearestStart', select=opt$select_strategy, PeakLocForDistance = opt$peaklocation, FeatureLocForDistance = opt$featurelocation)
if ( all(ovl == peaks) ) {
cat(paste("No overlapping peaks found.."),file=stderr())
q(status=2)
if ( ncol(ovl) == ncol(peaks) ) {
if ( all(ovl == peaks) ) {
cat(paste("No overlapping peaks found.."),file=stderr())
q(status=2)
}
}
printOverlap(ovl, annotationFormat, opt$omit_full_annotation)
} else {
Expand Down

0 comments on commit e6c8f5d

Please sign in to comment.