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 python | |
| import os | |
| import sys | |
| def main(): | |
| versionfile = [os.path.join(root, x) for root, dirs, files in os.walk(os.getcwd()) for x in files if x == "version.py"] | |
| if len(versionfile) == 1: | |
| with open(versionfile[0]) as versionf: | |
| version = versionf.read().split("\"")[1] | |
| os.system("git commit -m 'bumping version to {}' {}".format(version, versionfile[0])) |
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
| import pypandoc | |
| long_description=pypandoc.convert(path.join(here, 'README.md'), 'rst'), |
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
| # Always prefer setuptools over distutils | |
| from setuptools import setup, find_packages | |
| # To use a consistent encoding | |
| from codecs import open | |
| from os import path | |
| import pypandoc | |
| here = path.abspath(path.dirname(__file__)) | |
| exec(open('nanoplot/version.py').read()) |
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
| from nanomath import aveQual | |
| from nanoplotter import scatter | |
| from Bio import SeqIO | |
| import numpy as np | |
| import pandas as pd | |
| import sys | |
| import gzip | |
| from scipy import stats | |
| import csv |
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
| from nanoplotter import scatter | |
| import pandas as pd | |
| import numpy as np | |
| import sys | |
| from scipy import stats | |
| import pysam | |
| from multiprocessing import Pool | |
| def main(): | |
| df = processBam(sys.argv[1], 24) |
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
| def aveQual(quals): | |
| ''' | |
| Receive the integer quality scores of a read and return the average quality for that read | |
| First convert Phred scores to probabilities, calculate average error probability and convert average back to Phred scale | |
| ''' | |
| return -10*math.log(sum([10**(q/-10) for q in quals]) / len(quals), 10) |
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
| def aveQual(quals): | |
| ''' | |
| Receive the integer quality scores of a read and return the average quality for that read | |
| ''' | |
| return sum(quals) / len(quals) |
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
| from nanomath import aveQual | |
| from nanoplotter import scatter | |
| from Bio import SeqIO | |
| import pandas as pd | |
| import numpy as np | |
| import seaborn as sns | |
| import sys | |
| import gzip | |
| import matplotlib.pyplot as plt | |
| from scipy import stats |
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
| def makeLayout(): | |
| ''' | |
| Make the layout of the MinION flowcell, based on https://bioinformatics.stackexchange.com/a/749/681 | |
| ''' | |
| layoutlist = [] | |
| for i, j in zip([33, 481, 417, 353, 289, 225, 161, 97], [8, 456, 392, 328, 264, 200, 136, 72]): | |
| for n in range(4): | |
| layoutlist.append(list(range(i+n*8, (i+n*8)+8, 1)) + list(range(j+n*8, (j+n*8)-8, -1))) | |
| return np.array(layoutlist) |
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
| # wdecoster | |
| import os | |
| import seaborn as sns | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import argparse | |
| import gzip | |
| from Bio import SeqIO |