...
So, we would like to use an alignment strategy that can intelligently ignore the parts that won't align to a reference (the 'adapter') and align correctly the parts that align well. This is called a 'local' alignment, in contrast to a 'global' alignment, which would count the 'mismatches' in the adapter against the alignment score. Fortunately, you have already used a local-alignment-capable aligner in this class. Tophat2 runs on the Bowtie2 alignment engine, which (if used directly, i.e. not with Tophat2), can perform local alignment. So, that won't be a problem.
But wait! The other major issue here is that a given miRNA sequence may occur many times in the genome, and each locus will produce an identical mature miRNA sequence.
Exercise #2: Ribonucleoprotein Immunoprecipitation and Sequencing (RIP-seq)
...