Small Non-coding RNA Clustering using BlockClust


question Questions
  • What do the read profiles of small non-coding RNAs represent?

  • How to cluster the read profiles based on some intrinsic features?

objectives Objectives
  • Difference between mRNA-seq and smallRNA-seq

  • Unsupervised grouping of the adjacent reads into read profiles

  • Look and learn what the shapes of the read profiles represent

  • Clustering of the read profiles by machine learning algorithm

requirements Requirements

time Time estimation: 1 hour

Supporting Materials

last_modification Last modification: Mar 12, 2021


Small Non-coding RNAs (ncRNAs) play a vital role in many cellular processes such as RNA splicing, translation, gene regulation. The small RNA-seq is a type of RNA-seq in which RNA fragments are size selected to capture only short RNAs. One of the most common applications of the small RNA-seq is discovering novel small ncRNAs. Mapping the small RNA-seq data reveals interesting patterns that represent the traces of the small RNA processing.

For example, consider the miRNA biogenesis. The primary miRNA transcripts are processed by Drosha-complexes and results in hairpin precursor miRNAs. Then after they transported to the cytoplasm, Dicer slices off the hairpin. One of the RNA strands bound by Argonaute proteins regulates the target mRNA while the other strand is degraded.

The following figure (bottom part of the figure is taken from DOI: 10.1038/nrg3162) represents one of the small RNA processing patterns. The vertical block bars represent a mapped reads on reference genome. The height of the bars represents the number of reads mapped at that location. Reads in each bubble represent a read profile. In this case, they both are from miRNAs. From the small RNA-seq, we often see the two processed miRNA strands after mapping. The miRNA strand which targets the mRNA is expressed and we see more reads compared to the degraded strand. The gap between those two piles of reads represents the missing hairpin.

read profiles
Figure 1: Patterns of processing in read profiles

In this tutorial, we will learn how to use BlockClust to cluster similar processing patterns together.


In this tutorial, we will cover:

  1. Preprocessing of the data
    1. Get data
    2. Sort BAM file
    3. BAM to BED of tags
  2. Grouping of the adjacent reads into read profiles
    1. Sort the BED file of tags
    2. Group reads into blocks and blockgroups using blockbuster
  3. Clustering with BlockClust

Preprocessing of the data

The data is we use is from human cell line MCF-7 sequenced in single-end on Illumina Genome Analyzer II. Reads are 36nt long and should be sufficiently long enough for this type of data. We start with a BAM file as an input for this tutorial. This BAM file is a result of mapping the reads on human reference genome build hg19 using segemehl. If you want to use your own raw sequencing data, please clip the adapters and map to the reference genome.

In the first step, we convert the BAM file into BED file. This is not a plain file conversion. Hence we cannot use any kind of BAM to BED conversion tools. We use BlockClust tool in the pre-processing mode for this purpose. The resulting BED file contains tags (a tag is a unique read sequence in a deep-sequencing library) and their normalized expression (in column 5), i.e. the ratio of the read count per tag to the number of mappings on the reference genome.

Get data

hands_on Hands-on: Data upload

  1. Create a new history for this tutorial

    Tip: Creating a new history

    Click the new-history icon at the top of the history panelIf the new-history is missing:

    1. Click on the galaxy-gear icon (History options) on the top of the history panel
    2. Select the option Create New from the menu
  2. Import the files from Zenodo
    • Copy the link location
    • Open the Galaxy Upload Manager (galaxy-upload on the top-right of the tool panel)
    • Select Paste/Fetch Data
    • Paste the link into the text field
    • Press Start
    • Close the windowBy default, Galaxy uses the URL as the name, so rename the files with a more useful name.

question Questions

Why is it mandatory to clip the adapters from the small RNA-seq data?

solution Solution

Generally, the processed RNA fragments from the small RNAs are about 18-30nt long. If the sequenced read length is longer than the fragment (which is usually the case), the sequencer reads into the 3’ adapter.

Sort BAM file

Before continue to BAM to BED conversion we need to sort the alignments in the input BAM file by their positions.

hands_on Hands-on: Sort BAM

  1. Samtools sort tool with the following parameters:
    • param-file “BAM File”: GSM769512.bam

BAM to BED of tags

Now it is time to do the actual conversion.

hands_on Hands-on: BlockClust preprocessing

  1. BlockClust tool with the following parameters:
    • “Select mode of operation”: Pre-processing
    • param-file “BAM file containing alignments”: output of Samtools sort tool

Grouping of the adjacent reads into read profiles

Now we group the adjacent reads into so-called blocks and blockgroups using blockbuster tool. In general, each blockgroup should represent a single ncRNA read profile.

blocks of a blockgroup
Figure 2: Representation of blocks and blockgroups of a read profile

details More details about the theory

The idea is to perform peak detection on the signal obtained by counting the number of reads per nucleotide. This signal, spanning adjacent loci, is then modeled with a mixture of Gaussians. An iterative greedy procedure is then used to collect reads that belong to the same block, starting from the largest Gaussian component, and removing them in successive iterations. The tool further assembles a sequence of adjacent blocks into a blockgroup if the blocks are either overlapping or are at a distance smaller than a user-defined threshold. A more detailed explanation is at the blockbuster website

Sort the BED file of tags

In order to run the blockbuster successfully the input BED file need to be sorted by chromosome, strand, start position and then end positions.

hands_on Hands-on: Sort the BED file

  1. Sort tool with the following parameters:
    • param-file “Sort Query”: output of BlockClust tool
    • In “Column selections”:
      • “on column”: Column: 1
      • “Flavor”: Alphabetical sort
    • Click on “Insert Column selections”:
    • In “Column selections”:
      • “on column”: Column: 6
      • “Flavor”: Alphabetical sort
    • Click on “Insert Column selections”:
    • In “Column selections”:
      • “on column”: Column: 2
      • “Flavor”: Fast numeric sort
    • Click on “Insert Column selections”:
    • In “Column selections”:
      • “on column”: Column: 3
      • “Flavor”: Fast numeric sort
    • “Ignore case”: Yes

Group reads into blocks and blockgroups using blockbuster

hands_on Hands-on: blockbuster

  1. blockbuster tool with the following parameters:
    • param-file BED file containing read expressions”: output of Sort tool
    • “Type of output”: reads (blockbuster format)

Clustering with BlockClust

Here we use BlockClust in clustering mode. All you need here is the output of the blockbuster.

Apart from clustering, BlockClust has built-in class specific discriminative models for C/D box snoRNA, H/ACA box snoRNA, miRNA, rRNA, snRNA, tRNA and Y_RNA. So it can also be used to predict if a read profile might belong to one of the known ncRNA class.

hands_on Hands-on: clustering

  1. BlockClust tool with the following parameters:
    • “Select mode of operation”: Clustering and classification
      • param-file “Input blockgroups file”: output of blockbuster tool
      • “Select reference genome”: Human (hg19)
      • “Would you like to perform classification?”: Yes
      • “Mode of classification”: Model based

The tool produces the following four output files.

The BlockClust: BED of predicted clusters file is the result of Markov cluster algorithm. Each entry in this file represents a blockgroup. The 4th column contains is in the form of annotation:blockgroup_id:cluster_id. The cluster_id represents which cluster the blockgroup belongs to.

The BlockClust: Model based predictions BED file is the result of classification. Each entry in this file represents a blockgroup. The 4th column contains the annotation of the ncRNA which it overlaps. For the blockgroups which are not overlapped with any known ncRNAs, the prefix predicted_ is added indicating that it is predicted by the BlockClust classification models.

The BlockClust: Hierarchical clustering plot file shows a dendrogram construced based on average linkage clustering.

The BlockClust: Pairwise similarities file contains the pairwise similarities of all input blockgroups.

Next, we will visualize the read profiles (from the BAM file) and the predictions (BED from BlockClust) together.

hands_on Hands-on: visualization

  1. Install IGV (if not already installed)
  2. Start IGV locally
  3. Expand the param-file GSM769512.bam file
  4. Click on the local in display with IGV to load the reads into the IGV browser
  5. Expand the param-file BlockClust: Model based predictions BED file
  6. Click on the local in display with IGV to load the reads into the IGV browser
  7. Go to the location chr4:90653059-90653141 in IGV.

question Questions

  1. Do you see any already annotated transcript in that location?
  2. What does the read profile resemble?
  3. What did BlockClust predict?

solution Solution

  1. There is no annotated gene from RefSeq annotation on the same strand.
  2. It resembles the miRNA profiles mentioned in the introduction section. One of the read piles looks like mature miRNA and the other like miRNA*.
  3. Predicted as a miRNA.

comment Comments

In order for this step to work, you will need to have either IGV or Java web start installed on your machine. However, the questions in this section can also be answered by inspecting the IGV screenshots below.

Check the IGV documentation for more information.


In this tutorial, we learned how to use BlockClust to cluster real small RNA sequencing read profiles based on their similarity. We also learned that the BlockClust can also be used to classify the read profiles based on pre-built classification models.

keypoints Key points

  • Small non-coding RNA read profiles are often associate with function

  • Clusters of read profiles correlate with the ncRNA classes

Frequently Asked Questions

Have questions about this tutorial? Check out the FAQ page for the Transcriptomics topic to see if your question is listed there. If not, please ask your question on the GTN Gitter Channel or the Galaxy Help Forum

Useful literature

Further information, including links to documentation and original publications, regarding the tools, analysis techniques and the interpretation of results described in this tutorial can be found here.


Did you use this material as an instructor? Feel free to give us feedback on how it went.

Click here to load Google feedback frame

Citing this Tutorial

  1. Pavankumar Videm, 2021 Small Non-coding RNA Clustering using BlockClust (Galaxy Training Materials). /training-material/topics/transcriptomics/tutorials/small_ncrna_clustering/tutorial.html Online; accessed TODAY
  2. Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012

details BibTeX

    author = "Pavankumar Videm",
    title = "Small Non-coding RNA Clustering using BlockClust (Galaxy Training Materials)",
    year = "2021",
    month = "03",
    day = "12"
    url = "\url{/training-material/topics/transcriptomics/tutorials/small_ncrna_clustering/tutorial.html}",
    note = "[Online; accessed TODAY]"
        doi = {10.1016/j.cels.2018.05.012},
        url = {},
        year = 2018,
        month = {jun},
        publisher = {Elsevier {BV}},
        volume = {6},
        number = {6},
        pages = {752--758.e1},
        author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\`{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning},
        title = {Community-Driven Data Analysis Training for Biology},
        journal = {Cell Systems}

congratulations Congratulations on successfully completing this tutorial!