美文网首页
Crack5-软件开发:R.A.U 的细菌基因组Genome C

Crack5-软件开发:R.A.U 的细菌基因组Genome C

作者: RashidinAbdu | 来源:发表于2021-05-23 13:43 被阅读0次
    1. 你的基因组报告数据:
    image.png image.png
    image.png
    2.工具的构建与对应的代码如下:
    # Import Module
    from tkinter import *
    
    # Create Object
    root = Tk()
    root.title("R.A.U Genome Coverage Calculator")
    #root.configure(bg='#2ECCFA')
    
    # Set height and width
    width = 650
    height = 250
    
    # Set Geometry and min, max size
    root.geometry(f"{width}x{height}")
    root.maxsize(width, height)
    root.minsize(width, height)
    
    # Create Label
    Label(root, text="", font=(
        "Helvetica", 18, "bold"), fg="black").pack()
    # Funtion will calculate the value of x
    def ratio_calculator():
            # Get the value of spinbox using get() method
        s11 = int(s1.get())
        s22 = int(s2.get())
        s33 = float(s3.get())
        #s44 = int(s4.get())
    
        # Formule Used
        value =((s11/s22)*(s33/100), "x")
    
        # change the text of label using config method
        value_of_x.config(text=value)
    
    
    # Create Frame
    frame = Frame(root)
    frame.pack()
    
    # Create Spin Boxes
    s1 = Spinbox(frame, from_=0, to=10000000, width=10,
                font=("Helvetica", 14, "bold"),)
    s1.pack(side=LEFT, padx=10, pady=10)
    s2 = Spinbox(frame, from_=0, to=10000000, width=10,
                font=("Helvetica", 14, "bold"))
    s2.pack(side=LEFT, padx=10, pady=10)
    s3 = Spinbox(frame, from_=0, to=10000000, width=10,
                font=("Helvetica", 14, "bold"))
    s3.pack(side=LEFT, padx=10, pady=10)
    
    # Add Another Label
    Label(frame, text="Genome Coverage", width=30, font=("Helvetica",
                                        12, "bold"),
        borderwidth=1, relief="solid").pack(side=LEFT,
                                            padx=10,
                                            pady=10)
    
    # Add Another Frame
    frame1 = Frame(root)
    frame1.pack()
    
    x_value = Label(frame1, text="The Genome Coverage is:",
                    font=("Helvetica", 18, "bold"))
    x_value.pack(side=LEFT)
    
    value_of_x = Label(frame1, text="",
                    font=("Helvetica", 18, "bold"))
    value_of_x.pack(side=LEFT)
    
    # Create Button
    Button(root, text="Click To Calculate", borderwidth=2, width=15,
        font=("Helvetica", 14, "bold"),
        command=ratio_calculator, fg="red",
        bg="#2ECCFA").pack(pady=20)
    
    # Execute Tkinter
    root.mainloop()
    # 验证数据:
    # number_of_bases_sequenced =1377024000
    # estimated_genome_size= 4109798
    # reads_placed_in_contigs= (1317332892/1377024000)
    

    • 对于去除decimal points 以及对应的概念:
    
    # 对于去除decimal points 以及对应的概念:
    #To calculate the genome coverage, divide the number of bases sequenced by the estimated genome size,
    # multiplied by % reads placed in contigs
    # 如: 1,514,603,088 / 2,100,000 x (96% of reads placed) = 692x
    
    number_of_bases_sequenced =1377024000
    estimated_genome_size= 4109798
    reads_placed_in_contigs= (1317332892/1377024000)
    
    genome_coverage="{:.2f}".format((number_of_bases_sequenced/estimated_genome_size)*reads_placed_in_contigs)#print 2 decimal places
    
    #format_float = "{:.2f}".format(genome_coverage)
    #print(format_float)
    
    print("%reads_placed_in_contigs=", "{:.2f}".format(reads_placed_in_contigs*100), "%") #print 2 decimal places
    print("genome_coverage=", genome_coverage, "x")
    
    #print((1377024000/ 4109798) *95.66/100)
    
    
    • 此时,只需要将三个变量按照顺序输入以下三个框(从左到右即可!)

    • number_of_bases_sequenced =1377024000
    • estimated_genome_size= 4109798
    • reads_placed_in_contigs= (1317332892/1377024000)=95.67
    image.png
    • 就得到:

    image.png
    3.将做好的软件打包成exe文件:

    具体过程可以参考我之前的推文https://www.jianshu.com/p/dfb857796e78

    即可完成,获得对应的exe程序文件!

    相关文章

      网友评论

          本文标题:Crack5-软件开发:R.A.U 的细菌基因组Genome C

          本文链接:https://www.haomeiwen.com/subject/xuoajltx.html