You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
I am trying to extract features from a given fasta file (DNA or RNA), using kmer.py script as per the description in the README. While running the code in a juypter notebook it is throwing the following error.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-11-1066287f4a62> in <module>
4
5 k = 6 # choose the value for k
----> 6 obj = kmer_featurization(k)
7 kmer_features = obj.obtain_kmer_feature_for_a_list_of_sequences(seq_list, write_number_of_occurrences=False)
~/Documents/lncRNAs_project_2020/scripts_2021/kmer/kmer.py in __init__(self, k)
8 """
9 self.k = k
---> 10 self.letters = ['A', 'T', 'C', 'G']
11 self.multiplyBy = 4 ** np.arange(k-1, -1, -1) # the multiplying number for each digit position in the k-number system
12 self.n = 4**k # number of possible k-mers
NameError: name 'np' is not defined
I am running the script in python 3.2.7, and I have numpy installed.
This is how I tried running the script,
from kmer import kmer_featurization
import numpy as np
seq_list = ['ATCGA', 'TCGAC'] # a list of DNA sequences
k = 6 # choose the value for k
obj = kmer_featurization(k)
kmer_features = obj.obtain_kmer_feature_for_a_list_of_sequences(seq_list, write_number_of_occurrences=False)
Any suggestions/help is much appreciated!
The text was updated successfully, but these errors were encountered:
Hi All,
I tried this code , this worked but gave an error
PS C:\Users\Azeem Javed\Desktop\python_ammar.py\BMI and visulization> & "C:/Users/Azeem Javed/AppData/Local/Programs/Python/Python310/python.exe"
"c:/Users/Azeem Javed/Desktop/python_ammar.py/BMI and visulization/kmer.py"
c:\Users\Azeem Javed\Desktop\python_ammar.py\BMI and visulization\kmer.py:51: RuntimeWarning: invalid value encountered in true_divide
kmer_feature = kmer_feature / number_of_kmers
Actually i want to make kmers from a genome of bacteria (have seq file in FASTA format), Is it a right code to do so
Hi All,
I am trying to extract features from a given fasta file (DNA or RNA), using kmer.py script as per the description in the README. While running the code in a juypter notebook it is throwing the following error.
I am running the script in python 3.2.7, and I have numpy installed.
This is how I tried running the script,
Any suggestions/help is much appreciated!
The text was updated successfully, but these errors were encountered: