def test(argv):
numpy.seterr(all="ignore")
args = parseArgs(argv)
setupLogging(True)#keep debug on.. you're testing!
logging.critical(("Running HSpots.py directly implements testing mode. "
"If you're trying to run the full, actual program, use "
"Honey.py spots"))
bam = pysam.Samfile(args.bam)
reference = pysam.Fastafile(args.reference)
try:
if bam.header["HD"]["SO"] != "coordinate":
logging.warning("BAM is not sorted by coordinates! Performance may be slower")
except KeyError:
logging.warning("Assuming BAM is sorted by coordinate. Be sure this is correct")
logging.info("Running in test mode")
#do what you will.. from here
#spot = SpotResult(chrom='11', start=2215290, end=2215798, svtype="DEL", size=208)
#spot = SpotResult(chrom='22', start=45964261, end=45965596, svtype="DEL", size=-1)
# This is what I need to start with
#spot = SpotResult(chrom="22", start=45963975, end=45964532, svtype="DEL", size=57)
fh = open("honeymissing.bed")
for line in fh.readlines():
data = line.strip().split('\t')
spot = SpotResult(chrom=data[0], start=int(data[1]), end = int(data[2]), \
size=int(data[3].split('=')[-1]), svtype="DEL")
j = SpotCaller('group', spot.chrom, spot.start, spot.end, args)
if j.supportingReadsFilter(spot, bam, args):
consen = ConsensusCaller(spot, args)
consen(bam, reference, 'none')
for i in consen.newSpots:
i.tags["seqmade"] = True
print i
if len(consen.newSpots) == 0:
spot.tags["noseq"] = True
print str(spot)
else:
spot.tags["filtfail"] = True
print str(spot)
#done with test code
logging.info("Finished testing")
评论列表
文章目录