Exemple #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()
Exemple #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()
Exemple #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'])
Exemple #4
0
 def test_get_fasta_strand(self):
     self.assertEquals(fn.comp_rev(self.seq1), self.parser.get_fasta(self.pos1, '-'))
Exemple #5
0
 def test_comp_rev_low(self):
     self.assertEquals('CAGTCAGT', fn.comp_rev('actgactg'))
Exemple #6
0
 def test_comp_rev(self):
     self.assertEquals('CCAAGGTT', fn.comp_rev('AACCTTGG'))
Exemple #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
Exemple #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
Exemple #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'])
Exemple #10
0
 def test_get_fasta_strand(self):
     self.assertEquals(fn.comp_rev(self.seq1),
                       self.parser.get_fasta(self.pos1, '-'))
Exemple #11
0
 def test_comp_rev_low(self):
     self.assertEquals('CAGTCAGT', fn.comp_rev('actgactg'))
Exemple #12
0
 def test_comp_rev(self):
     self.assertEquals('CCAAGGTT', fn.comp_rev('AACCTTGG'))