示例#1
0
    src.reverse()
    X, Y = [0], [0]
    x, y = 0, 0
    for i in src:
        if i[1] == 0:
            y += 1
        else:
            x += 1
        X.append(x)
        Y.append(y)
    return X, Y


################################################################################

posReadsPaths = getReadsInFolder(readsPosFilePath, minSize=0)
negReadsPaths = getReadsInFolder(readsNegFilePath, minSize=0)

index = getAlignedIndex(alignedSquiggles)

ref = Fasta(refFilePath)

# load basecalled sequence and signal
mod = KmerModel.load_from_hdf5(kmerModelFilePath)

################################################################################

pomery = [[[] for j in kmerLen] for i in levels]
overlap = [[[] for j in kmerLen] for i in levels]
goodDash = [[] for i in levels]
badDash = [[] for i in levels]
示例#2
0
readsFilePath = "../../../data/pos-basecalled"

maxReads = 1000

import os
import sys
import numpy as np

sys.path.append("../")
from signalHelper import getReadsInFolder, getSignalFromRead, getSeqfromRead

reads = getReadsInFolder(readsFilePath, minSize=0)

signalLengths, seqLengths = [], []

for read in reads:
    if maxReads == 0:
        break

    try:
        signal = getSignalFromRead(read)
        seq, _ = getSeqfromRead(read)
    except:
        continue

    maxReads -= 1
    signalLengths.append(len(signal))
    seqLengths.append(len(seq))


meanSignal = np.mean(signalLengths)
示例#3
0
                                 len(signal),
                                 signalShift,
                                 signalScale,
                                 levels,
                                 overflow=overflow)
    return signalString


referenceIdx = mp.Aligner(refFile)
assert referenceIdx, "failed to load/build reference index"

ref = Fasta(refFile)
mod = KmerModel.load_from_hdf5(kmerModelFilePath)

posReadsFiles = glob.glob(readsPosFilePath + '/*.fast5', recursive=True)
negReadsFiles = getReadsInFolder(readsNegFilePath)

contig = ref[0]
refSignal = stringToSignal(str(contig), mod, repeatSignal=repeatSignal)
refString = getGlobalString(refSignal)
helperDict = {"a": "A", "b": "C", "c": "G", "d": "T"}
#refString = "".join(helperDict[i] for i in refString)

#with open("./nieco.fa", "w") as f:
#    f.write(">" + "x" + "\n")
#    f.write(refString.upper() + "\n")

refLevelIdx = mp.Aligner("./helper.fa")
assert refLevelIdx, "failed to load/build reference index"

print("Priprava hotovo!")
示例#4
0
            if len(tempL) != 0:
                dp[i] += max(tempL)

        if max(dp) <= limit:
            continue

        #print(f"{x[begg:endd]}")

        count += 1
        out.append(x[begg][0])
    print(f"Count is {count}")
    return out


################################################################################
posReadsPaths = getReadsInFolder(readsPosFilePath, minSize=1000000)

referenceIdx = mp.Aligner(refFilePath)
assert referenceIdx, "failed to load/build reference index"

ref = Fasta(refFilePath)

# load basecalled sequence and signal
mod = KmerModel.load_from_hdf5(kmerModelFilePath)
################################################################################

globalNorms = {}
storeContig = {}
infoString = None

with open(refIndex, "r") as outFile: