Commit 271e4801 authored by Alexander, William's avatar Alexander, William
Browse files

Lines 353-355: added kmer length check

parent 415ed4f2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ def memeLoop(folder: str, inDF, genomeDict: dict, threads: int, sampleSize: int,
    genomeDict (dict): a dict containing all genomic sequences in the format {seqName: seq}
    sampleSize (int): rows of data from inDF to convert to FASTA and pass to MEME; default 250
    randFract (float): fraction of sampleSize to be randomly selected rather than chosen by data quality; deactivated by default
    k (int): represents # of bases extended before and after ambiguous base'''
    k (int): represents # of bases extended before and after modified base'''

    complete = 'no'
    inDF = inDF.drop(columns=['end', 'start1', 'end1', 'color', 'score'])
@@ -350,6 +350,7 @@ def memeLoop(folder: str, inDF, genomeDict: dict, threads: int, sampleSize: int,
                    if strand == '-':
                        kmer = revc(kmer)
                    name = replicon + ':' + str(coord) + strand
                    if len(kmer) == ((k*2) + 1):
                        print('>{}\n{}'.format(name, kmer), file=outFasta)
                        kmerList.append(kmer)
            p = subprocess.Popen('meme input_{a}.fasta -p {b} -o meme_{a} -mod zoops -evt 0.1 -minw 3 -maxw 20'