Exemple #1
0
 def multi_ref(self):
     refseq = d.refseq + d.chr22_chunk
     u.create_seq_file(self.refseq_fn, refseq, qtype="fasta")
     seq_len, span = 75, 500
     f = open(self.refseq_fn)
     raw_seqs = [r.seq.tostring() for r in Bio.SeqIO.parse(f, 'fasta')]
     f.close()
     raw_refseq = "".join(raw_seqs)
     starts = [
         0,  # start of full refseq
         len(raw_seqs[0]) - seq_len / 2,  # bridges the two seqs
         len(raw_refseq) - span  # end of full refseq
     ]
     pairs = u.generate_localized_pairs(raw_refseq,
                                        starts,
                                        seq_len,
                                        span=span)
     for i, fn in enumerate([self.read_fn, self.mate_fn]):
         fp = open(fn, 'w')
         Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-illumina')
         fp.close()
         fp = open("%s.sanger" % fn, 'w')
         Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-sanger')
         fp.close()
     self.__do_pair_align_and_comparison(fastq_subfmt="fastq-illumina")
Exemple #2
0
 def auto_generated(self):
   u.create_seq_file(self.refseq_fn, d.refseq, qtype="fasta")
   n_seq, seq_len, span = 1000, 75, 500
   refseq = Bio.SeqIO.parse(open(self.refseq_fn), 'fasta').next()
   pairs = u.generate_pairs(refseq.seq, n_seq, seq_len, span=span)
   for i, fn in enumerate([self.read_fn, self.mate_fn]):
     fp = open(fn, 'w')
     Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-illumina')
     fp.close()
     fp = open("%s.sanger" % fn, 'w')
     Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-sanger')
     fp.close()
   self.__do_pair_align_and_comparison(fastq_subfmt="fastq-illumina")
Exemple #3
0
 def auto_generated(self):
     u.create_seq_file(self.refseq_fn, d.refseq, qtype="fasta")
     n_seq, seq_len, span = 1000, 75, 500
     refseq = Bio.SeqIO.parse(open(self.refseq_fn), 'fasta').next()
     pairs = u.generate_pairs(refseq.seq, n_seq, seq_len, span=span)
     for i, fn in enumerate([self.read_fn, self.mate_fn]):
         fp = open(fn, 'w')
         Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-illumina')
         fp.close()
         fp = open("%s.sanger" % fn, 'w')
         Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-sanger')
         fp.close()
     self.__do_pair_align_and_comparison(fastq_subfmt="fastq-illumina")
Exemple #4
0
 def multi_ref(self):
   refseq = d.refseq + d.chr22_chunk
   u.create_seq_file(self.refseq_fn, refseq, qtype="fasta")
   seq_len, span = 75, 500
   f = open(self.refseq_fn)
   raw_seqs = [r.seq.tostring() for r in Bio.SeqIO.parse(f, 'fasta')]
   f.close()
   raw_refseq = "".join(raw_seqs)
   starts = [
     0,                             # start of full refseq
     len(raw_seqs[0]) - seq_len/2,  # bridges the two seqs
     len(raw_refseq) - span         # end of full refseq
     ]
   pairs = u.generate_localized_pairs(raw_refseq, starts, seq_len, span=span)
   for i, fn in enumerate([self.read_fn, self.mate_fn]):
     fp = open(fn, 'w')
     Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-illumina')
     fp.close()
     fp = open("%s.sanger" % fn, 'w')
     Bio.SeqIO.write([x[i] for x in pairs], fp, 'fastq-sanger')
     fp.close()
   self.__do_pair_align_and_comparison(fastq_subfmt="fastq-illumina")
Exemple #5
0
 def hand_picked_real_2(self):
   u.create_seq_file(self.refseq_fn, d.mm_chr17_chunk, qtype="fasta")
   for t, f in (("read", self.read_fn), ("mate", self.mate_fn)):
     seq = getattr(d, "real_case_2_%s" % t)
     u.create_seq_file(f, seq, qtype="fastq-sanger")
   self.__do_pair_align_and_comparison(fastq_subfmt="fastq-sanger")
Exemple #6
0
 def hand_picked(self):
   u.create_seq_file(self.refseq_fn, d.refseq, qtype="fasta")
   u.create_seq_file(self.read_fn, d.hit_1_seq, qtype="fastq-sanger")
   u.create_seq_file(self.mate_fn, d.hit_2_seq, qtype="fastq-sanger")
   self.__do_pair_align_and_comparison()
Exemple #7
0
 def hand_picked_real_2(self):
     u.create_seq_file(self.refseq_fn, d.mm_chr17_chunk, qtype="fasta")
     for t, f in (("read", self.read_fn), ("mate", self.mate_fn)):
         seq = getattr(d, "real_case_2_%s" % t)
         u.create_seq_file(f, seq, qtype="fastq-sanger")
     self.__do_pair_align_and_comparison(fastq_subfmt="fastq-sanger")
Exemple #8
0
 def hand_picked(self):
     u.create_seq_file(self.refseq_fn, d.refseq, qtype="fasta")
     u.create_seq_file(self.read_fn, d.hit_1_seq, qtype="fastq-sanger")
     u.create_seq_file(self.mate_fn, d.hit_2_seq, qtype="fastq-sanger")
     self.__do_pair_align_and_comparison()