-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling ambiguous codons #9
Labels
Comments
Can you check if the infile you are providing is in .fasta format and have no ambiguous codons? |
The file is in .txt format and it has ambiguous codons in it |
I'm using the below attached file for the analysis. I changed the .txt
file to .fasta format. still getting the same error. I'm not able to
attach this file in github since it is in .fasta file.
…On Fri, Dec 6, 2024 at 8:41 AM Souradipto Choudhuri < ***@***.***> wrote:
Can you check if the infile you are providing is in .fasta format and have
no ambiguous codons?
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGCXHUQ26GCLW455ZDSLM7L2EEIVHAVCNFSM6AAAAABS722RIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRSGAZDQNBZGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm sorry mate, CodonU is not compatible with ambiguous codons... |
If you want to have this functionality, please state the use cases and expected results for handling ambiguous codons |
SouradiptoC
added
enhancement
New feature or request
question
Further information is requested
labels
Dec 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when i run the following viz.plot_ca_aa_freq_aa(in_file, 11,) I get the following error
TypeError Traceback (most recent call last)
Cell In[39], line 4
2 import pandas as pd
3 in_file = "C:/Users/aravi/Desktop/codonU/At/At_CKX_Prot.txt"
----> 4 viz.plot_ca_aa_freq_gene(in_file, 11,scale =str, min_len_threshold=66, n_components=2,organism_name= "Arabidopsis thaliana", save_image= True, folder_path= "C:/Users/aravi/Desktop/codonU/At" )
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\CodonU\vizualizer\plot_ca_aa_freq_gene.py:31, in plot_ca_aa_freq_gene(handle, genetic_table_num, scale, min_len_threshold, n_components, organism_name, save_image, folder_path)
29 cont_table.replace(0, 0.000001, inplace=True)
30 ca = ca_aa(cont_table, n_components)
---> 31 genes = ca.row_coordinates(cont_table)
33 if scale == 'aroma':
34 color_bar = [ProteinAnalysis(str(prot.seq)).aromaticity() for prot in
35 filter_reference(parse(handle, 'fasta'), min_len_threshold, 'aa')]
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\prince\utils.py:28, in check_is_dataframe_input..wrapper(*args, **kwargs)
24 if not isinstance(X, pd.DataFrame):
25 raise ValueError(
26 f"The X argument must be a pandas DataFrame, but got {type(X).name}"
27 )
---> 28 return func(*args, **kwargs)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\prince\ca.py:19, in select_active_columns..impl(self, X, *method_args, **method_kwargs)
16 @functools.wraps(method)
17 def impl(self, X=None, *method_args, **method_kwargs):
18 if hasattr(self, "active_cols") and isinstance(X, pd.DataFrame):
---> 19 return method(self, X[self.active_cols], *method_args, **method_kwargs)
20 return method(self, X, *method_args, **method_kwargs)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\prince\ca.py:159, in CA.row_coordinates(self, X)
155 else:
156 X = X / X.sum(axis=1)
158 return pd.DataFrame(
--> 159 data=X @ sparse.diags(self.col_masses_.to_numpy() ** -0.5) @ self.svd_.V.T,
160 index=pd.Index(row_names, name=index_name),
161 )
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_base.py:636, in spmatrix.rmatmul(self, other)
633 if isscalarlike(other):
634 raise ValueError("Scalar operands are not allowed, "
635 "use '*' instead")
--> 636 return self._rmul_dispatch(other)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_base.py:614, in spmatrix._rmul_dispatch(self, other)
612 except AttributeError:
613 tr = np.asarray(other).transpose()
--> 614 ret = self.transpose()._mul_dispatch(tr)
615 if ret is NotImplemented:
616 return NotImplemented
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_base.py:532, in spmatrix._mul_dispatch(self, other)
530 return self._mul_vector(other.ravel()).reshape(M, 1)
531 elif other.ndim == 2 and other.shape[0] == N:
--> 532 return self._mul_multivector(other)
534 if isscalarlike(other):
535 # scalar value
536 return self._mul_scalar(other)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_base.py:600, in spmatrix._mul_multivector(self, other)
599 def _mul_multivector(self, other):
--> 600 return self.tocsr()._mul_multivector(other)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_compressed.py:498, in _cs_matrix._mul_multivector(self, other)
494 M, N = self.shape
495 n_vecs = other.shape[1] # number of column vectors
497 result = np.zeros((M, n_vecs),
--> 498 dtype=upcast_char(self.dtype.char, other.dtype.char))
500 # csr_matvecs or csc_matvecs
501 fn = getattr(_sparsetools, self.format + '_matvecs')
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_sputils.py:61, in upcast_char(*args)
59 if t is not None:
60 return t
---> 61 t = upcast(*map(np.dtype, args))
62 _upcast_memo[args] = t
63 return t
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy\sparse_sputils.py:53, in upcast(*args)
50 _upcast_memo[hash(args)] = t
51 return t
---> 53 raise TypeError('no supported conversion for types: %r' % (args,))
TypeError: no supported conversion for types: (dtype('float64'), dtype('O'))
kindly, let me know how to resolve this.
The text was updated successfully, but these errors were encountered: