# featureCounts running error in metwibele preprocess

**URL:** <https://forum.biobakery.org/t/featurecounts-running-error-in-metwibele-preprocess/6464>\
**Category:** MetaWIBELE\
**Created:** [January 15, 2024, 5:07am UTC](https://forum.biobakery.org/t/featurecounts-running-error-in-metwibele-preprocess/6464 "2024-01-15T05:07:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kim-Gihyeon](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kim-gihyeon/32/2182_2.png) [@Kim-Gihyeon](https://forum.biobakery.org/u/Kim-Gihyeon)\
**Post date:** [January 15, 2024, 5:07am UTC](https://forum.biobakery.org/t/featurecounts-running-error-in-metwibele-preprocess/6464/1 "2024-01-15T05:07:23Z")

</div>

Hi.  
Thank you for developing this tool!

I have a problem with running metawibele preprocess (version 0.4.6) using shotgun metagenomic sequencing paired reads from human feces.

The input reads were QC-filtered by Kneaddata.

The code that I’ve run:  
`metawibele preprocess --input /data/data/GNC/HN00206838/0.RawData/Knead_outs/ --output /data/data/GNC/HN00206838/0.RawData/01_preprocess/ --output-basename demo --extension-paired "0041_kneaddata_paired_1.fastq,0041_kneaddata_paired_2.fastq" --extension ".fastq" --local-jobs 10 --threads 70`

The error message I’ve got:

```auto
01/15/2024 12:18:38 PM - LoggerReporter - INFO: Executing with shell: metawibele_gene_abundance -r /home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/finalized/demo_genecatalogs.centroid.fna -u /data/data/GNC/HN00206838/0.RawData/Knead_outs/changed_2102420041_kneaddata_paired_1.fastq,/data/data/GNC/HN00206838/0.RawData/Knead_outs/changed_2102420041_kneaddata_paired_2.fastq -t 70 -s changed_210242 -w /home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/mapping/changed_210242 > /home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/mapping/changed_210242/changed_210242.mapping.stdout.log 2>&1 
01/15/2024 12:51:55 PM - anadama2.helpers - INFO: Execution complete. Stdout: 
Stderr: 
01/15/2024 12:51:55 PM - LoggerReporter - ERROR: task 31, changed_210242__gene_abundance : Failed! Error message : Failed to produce target `/home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/mapping/changed_210242/changed_210242.sort.bed'. Original exception: Traceback (most recent call last):
  File "/home/gihyeon/.local/lib/python3.10/site-packages/anadama2/runners.py", line 219, in _get_task_result
    targ_compares.append(list(target.compare()))
  File "/home/gihyeon/.local/lib/python3.10/site-packages/anadama2/tracked.py", line 379, in compare
    stat = os.stat(self.name)
FileNotFoundError: [Errno 2] No such file or directory: '/home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/mapping/changed_210242/changed_210242.sort.bed'

```

When I ran the demo version there is no error, and I figured out the demo.sort.bed file has

```auto
# Program:featureCounts v2.0.3; Command:"featureCounts" "-F" "SAF" "-T" "4" "-a" "/home/gihyeon/Pipelines/Metawibele/demo/01_preprocess/finalized/demo_genecatalogs.centroid.saf.gtf" "-o" "sample1.sort.bed" "sample1.sort.bam"

```

So, I applied that featureCounts command structure to my real sample as the below code and it was well done.

```auto
featureCounts -F SAF -T 4 -a ~/Pipelines/Metawibele/GEN001_201/01_preprocess/finalized/demo_genecatalogs.centroid.saf.gtf -o ./changed_210242.sort.bed 01_preprocess/mapping/changed_210242/changed_210242.sort.bam

```

It is difficult for me to find out what is the problem with `metawibele preprocess`.  
Could you help me?

Thank you in advance.  
Gihyeon.

---

<div class="post-metadata">

**Author:** ![YancongZhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/yancongzhang/32/1176_2.png) [@YancongZhang](https://forum.biobakery.org/u/YancongZhang)\
**Post date:** [January 15, 2024, 4:02pm UTC](https://forum.biobakery.org/t/featurecounts-running-error-in-metwibele-preprocess/6464/2 "2024-01-15T16:02:01Z")

</div>

Hi Gihyeon,

It looks like something was disordered during the `metawibele_gene_abundance` step. Could you check its log file (i.e. `/home/gihyeon/Pipelines/Metawibele/GEN001_201/01_preprocess/mapping/changed_210242/changed_210242.mapping.stdout.log`) and see if you can find more information about the error?

Thanks!  
Yancong

---

<div class="post-metadata">

**Author:** ![Kim-Gihyeon](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kim-gihyeon/32/2182_2.png) [@Kim-Gihyeon](https://forum.biobakery.org/u/Kim-Gihyeon)\
**Post date:** [January 16, 2024, 8:10am UTC](https://forum.biobakery.org/t/featurecounts-running-error-in-metwibele-preprocess/6464/3 "2024-01-16T08:10:25Z")

</div>

Hi Yancong,

I appreciate your valuable help…!  
I have took a look into the log file and found out that

```auto
command:featureCounts -F SAF -T 70 -a /home/gihyeon/Pipelines/Metawibele/GEN001_201/01>
Value for argumant -T is out of range: 1 to 64

```

The problem was due to the limitation of the thread of featureCounts, which is up to 64 (I set 70).

`metawibele preprocess --input /data/data/GNC/HN00206838/0.RawData/Knead_outs/ --output /data/data/GNC/HN00206838/0.RawData/01_preprocess/ --output-basename demo --extension-paired "0041_kneaddata_paired_1.fastq,0041_kneaddata_paired_2.fastq" --extension ".fastq" --local-jobs 10 --threads 64` was well working.

Thank you for your help.  
Gihyeon.
