Created
          July 15, 2014 12:34 
        
      - 
      
 - 
        
Save Winterflower/efa78416b03633ffcda5 to your computer and use it in GitHub Desktop.  
    Understanding the kmersvm
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from modshogun import StringCharFeatures,DNA | |
| from modshogun import StringWordFeatures | |
| #training set | |
| train_dna=['ACGTGT', | |
| 'ACGGTT', | |
| 'AGTGTT', | |
| 'ACCGGT', | |
| 'TGTGTA', | |
| 'TTGGGT'] | |
| train_features=StringCharFeatures(train_dna, DNA) | |
| #desired kmerlength | |
| kmerlen=6 | |
| word_features=StringWordFeatures(DNA) | |
| word_features.obtain_from_char(train_features,kmerlen-1,kmerlen,0,False) | |
From the shogun toolbox documentation:
void obtain_from_char ( char * str, uint64_t len)
convert string of length len into bit sequence
Parameters:
str string
len length of string in bits
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Hi,
What does the method .obtain_from_char do exactly?
I've been looking everywhere but couldn't find any detailed explanation.
Thank you very much!
Best Regards,
Zhaoming