예제 #1
0
    def __copy__(self):
        """Return a shallow copy of this MSA.

        Returns
        -------
        TabularMSA
            Shallow copy of this MSA. Sequence objects will be shallow-copied.

        See Also
        --------
        __deepcopy__

        """
        seqs = (copy.copy(seq) for seq in self._seqs)

        # Copying index isn't necessary because pd.Index is immutable.
        msa_copy = self.__class__(sequences=seqs,
                                  index=self.index,
                                  metadata=None,
                                  positional_metadata=None)

        msa_copy._metadata = MetadataMixin._copy_(self)
        msa_copy._positional_metadata = PositionalMetadataMixin._copy_(self)

        return msa_copy
예제 #2
0
    def __copy__(self):
        """Return a shallow copy of this MSA.

        Returns
        -------
        TabularMSA
            Shallow copy of this MSA. Sequence objects will be shallow-copied.

        See Also
        --------
        __deepcopy__

        """
        seqs = (copy.copy(seq) for seq in self._seqs)

        # Copying index isn't necessary because pd.Index is immutable.
        msa_copy = self.__class__(sequences=seqs, index=self.index,
                                  metadata=None,
                                  positional_metadata=None)

        msa_copy._metadata = MetadataMixin._copy_(self)
        msa_copy._positional_metadata = PositionalMetadataMixin._copy_(self)

        return msa_copy
예제 #3
0
 def __copy__(self):
     copy = self.__class__(self._axis_len, positional_metadata=None)
     copy._positional_metadata = \
         PositionalMetadataMixin._copy_(self)
     return copy
예제 #4
0
 def __copy__(self):
     copy = self.__class__(self._axis_len, positional_metadata=None)
     copy._positional_metadata = PositionalMetadataMixin._copy_(self)
     return copy