Difference between revisions of "Python code created by Shim"

From Crop Genomics Lab.
Jump to: navigation, search
Line 1: Line 1:
'''using class as a high speed searchable variation'''
+
'''Using class as a high speed searchable variation'''
  
 
     class ClassName:
 
     class ClassName:
Line 7: Line 7:
 
               ...
 
               ...
  
import the files include this class
+
Import the files include this class
then, input data which you'd like to input to an instance like this way
+
Then, input data which you'd like to input to an instance like this way
  
 
     ClassName(Data4variation1,Data4variation2,,,,)
 
     ClassName(Data4variation1,Data4variation2,,,,)
 +
 +
If you want to search the instance which you've made, firstly, you have to state variation.
 +
However, creating variation repeatedly is not possible in python.
 +
So, dictionary used as a searching table.
 +
 +
    Gene_dict = {'Glyma01g01110':1,'Glyma02g01230':2,,,,}
 +
    instance_list = [ ClassName('Glyma01g01110',,,,),ClassName('Glyma02g01230',,,,,),,,,]
  
 
'''Variation typing code'''
 
'''Variation typing code'''
  
 
determine variation type from three files: fasta, gff3, vcf(generated by samtools pipeline)
 
determine variation type from three files: fasta, gff3, vcf(generated by samtools pipeline)

Revision as of 01:26, 28 March 2014

Using class as a high speed searchable variation

    class ClassName:
         def __init__(self,variation1,variation2,,,,):
              self.variation1=variation1
              self.variation2=variation2
              ...

Import the files include this class Then, input data which you'd like to input to an instance like this way

    ClassName(Data4variation1,Data4variation2,,,,)

If you want to search the instance which you've made, firstly, you have to state variation. However, creating variation repeatedly is not possible in python. So, dictionary used as a searching table.

    Gene_dict = {'Glyma01g01110':1,'Glyma02g01230':2,,,,}
    instance_list = [ ClassName('Glyma01g01110',,,,),ClassName('Glyma02g01230',,,,,),,,,]

Variation typing code

determine variation type from three files: fasta, gff3, vcf(generated by samtools pipeline)