コード例 #1
0
ファイル: fastq_score_type.py プロジェクト: wresch/gosr
def determine_score_type(args):
    with FileOrGzip(args.fastq) as infile:
        count = 0
        letter_freq = collections.defaultdict(int)
        for rid, seq, qual in fastq.read(infile):
            count += 1
            for l in qual:
                letter_freq[l] += 1
            if count == 5000:
                break
        print guess_score_type(letter_freq)
コード例 #2
0
ファイル: fastq_to_phred33.py プロジェクト: wresch/gosr
def to_phred33(args):
    if args.score_type == "phred64":
        table = phred64_to_phred33
    elif args.score_type == "solexa":
        table = solexa_to_phred33
    elif args.score_type == "phred33+":
        table = phred33plus_to_phred33
    out = "@{0}\n{1}\n+\n{2}"
    with FileOrGzip(args.fastq) as infile:
        for rid, rseq, rqual in fastq.read(infile):
            print out.format(rid, rseq, rqual.translate(table))