Wednesday, 6 December 2017

چۆنیەتی کار کردن لەسەر پایثۆن


سەرەتا گرنگە دوو جۆری جیاوازی پرۆگرام {سکریپت} بناسین.


یەکەمیان ، ئەو سکریپتانەی کە دێڕ بە دێڕ کارا دەکرێن و دەخرێنە 

کار، ناودەبرێ بە ئینتەرپرێتەیشن



دوەم، ئەو سکریپتەی کە دوای نووسینی چەند دێڕێک کارادەکرێن، 

ناودەبرێ بە کۆمپایلەیشن.
 



پایثۆن توانای هەردوو کارەکەی هەیە.

بە نموونە
،
کلیک لە (IDLE)
بکە پاشان بنووسە


>>> print(“I am here!”)


دواتر ئینتەر بکە، ئەنجامەکە وەک وێنەی یەکەم دەردەکەوێ


دوای ئەمە، دەست لەسەر کلیلی کۆنترۆل دابگرە و پەنجە بنێ بە 

پیتی
دا (N)

لێرەدە دەتوانیت چەند دیڕێ لە کۆد بنوسیت پاشان فایلەکەت 

لەسەر دیسکتۆپ سەیڤ بکە، بە جۆرێ ناوی فایلەکەت بەدوایدا 

دەستەواژەی
.py



هاتبێ. پاشان کلیک لە

 
Run
  
بکە

وەک لە وینەی دووەمدا دیارە.


 

ڕوونکردنەوە،  کاتێ لە فایلی نوێ دا کاردەکەین مینیو باڕی ڕەن ئامادەیە بۆ کارا کردنی بەرنامەکە
هەر وەک لە وێنەی هاوپێچ دیارە


هەروەها دەتوانین بە پرێس کردنی 
F5 
هەمان کار ئەنجام بدەین. 


Tuesday, 5 December 2017

گۆڕاوەکان لە پایثۆندا


گۆڕاوەکان لە پایثۆندا


گۆڕاوەکان بریتین لە یەکەی میمۆری کۆپیوتەر کە دەتوانن داتا لەخۆ بگرن بەشێوەی

 جیاواز
 .

چەند جۆرێ گۆڕاو هەن لە پایثۆندا کە بەپێی جۆری کارەکەت دەگۆڕێن و 

بەکاردێن.


یەکەم
نووسین، کە پێی دەوترێت سترینگ. ئەم جۆرەیان کاتێک بەکاردێ کە بتەوێ

 ئیش لەسە نووسین بکەیت

 .

بە کۆت هێما دەکرێت



لەم نمونەیەدا، گۆڕاوەکە بریتییە لە پیتی ئەی کە نوسینەکەی لە خۆ گرتووە



 دووەم

ژمارەی تەواو، کە بە ئینتیجەر دەناسرێ . ئەم جۆرەیان تەنها ژمارەی تەواو لە خۆ 

دەگرێ










لەم نموونەیەدا هەردوو پیتەکە داتای

   ژمارەییاند تێدایە
  
بۆیە کۆکردنەوەیان مانای کۆکردنەوەی ژمارەکەی ناویانە.


سێ


کەرت کە بە فلۆت ناسراوە. ئەم جۆرەیان ژمارەی کەرت لەخۆ دەگرێ.







ئەم نموونەیە بۆ نیشاندانی ئەنجامی پرۆسەکەیە لەسەر هەمان گۆڕاوی پێشوو.

چوارەم

بوولیان

ئەم جۆرەیان تایبەتە بە دەستەواژەی دروست و نادروسەتەوە، بۆ نموونە


لێرەدا نیشانی دەدات کە ئەنجامی پرۆسەکە نا دروستە


تێبینی

کرداری پرینت، ئەنجامی کارەکەت نیشان دەدات و لە پایثۆنی 3 دا بە فەنکشن 

دروست کراوە کە لەداهاتوودا باسی دەکەم. 





پێشەکی

زانینی بەکارهێنانی زمانی کۆمپیوتەر لە ئێستادا بە یەکێ لە پێوەرەکانی


 هەلسەنگاندنی ئاستی معریفی تاک دادەنرێ بەهۆی گرنگی و کاریگەری ئەم 

زمانەوە لەسەر شێوازی بیرکردنەوەو پلان دانانی تاک بۆ دۆزینەوەی چارەسەری



کێشە ڕاستییەکانی ژیان 

 ئەم پۆستانەی لەم بلۆگەدا دەکرێ زیاتر لایەنی پراکتیکی زمانەکە لەخۆ دەگرن

 چونکە لایەنە تیۆریەکەی لە دوو توێی پەرتووکەکاندا بە سانایی دەدۆزرێنەوە
 .
بۆ دەستکەوتنی بەرنامەی پایثۆن سەردانی ئەم وێبسایتە بکە و بەرنامەکە بە فری


 داونلۆد بکە پاشان لە کۆمپیتەرەکەتدا دایبەزێنە.

https://www.python.org/


 سەرەتایی ترین بەرنامەی کۆپیوتەر کە بنوسرێت و لەهەموو نوسراوێکی سەر بەم 

بابەتە ببینرێ بریتییە لەنیشاندانی سلاوێک


 .
پایثۆن کۆماندی تایبەت بە خۆی هەیە بۆ ئەم مەبەستە کە بریتییە لە:
print ()


>>> print(“Hello World!”

>>> Hello World!


 هاوپێچ وێنەی ئەم کردارەیە لە بەرنامەکەدا


Wednesday, 20 September 2017

The Idea of DNA translation to Amino Acid Sequence

Python 3 provides a powerful yet easy to use tool to translate DNA sequences to amino acid sequences. below is one of the methods that one can use to translate a DNA sequence to amino-acid sequences:

note: codons are triplets of nucleotides that correspond to amino acids [except for stop codons]
one can find codon tables on-line : LINK
below is an example of 3 codons that code for different amino acids:

ATG codes for Methionine [Met] 

GTT codes for Valine [Val]
GCG codes for Alanine [Ala] 

So, the idea is that, the user enters a DNA sequence and you would like to see if there is occurrences of any of the three codons above. Once your software encounters anyone of them, directly changes it to the corresponding amino acid.

Example of User entry: "ATGGTTGCG"

In Python 3 IDLE, type the following commands:


>>> DNA = "ATGGTTGCG" # this is a variable that holds user entry
>>> Triplets = ([DNA[start:start+3] for start in range(0,len(DNA),3)]) # a command that changes user entry into arranged codons from codon position one.
>>> for i in Triplets: print(i, end = ',') # press enter, twice to see your codons.
ATG,GTT,GCG,   

>>> for i in Triplets: # a for loop to iterate through the previous variable i.e Triplets
    if (i == "ATG"): print("MET", end = ',')
    elif (i == "GTT"): print("Val", end = ',')
    elif (i == "GCG"): print("Ala", end = ',') # press enter, twice
   
MET,Val,Ala,






___________________________________________________________________________

was this helpful, somehow ??
 

Sunday, 6 August 2017

How to create a codon list of a DNA sequence in a single line of code in Python 3.5 ?

creating codon lists of a DNA sequence would need you to write methods in a class to generate the output in a list of triplets. However, with python, one can perform such a process in a single line of code. below is the syntax for codon lists.

>>> user_input = input("please enter your DNA sequence below: \n") # this asks the user to enter data. an example is shown below
please enter your DNA sequence below:
AAATCGGGGATGCCCGGGATTTAAGGGCGA
>>> codons = ([user_input[start:start+3]for start in range(0,len(user_input),3)])
>>> print(codons)
['AAA', 'TCG', 'GGG', 'ATG', 'CCC', 'GGG', 'ATT', 'TAA', 'GGG', 'CGA']

Tuesday, 25 July 2017

How to make reverse complement of a DNA sequence ?

the idea of reverse complement of a DNA strand is quite easy to understand, although some people spend some time to get around it. Simply put, the procedure can be divided into two main parts. the first and foremost is the process of making a reverse of the given DNA strand.
the second part is making the complement strand of the existing reverse_ strand as shown in the following figure.
figure 1: process of making reverse complement of a given DNA strand 






an easy algorithm , to make reverse complement, in python 3 would include the following steps.
1- asking user input
2-  reversing user input, and printing out the reversed string
3- complementing each nucleotide in a for loop
4- printing out the reverse-complement strand.


below is the syntax of writing the reverse complement script in python 3.5



DNA = input('please enter your DNA sequence below: \n') # asking user input
UpperCase_DNA = DNA.upper() # this line dictates the entry and makes the entry UPPER CASE
print ('your DNA entry is : \n', UpperCase_DNA) # prints out the upper case entry
reverse_DNA = UpperCase_DNA[::-1] # this line reverses the upper case entry
print ("the reverse of your DNA sequence is:", reverse_DNA) # shows the reversed entry [upper cased]

print ('the reverse complement of your entry sequence is: \n') #  information
for i in reverse_DNA :
if (i == "A"): print ("T", end = "")  # conditional statement to complement each adenine to thymine.
elif (i == "T"): print("A" , end = "")
elif (i == "C"): print("G" , end = "")
elif (i == "G"): print("C", end = "")


I made a video tutorial on this method, i wish it helps somehow ^_^ below is the link to the video .

Click Here









Project Genetic Analysis Toolpack (GAT V1.0)

The name GAT stands for Genetic Analysis Toolpack and we are aiming to make it a useful molecular data analysis tool, and more importantly...