Bio.Seq Create a Seq Object

You're currently learning a lecture from the course: 

... 

Prerequisite Terminologies

In order to have thorough understanding of the main topic, you should have the basic concept of the following terms:

Introduction to BioPython.
Python installed on your PC.
Packages available within Python.
PyCharm installed on your PC.
VS code editor installed on your PC.
Module Hierarchy PDF.

Duration: 

Transcription

By:

Muneeza Maqsood

Introduction:

Bio.Seq is a class of the BioPython package from which we can create or import objects into our main program to perform different tasks on our biological data. The Bio.Seq class of the BioPython provides objects to represent biological sequences with alphabets. Hence, by using the Bio.Seq class of the BioPython, we can convert a string of characters into a nucleotide or amino acid sequence to perform multiple tasks on this biological data.


Steps:

  • To import the seq module from Bio.seq class, enter the following command on the interface of BioPython opened on your VS code editor.

       from Bio.Seq  import Seq

       [This command will import the Seq module from the Bio.Seq class of the BioPython package.]

  • Declare a variable to input the query sequence from user, as:

       myQuerySeq=input (“Enter your sequence:” )

  • To show the data type of the query entered by the user, call in the type() function within the print() function, as:

       print( type( myQuerySeq))

  • To print the query sequence on the output screen, call in the print() function, as:

       print (myQuerySeq)

       Note:  The above short code will input the query and store it as string characters.

  • To convert the input query (string) into a sequence object (nucleotide or amino acids), call in the Seq() function and pass the input query (from the user), as parameter in the Seq() function, and store this value in a separate variable, as:

       sequence_object= Seq(myQuerySeq)

  • To print the data type of your sequence object, call in the type() function within the print() function, as:

       print (type (squence_object))

  • To print the results on output screen, call in the print() function, as:

       print(sequence_object)

  • Save the code and run it, to get the results.


Summary:

In this video tutorial of BioPython packages, we came to know about the Bio.Seq class of the BioPython and how to import Seq objects from the Bio.Seq class. We also got to know how to utilize the Seq() function in a program to perform different tasks on our biological data.

File(s) Section

If a particular file is required for this video, and was discussed in the lecture, you can download it by clicking the button below.

Get in touch with us

Tel: +92 314 7785980

Email: Contact@BioCode.ltd

  • Black Instagram Icon
  • Facebook

© Copyright 2020 BioCode Ltd. - All rights reserved.