Example #1
0
def update_read_map(fastq_file_name, library_file_name, max_hamming_dist = 2, shuffle=False):
	red = redis.StrictRedis(host='localhost')
	#with open(input_map_name, 'rb') as f: input_map = pickle.load(f)
	with open(library_file_name, 'rb') as f: library = pickle.load(f)
	fastq_records = parse.load_fastq(fastq_file_name)
	if (shuffle):
		fastq_records = shuffle(list(fastq_records))
	guess_alleles(fastq_records, library, red, max_hamming_dist = max_hamming_dist)
Example #2
0
def update_read_map(fastq_file_name,
                    library_file_name,
                    max_hamming_dist=2,
                    shuffle=False):
    red = redis.StrictRedis(host='localhost')
    #with open(input_map_name, 'rb') as f: input_map = pickle.load(f)
    with open(library_file_name, 'rb') as f:
        library = pickle.load(f)
    fastq_records = parse.load_fastq(fastq_file_name)
    if (shuffle):
        fastq_records = shuffle(list(fastq_records))
    guess_alleles(fastq_records,
                  library,
                  red,
                  max_hamming_dist=max_hamming_dist)
def main(args):
	red = redis.StrictRedis(host='localhost')
	calc_mutant_freqs(parse.load_fastq(args.fastq), red, args.library)
	counts = calc_mutant_freqs(args.fastq_records, args.library)
	with open(args.output, 'wb') as f: pickle.dump(counts, f)
Example #4
0
import parse

records = list(parse.load_fastq('../test_resources/test_allele_shortrevcomp.fastq'))

assert len(records) == 6

assert records[0].sequence == 'ATATTGAAAGTATGCGCCAGATCGGA'
assert records[0].name == 'entry1'
Example #5
0
import parse

records = list(
    parse.load_fastq('../test_resources/test_allele_shortrevcomp.fastq'))

assert len(records) == 6

assert records[0].sequence == 'ATATTGAAAGTATGCGCCAGATCGGA'
assert records[0].name == 'entry1'