Connect with us

Bioinformatics Programming

HTSeq : A Python framework to analyze high throughput sequencing data

Dr. Muniba Faiza

Published

on

High throughput sequencing is most widely used as it saves a lot of time and provide good results, and produces a huge amount of data which is difficult to manage and especially the tasks and operations performed on it are also very difficult. To ease this purpose, a Python framework have been introduced by  Simon Anders and team members, this framework is known as “HTSeq”.HTSeq is a Python library which easily develops the scripts required to fulfill a particular task on the HT data. Basically,HTSeq reads various formats and break it down into recognized strings of characters for further analysis. It also consists of different classes  genomic coordinates, sequences, sequencing reads, alignments, gene model information, etc.

Two stand-alone applications have also been developed along with HTSeq,  namely, htseq-qa for read quality assessment and htseq-count for preprocessing RNA-Seq alignments for analyzing differential expression.

HTSeq can read various formats such as FASTA, FASTQ (short reads), SAM/BAM (short-read alignments).  Wherever appropriate, different parsers will yield the same type of record objects. For example, the record class SequenceWithQualities is used whenever sequencing read with base-call qualities needs to be presented, and hence yielded by the FastqParser class and also present as a field in the SAM_Alignment objects yielded by SAM_Reader or BAM_Reader parser objects (Fig. 1). There are some specific classes to represent Genomic Position and Genomic Intervals of the sequence. In order to achieve good performance, various parts of HTSeq is written in ‘Cython’ ( a tool which translates Python code augmented with C).

Fig.1

Fig. 1. ( a) The SAM_Alignment class as an example of an HTSeq data record: subsets of the content are bundled in object-valued fields, using classes (here SequenceWithQualities and GenomicInterval) that are also used in other data records to provide a common view on diverse data types. ( b) The cigar field in a SAM_alignment object presents the detailed structure of a read alignment as a list of CigarOperation. This allows for convenient downstream processing of complicated alignment structures, such as the one given by the cigar string on top and illustrated in the middle. Five CigarOperation objects, with slots for the columns of the table (bottom) provide the data from the cigar string, along with the inferred coordinates of the affected regions in read (‘query’) and reference.

HTSeq also consists of a class which deals with the gapped alignments, namely SAM_Alignment,  with multiple alignments and with paired-end data.  HTSeq provides a function, pair_SAM_alignments_with_buffer, to pair up the alignment records by keeping a buffer of reads whose end pair has not yet been found, and so facilitates processing data on the level of sequenced fragments rather than reads. HTSeq also facilitates the storage of genome-position-dependent data, which means that  each base pair position on the genome can be given a particular value that can be easily stored and retrieved by simply entering the same value.

The script htseq-qa is a simple tool for initial quality assessment of sequencing runs. It produces plots that summarize the nucleotide compositions of the positions in the read and the base-call qualities. As we discussed earlier in this article that htseq-count is a tool for  RNA-Seq data analysis.  It counts for each gene that how many aligned reads overlap the sequence exons. Since it is designed specifically to analyse differential expression only reads mapping unambiguously to a single gene are considered and the  reads aligned to multiple positions or overlapping with more than one gene are discarded.  In case of paired-end data, htseq-count counts only the fragment not the reads because  the two paired ends originating from the same fragment provide only evidence for one cDNA fragment and should hence be counted only once.

In this way, HTSeq offers a comprehensive solution to facilitate a wide range of programming tasks in HTS data analysis. For further reading, click here.

Note:

An exhaustive list of references for this article is available with the author and is available on personal request, for more details write to [email protected]

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Advertisement
4 Comments

4 Comments

  1. Prashant Pant

    January 10, 2016 at 9:00 am

    Very nice article. Nicely Written and very informative.

  2. Prashant Pant

    January 10, 2016 at 9:22 am

    You should think about compiling all the sequencing format types used in Bioinformatics in the form of an article..the title can be “Sequencing Formats you should be aware of: the variety they offer in usage”. This will be very good for beginners and graduate students. After this, the second article on the same line should be “How to generate these formats using online resources”. Think about it. It would be very informative and useful for users…Cheers

    • Dr. Muniba Faiza

      Muniba Faiza

      January 10, 2016 at 7:15 pm

      Ok sure sir, i will do next time

You must be logged in to post a comment Login

Leave a Reply

Bioinformatics Programming

Free_Energy_Landscape-MD: Python package to create Free Energy Landscape using PCA from GROMACS.

Dr. Muniba Faiza

Published

on

In molecular dynamics (MD) simulations, a free energy landscape (FEL) serves as a crucial tool for understanding the behavior of molecules and biomolecules over time. It is difficult to understand and plot a meaningful FEL and then extract the time frames at which the plot shows minima. In this article, we introduce a new Python package (Free_Energy_Landscape-MD) to generate an FEL based on principal component analysis (PCA) from MD simulation done by GROMACS [1].

(more…)

Continue Reading

Bioinformatics News

VS_Analysis: A Python package to perform post-virtual screening analysis

Dr. Muniba Faiza

Published

on

VS_Analysis: A Python package to perform post-virtual screening analysis

Virtual screening (VS) is a crucial aspect of bioinformatics. As you may already know, there are various tools available for this purpose, including both paid and freely accessible options such as Autodock Vina. Conducting virtual screening with Autodock Vina requires less effort than analyzing its results. However, the analysis process can be challenging due to the large number of output files generated. To address this, we offer a comprehensive Python package designed to automate the analysis of virtual screening results.

(more…)

Continue Reading

Bioinformatics Programming

vs_interaction_analysis.py: Python script to perform post-virtual screening analysis

Dr. Muniba Faiza

Published

on

vs_interaction_analysis.py: Python script to perform post-virtual screening analysis

Analyzing the results of virtual screening (VS) performed with Autodock Vina [1] can be challenging when done manually. In earlier instances, we supplied two scripts, namely vs_analysis.py [2,3] and vs_analysis_compounds.py [4]. This time, we have developed a new Python script to simplify the analysis of VS results.

(more…)

Continue Reading

Bioinformatics Programming

How to create a pie chart using Python?

Dr. Muniba Faiza

Published

on

How to create a pie chart using Python?

In this article. we are creating a pie chart of the docking score of five different compounds docked with the same protein. (more…)

Continue Reading

Bioinformatics Programming

How to make swarm boxplot?

Dr. Muniba Faiza

Published

on

How to make swarm boxplot?

With the new year, we are going to start with a very simple yet complicated topic (for beginners) in bioinformatics. In this tutorial, we provide a simple code to plot swarm boxplot using matplotlib and seaborn. (more…)

Continue Reading

Bioinformatics Programming

How to obtain ligand structures in PDB format from PDB ligand IDs?

Dr. Muniba Faiza

Published

on

How to obtain ligand structures in PDB format from PDB ligand IDs?

Previously, we provided a similar script to download ligand SMILES from PDB ligand IDs. In this article, we are downloading PDB ligand structures from their corresponding IDs. (more…)

Continue Reading

Bioinformatics Programming

How to obtain SMILES of ligands using PDB ligand IDs?

Dr. Muniba Faiza

Published

on

How to obtain SMILES of ligands using PDB ligand IDs?

Fetching SMILE strings for a given number of SDF files of chemical compounds is not such a trivial task. We can quickly obtain them using RDKit or OpenBabel. But what if you don’t have SDF files of ligands in the first place? All you have is Ligand IDs from PDB. If they are a few then you can think of downloading SDF files manually but still, it seems time-consuming, especially when you have multiple compounds to work with. Therefore, we provide a Python script that will read all Ligand IDs and fetch their SDF files, and will finally convert them into SMILE strings. (more…)

Continue Reading

Bioinformatics Programming

How to get secondary structure of multiple PDB files using DSSP in Python?

Dr. Muniba Faiza

Published

on

How to get secondary structure of multiple PDB files using DSSP in Python?

In this article, we will obtain the secondary structure of multiple PDB files present in a directory using DSSP [1]. You need to have DSSP installed on your system. (more…)

Continue Reading

Bioinformatics Programming

vs_analysis_compound.py: Python script to search for binding affinities based on compound names.

Dr. Muniba Faiza

Published

on

vs_analysis_compound.py: Python script to search for binding affinities based on compound names.

Previously, we have provided the vs_analysis.py script to analyze virtual screening (VS) results obtained from Autodock Vina. In this article, we have provided another script to search for binding affinity associated with a compound. (more…)

Continue Reading

Bioinformatics Programming

How to download files from an FTP server using Python?

Dr. Muniba Faiza

Published

on

How to download files from an FTP server using Python?

In this article, we provide a simple Python script to download files from an FTP server using Python. (more…)

Continue Reading

Bioinformatics Programming

How to convert the PDB file to PSF format?

Dr. Muniba Faiza

Published

on

How to convert the PDB file to PSF format?

VMD allows converting PDB to PSF format but sometimes it gives multiple errors. Therefore, in this article, we are going to convert PDB into PSF format using a different method. (more…)

Continue Reading

Bioinformatics Programming

smitostr.py: Python script to convert SMILES to structures.

Dr. Muniba Faiza

Published

on

smitostr.py: Python script to convert SMILES to structures.

As mentioned in some of our previous articles, RDKit provides a wide range of functions. In this article, we are using RDKit [1] to draw a molecular structure using SMILES. (more…)

Continue Reading

Bioinformatics Programming

How to preprocess data for clustering in MATLAB?

Dr. Muniba Faiza

Published

on

How to preprocess data for clustering in MATLAB?

Data preprocessing is a foremost and essential step in clustering based on machine learning methods. It removes noise and provides better results. In this article, we are going to discuss the steps involved in data preprocessing using MATLAB [1]. (more…)

Continue Reading

Bioinformatics Programming

How to calculate drug-likeness using RDKit?

Dr. Muniba Faiza

Published

on

How to calculate drug-likeness using RDKit?

RDKit [1] allows performing multiple functions on chemical compounds. One is the quantitative estimation of drug-likeness also known as QED properties. These properties include molecular weight (MW), octanol-water partition coefficient (ALOGP), number of hydrogen bond donors (HBD), number of hydrogen bond acceptors (HBA), polar surface area (PSA), number of rotatable bonds (ROTB), number of aromatic rings (AROM), structural alerts (ALERTS). (more…)

Continue Reading

Bioinformatics Programming

sdftosmi.py: Convert multiple ligands/compounds in SDF format to SMILES.

Dr. Muniba Faiza

Published

on

sdftosmi.py: Convert multiple ligands/compounds in SDF format to SMILES?

You can obtain SMILES of multiple compounds or ligands in an SDF file in one go. Here, we provide a simple Python script to do that. (more…)

Continue Reading

Bioinformatics Programming

tanimoto_similarities_one_vs_all.py – Python script to calculate Tanimoto Similarities of multiple compounds

Dr. Muniba Faiza

Published

on

tanimoto_similarities_one_vs_all.py – Python script to calculate Tanimoto Similarities of a compound with multiple compounds

We previously provided a Python script to calculate the Tanimoto similarities of multiple compounds against each other. In this article, we are providing another Python script to calculate the Tanimoto similarities of one compound with multiple compounds. (more…)

Continue Reading

Bioinformatics Programming

tanimoto_similarities.py: A Python script to calculate Tanimoto similarities of multiple compounds using RDKit.

Dr. Muniba Faiza

Published

on

tanimoto_similarities.py: A Python script to calculate Tanimoto similarities of multiple compounds using RDKit.

RDKit [1] is a very nice cheminformatics software. It allows us to perform a wide range of operations on chemical compounds/ ligands. We have provided a Python script to perform fingerprinting using Tanimoto similarity on multiple compounds using RDKit. (more…)

Continue Reading

Bioinformatics Programming

How to commit changes to GitHub repository using vs code?

Published

on

How to commit changes to GitHub repository using vs code?

In this article, we are providing a few commands that are used to commit changes to GitHub repositories using VS code terminal.

(more…)

Continue Reading

Bioinformatics Programming

Extracting first and last residue from helix file in DSSP format.

Dr. Muniba Faiza

Published

on

Extracting first and last residue from helix file in DSSP format.

Previously, we have provided a tutorial on using dssp_parser to extract all helices including long and short separately. Now, we have provided a new python script to find the first and last residue in each helix file. (more…)

Continue Reading

Bioinformatics Programming

How to extract x,y,z coordinates of atoms from PDB file?

Published

on

How to extract x,y,z coordinates of atoms from PDB file?

The x, y, and z coordinates of atoms are provided in the PDB file. One way to extract them is by using the Biopython package [1]. In this article, we will extract coordinates of C-alpha atoms for each residue from the PDB file using Biopython. (more…)

Continue Reading

LATEST ISSUE

ADVERT