Beispiel #1
0
 def get_fasta(self, chr_pos, strand):
     """finds the sequence of a genomic interval '1:387941-388099', '+' """
     assert self._has_fasta()
     samtools_cmm = ['samtools', 'faidx', self.fasta_file, chr_pos]
     samtools_out = sp.check_output(samtools_cmm).decode()
     seq = self.fasta2seq(samtools_out)
     if strand == '-':
         seq = fn.comp_rev(seq)
     return seq.upper()
Beispiel #2
0
 def get_fasta(self, chr_pos, strand):
     """finds the sequence of a genomic interval '1:387941-388099', '+' """
     assert self._has_fasta()
     samtools_cmm = ['samtools', 'faidx', self.fasta_file, chr_pos]
     samtools_out = sp.check_output(samtools_cmm).decode()
     seq = self.fasta2seq(samtools_out)
     if strand == '-':
         seq = fn.comp_rev(seq)
     return seq.upper()
Beispiel #3
0
 def test_trans_seq_strand(self):
     if os.path.isdir('/Users/martin'):
         seq_out = self.parser.get_trans_seqs(self.trans_exons_strand)
         self.assertEquals(fn.comp_rev(self.seq_exp), seq_out['trans123'])
Beispiel #4
0
 def test_get_fasta_strand(self):
     self.assertEquals(fn.comp_rev(self.seq1), self.parser.get_fasta(self.pos1, '-'))
Beispiel #5
0
 def test_comp_rev_low(self):
     self.assertEquals('CAGTCAGT', fn.comp_rev('actgactg'))
Beispiel #6
0
 def test_comp_rev(self):
     self.assertEquals('CCAAGGTT', fn.comp_rev('AACCTTGG'))
Beispiel #7
0
 def _rev_comp(self, genome_align):
     for llave, seq in genome_align.items():
         genome_align[llave] = fn.comp_rev(seq)
     return genome_align
Beispiel #8
0
 def _rev_comp(self, genome_align):
     for llave, seq in genome_align.items():
         genome_align[llave] = fn.comp_rev(seq)
     return genome_align
Beispiel #9
0
 def test_trans_seq_strand(self):
     if os.path.isdir('/Users/martin'):
         seq_out = self.parser.get_trans_seqs(self.trans_exons_strand)
         self.assertEquals(fn.comp_rev(self.seq_exp), seq_out['trans123'])
Beispiel #10
0
 def test_get_fasta_strand(self):
     self.assertEquals(fn.comp_rev(self.seq1),
                       self.parser.get_fasta(self.pos1, '-'))
Beispiel #11
0
 def test_comp_rev_low(self):
     self.assertEquals('CAGTCAGT', fn.comp_rev('actgactg'))
Beispiel #12
0
 def test_comp_rev(self):
     self.assertEquals('CCAAGGTT', fn.comp_rev('AACCTTGG'))