This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import asyncio | |
| import sys | |
| class StdOutProtocol(asyncio.SubprocessProtocol): | |
| def __init__(self, exit_future): | |
| self.exit_future = exit_future | |
| self.output = bytearray() | |
| def pipe_data_received(self, fd, data): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # resulting graph is at https://www.dropbox.com/s/vepdi2deoeejly0/dhs_nreads.png?dl=0 | |
| import pybedtools | |
| import pysam | |
| import itertools | |
| import matplotlib.pyplot as plt | |
| def avg(iterator): | |
| total, n = 0,0 | |
| for it in iterator: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| def get_blks(): | |
| import gzip | |
| # <http://hgdownload.cse.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz> | |
| with gzip.open('hg38ToHg19.over.chain.gz', 'rt') as f: | |
| for line in f: | |
| line = line.rstrip('\n').split() | |
| if line and line[0] == 'chain': | |
| blk = dict(chr1=line[2], std1=line[4], stt1=int(line[5]), len1=int(line[6]), |
OlderNewer