Python code created by Shim

From Crop Genomics Lab.
Revision as of 01:26, 28 March 2014 by Sangrea Shim (Talk | contribs)

Jump to: navigation, search

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)