deepCopy method

AminoAcidSequence deepCopy()

deep copy.

Implementation

AminoAcidSequence deepCopy() {
  List<AminoAcid> copySeq = [];
  for (AminoAcid i in sequence) {
    copySeq.add(i.deepCopy());
  }
  Map<String, AminoAcidInfo>? copyAAInfo;
  if (aminoAcidInfo != null) {
    copyAAInfo = {};
    for (String i in aminoAcidInfo!.keys) {
      copyAAInfo[i] = aminoAcidInfo![i]!.deepCopy();
    }
  }
  return AminoAcidSequence.fromSeq(copySeq,
      id: id,
      direction: direction,
      description: description,
      info: info != null ? {...info!} : null,
      aminoAcidInfo: copyAAInfo);
}