Mercurial > repos > yufei-luo > s_mart
changeset 55:2ac71607aa60
Uploaded
author | m-zytnicki |
---|---|
date | Fri, 10 Jan 2014 08:59:23 -0500 |
parents | 7f0e49595f31 |
children | 97aa2e42bfdf |
files | SMART/Java/Python/CompareOverlappingSmallQuery.py SMART/Java/Python/CompareOverlappingSmallRef.py |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/SMART/Java/Python/CompareOverlappingSmallQuery.py Fri Jan 10 08:57:38 2014 -0500 +++ b/SMART/Java/Python/CompareOverlappingSmallQuery.py Fri Jan 10 08:59:23 2014 -0500 @@ -74,6 +74,7 @@ self.collinear = False self.pcOverlapQuery = False self.pcOverlapRef = False + self.minOverlap = False self.bins = {} self.overlaps = {} self.notOverlapping = False @@ -107,6 +108,9 @@ self.pcOverlapQuery = pcOverlapQuery self.pcOverlapRef = pcOverlapRef + def setMinOverlap(self, minOverlap): + self.minOverlap = minOverlap + def includeNotOverlapping(self, boolean): self.notOverlapping = boolean @@ -135,6 +139,8 @@ return False if self.antisense and queryTranscript.getDirection() == refTranscript.getDirection(): return False + if self.minOverlap and not queryTranscript.overlapWithExon(refTranscript, self.minOverlap): + return False querySize = queryTranscript.getSize() if self.pcOverlapQuery and not queryTranscript.overlapWithExon(refTranscript, int(querySize * self.pcOverlapQuery / 100.0)): return False @@ -223,6 +229,7 @@ parser.add_option("-a", "--antisense", dest="antisense", action="store_true", default=False, help="provide antisense features [format: bool] [default: false]") parser.add_option("-p", "--pcOverlapQuery", dest="pcOverlapQuery", action="store", default=False, type="int", help="min. % overlap of the query [format: bool] [default: false]") parser.add_option("-P", "--pcOverlapRef", dest="pcOverlapRef", action="store", default=False, type="int", help="min. % overlap of the reference [format: bool] [default: false]") + parser.add_option("-m", "--minOverlap", dest="minOverlap", action="store", default=False, type="int", help="min. # overlap between query and reference [format: bool] [default: false]") parser.add_option("-x", "--exclude", dest="exclude", action="store_true", default=False, help="invert the match [format: bool] [default: false]") parser.add_option("-v", "--verbosity", dest="verbosity", action="store", default=1, type="int", help="trace level [format: int]") (options, args) = parser.parse_args() @@ -236,5 +243,6 @@ cosq.setCollinear(options.collinear) cosq.setAntisense(options.antisense) cosq.setMinPercentOverlap(options.pcOverlapQuery, options.pcOverlapRef) + cosq.setMinOverlap(options.minOverlap) cosq.setInvert(options.exclude) cosq.run()
--- a/SMART/Java/Python/CompareOverlappingSmallRef.py Fri Jan 10 08:57:38 2014 -0500 +++ b/SMART/Java/Python/CompareOverlappingSmallRef.py Fri Jan 10 08:59:23 2014 -0500 @@ -74,6 +74,7 @@ self.distance = None self.pcOverlapQuery = False self.pcOverlapRef = False + self.minOverlap = False self.bins = {} self.notOverlapping = False @@ -106,6 +107,9 @@ self.pcOverlapQuery = pcOverlapQuery self.pcOverlapRef = pcOverlapRef + def setMinOverlap(self, minOverlap): + self.minOverlap = minOverlap + def includeNotOverlapping(self, boolean): self.notOverlapping = boolean @@ -139,6 +143,8 @@ return False if self.antisense and queryTranscript.getDirection() == refTranscript.getDirection(): return False + if self.minOverlap and not queryTranscript.overlapWithExon(refTranscript, self.minOverlap): + return False querySize = queryTranscript.getSize() if self.pcOverlapQuery and not queryTranscript.overlapWithExon(refTranscript, int(querySize * self.pcOverlapQuery / 100.0)): return False @@ -217,6 +223,7 @@ parser.add_option("-a", "--antisense", dest="antisense", action="store_true", default=False, help="provide antisense features [format: bool] [default: false]") parser.add_option("-p", "--pcOverlapQuery", dest="pcOverlapQuery", action="store", default=False, type="int", help="min. % overlap of the query [format: bool] [default: false]") parser.add_option("-P", "--pcOverlapRef", dest="pcOverlapRef", action="store", default=False, type="int", help="min. % overlap of the reference [format: bool] [default: false]") + parser.add_option("-m", "--minOverlap", dest="minOverlap", action="store", default=False, type="int", help="min. # overlap between query and reference [format: bool] [default: false]") parser.add_option("-x", "--exclude", dest="exclude", action="store_true", default=False, help="invert the match [format: bool] [default: false]") parser.add_option("-v", "--verbosity", dest="verbosity", action="store", default=1, type="int", help="trace level [format: int]") (options, args) = parser.parse_args() @@ -230,5 +237,6 @@ cosr.setAntisense(options.antisense) cosr.setInvert(options.exclude) cosr.setMinPercentOverlap(options.pcOverlapQuery, options.pcOverlapRef) + cosr.setMinOverlap(options.minOverlap) cosr.run()