CNSAnalysis/OldScripts/workWithMAF.py
def findBadCharPosition(strSeq):
    """for each MAF sequence, output maximum number of valid characters in a row, exclude duplicates/lowercase/N/softmask <- invalid
    only accept sequence in analysis if at least 15 valid characters in a row"""
    #minVal = np.min(np.vectorize(lambda y: turnSixteen(y))(np.vectorize(lambda x: strSeq.find(x))(np.array(['a','t','c','g','N']))))
    """
    if minVal == -1:
        return 16
    else:
        return minVal
    """
    if 'a' in strSeq or 'c' in strSeq or 'N' in strSeq or 'g' in strSeq or 't' in strSeq:
        return np.max(np.vectorize(lambda x: len(x))(np.array(strSeq.replace('a','N').replace('c','N').replace('t','N').replace('g','N').strip('-').split('N'))))
    else:
        return 16
for each MAF sequence, output maximum number of valid characters in a row, exclude duplicates/lowercase/N/softmask <- invalid
    only accept sequence in analysis if at least 15 valid characters in a row
for each MAF sequence, output maximum number of valid characters in a row, exclude duplicates/lowercase/N/softmask <- invalid
only accept sequence in analysis if at least 15 valid characters in a row
for each MAF sequence output maximum number of valid characters in a row exclude duplicates / lowercase / N / softmask < - invalid only accept sequence in analysis if at least 15 valid characters in a row
def findBadCharPosition(strSeq):
    if 'a' in strSeq or 'c' in strSeq or 'N' in strSeq or 'g' in strSeq or 't' in strSeq:
        return np.max(np.vectorize(lambda x: len(x))(np.array(strSeq.replace('a','N').replace('c','N').replace('t','N').replace('g','N').strip('-').split('N'))))
    else:
        return 16
def findBadCharPosition ( strSeq ) : """
    if minVal == -1:
        return 16
    else:
        return minVal
    """ if 'a' in strSeq or 'c' in strSeq or 'N' in strSeq or 'g' in strSeq or 't' in strSeq : return np . max ( np . vectorize ( lambda x : len ( x ) ) ( np . array ( strSeq . replace ( 'a' , 'N' ) . replace ( 'c' , 'N' ) . replace ( 't' , 'N' ) . replace ( 'g' , 'N' ) . strip ( '-' ) . split ( 'N' ) ) ) ) else : return 16
for each MAF sequence, output maximum number of valid characters in a row, exclude duplicates/lowercase/N/softmask <- invalid
only accept sequence in analysis if at least 15 valid characters in a row
for each MAF sequence output maximum number of valid characters in a row exclude duplicates / lowercase / N / softmask < - invalid only accept sequence in analysis if at least 15 valid characters in a row
"""for each MAF sequence, output maximum number of valid characters in a row, exclude duplicates/lowercase/N/softmask <- invalid
    only accept sequence in analysis if at least 15 valid characters in a row""" #minVal = np.min(np.vectorize(lambda y: turnSixteen(y))(np.vectorize(lambda x: strSeq.find(x))(np.array(['a','t','c','g','N'])))) """
    if minVal == -1:
        return 16
    else:
        return minVal
    """
strSeq