def stitchRegions(receptor, v_seq, d_seq, j_seq, amino_acid=False):
    """
    Assemble full length region encoding

    Arguments:
      receptor (changeo.Receptor.Receptor): Receptor object
      v_seq (str): V segment germline sequence as a string
      d_seq (str): D segment germline sequence as a string
      j_seq (str): J segment germline sequence as a string
      amino_acid (bool): if True use amino acid positional fields, otherwise use nucleotide fields.

    Returns:
      str: string defining germline regions
    """
    full_junction = True if getattr(receptor, 'n1_length', None
        ) is not None else False
    regions = 'V' * len(v_seq)
    if amino_acid:
        try:
            np1_len = int(receptor.np1_aa_length)
        except (TypeError, ValueError, AttributeError):
            np1_len = 0
        regions += 'N' * np1_len
    elif not full_junction:
        try:
            np1_len = int(receptor.np1_length)
        except (TypeError, ValueError):
            np1_len = 0
        regions += 'N' * np1_len
    else:
        try:
            p3v_len = int(receptor.p3v_length)
        except (TypeError, ValueError):
            p3v_len = 0
        try:
            n1_len = int(receptor.n1_length)
        except (TypeError, ValueError):
            n1_len = 0
        try:
            p5d_len = int(receptor.p5d_length)
        except (TypeError, ValueError):
            p5d_len = 0
        regions += 'P' * p3v_len
        regions += 'N' * n1_len
        regions += 'P' * p5d_len
    regions += 'D' * len(d_seq)
    if amino_acid:
        try:
            np2_len = int(receptor.np2_aa_length)
        except (TypeError, ValueError, AttributeError):
            np2_len = 0
        regions += 'N' * np2_len
    elif not full_junction:
        try:
            np2_len = int(receptor.np2_length)
        except (TypeError, ValueError):
            np2_len = 0
        regions += 'N' * np2_len
    else:
        try:
            p3d_len = int(receptor.p3d_length)
        except (TypeError, ValueError):
            p3d_len = 0
        try:
            n2_len = int(receptor.n2_length)
        except (TypeError, ValueError):
            n2_len = 0
        try:
            p5j_len = int(receptor.p5j_length)
        except (TypeError, ValueError):
            p5j_len = 0
        regions += 'P' * p3d_len
        regions += 'N' * n2_len
        regions += 'P' * p5j_len
    regions += 'J' * len(j_seq)
    return regions
