<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _mirbase_stats(data, out_dir):
 """Create stats from miraligner"""

    utils.safe_makedir(out_dir)
    out_file = os.path.join(out_dir, "%s_bcbio_mirbase.txt" % dd.get_sample_name(data))
    out_file_novel = os.path.join(out_dir, "%s_bcbio_mirdeeep2.txt" % dd.get_sample_name(data))
    mirbase_fn = data.get("seqbuster", None)
    if mirbase_fn:
        _get_stats_from_miraligner(mirbase_fn, out_file, "seqbuster")
    mirdeep_fn = data.get("seqbuster_novel", None)
    if mirdeep_fn:
        _get_stats_from_miraligner(mirdeep_fn, out_file_novel, "mirdeep2")
    return {"base": out_file, "secondary": [out_file_novel]}