<commit_before>#! /usr/bin/env python
"""A suite to test file_exist."""
import os
import pytest
import luigi
from piret.Runs import Summ
from plumbum.cmd import rm



def test_star():
        """Test star index creation and mapping."""
        luigi.interface.build([featurecount.FeatureCountsII(gff="tests/data2/chr22_ERCC92.gff3",
                               num_cpus=1, stranded=1, out_dir="tests/test_featurecount",
                      bam_list=["tests/data2/chr22.bam", "tests/data2/chr22.bam"])], local_scheduler=True)
        assert os.path.exists("tests/test_featurecount/gene_count.tsv") is True

        rm_cmd = rm["-rf", "tests/test_star_mapping"]
        rm_cmd()
<commit_msg>fixing count test with new path<commit_after>#! /usr/bin/env python
"""A suite to test file_exist."""
import os
import pytest
import luigi
from luigi.interface import build
from piret.counts import featurecounts as fc
from plumbum.cmd import rm, cp


def test_featurecount():
    """Test star index creation and mapping."""

    map_dir = os.path.join("tests/test_count", "processes", "mapping", "samp5")
    if os.path.exists(map_dir) is False:
        os.makedirs(map_dir)
    cp_cmd = ["tests/data/samp5_srt.bam", map_dir]
    cp[cp_cmd]()
    
    build([fc.FeatureCounts(fastq_dic={'samp5':''},
                            kingdom="prokarya",
                            gff_file="tests/data/test_prok.gff",
                            workdir="tests/test_count",
                            indexfile="",
                            num_cpus=2,
                            ref_file="tests/data/test_prok.fna",
                            fid="ID",
                            stranded=0)],
                local_scheduler=True)
    assert os.path.exists("tests/test_count/processes/featureCounts/prokarya/gene_count.tsv") is True

    rm_cmd = rm["-rf", "tests/test_count"]
    rm_cmd()

{'fraction_non_alphanumeric': 0.12294647588765235, 'fraction_numerical': 0.010068892421833599, 'mean_word_length': 2.2777777777777777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '894413', 'n_tokens_mistral': 619, 'n_tokens_neox': 604, 'n_words': 119}