Function getReverseComplementSequence

  • Given a string sequence and a nucleic acid type, get the reverse complement sequence This represents the opposite strand of double-stranded nucleic acids

    Parameters

    • sequence: undefined | string

      The sequence to get the reverse complement of

    • nucleicAcidType: NucleicAcidType

      The type of nucleic acid of the given sequence

    Returns undefined | string

    The reverse complement sequence, or undefined if the input sequence was undefined

    Example

     //Get DNA reverse complement
    getReverseComplementSequence('ATCG', NucleicAcidType.DNA); //returns 'CGAT'

    //Get RNA reverse complement
    getReverseComplementSequence('AUCG', NucleicAcidType.RNA); //returns 'CGAU'