Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def prepare_seq(self, seq, strand):
if strand == '-':
# optionally reverse complement
seq = rc_dna(seq)
seq = cut_seq(seq)
return seq
def _prepare_seq(seqs: List[str], strand: str, tag: str):
"""
Prepare the dna sequence in the final variant, which should be
translated in amino acid sequence
:param seqs: current dna sequence
:param strand: dna strand, where the gene is located
:param tag: tags, which contain information about ambiguous start/end
:return: prepared dna sequence ready for translation into amino acid
sequence
"""
seq = "".join(seqs)
if strand == '-':
# optionally reverse complement
seq = rc_dna(seq)
seq = cut_transcript_seq(seq, tag)
return seq
intervals: List[Interval],
reverse_complement: Union[str, bool],
# *args,
# **kwargs
) -> str:
"""
Prepare the dna sequence in the final variant, which should be translated in amino acid sequence
:param seqs: current dna sequence
:param intervals: the list of intervals corresponding to the sequence snippets
:param reverse_complement: should the dna be reverse-complemented?
"""
seq = "".join(seqs)
if reverse_complement is True or reverse_complement == "-":
# optionally reverse complement
seq = rc_dna(seq)
return seq