mitoNGS / MToolBox

A bioinformatics pipeline to analyze mtDNA from NGS data
http://sourceforge.net/projects/mtoolbox/?source=navbar
GNU General Public License v3.0
90 stars 38 forks source link

Mtoolbox.sh, issue with large number of samples #73

Closed psterk closed 5 years ago

psterk commented 5 years ago

The following line of code fails silently when the argument line becomes too long for ls:

if [[ ls -1 OUT*/*annotation.csv 2> /dev/null | wc -l -gt 0 ]]

This can be fixed by using find/xargs instead of ls:

if [[ find OUT* -name "*annotation.csv" 2> /dev/null | wc -l -gt 0 ]]

Same with two occurrences of:

for i in $(ls -d OUT_/ annotation.csv)

Can be fixed as follows:

for i in $(find OUT_/ -name "annotation.csv")

clody23 commented 5 years ago

Hi, thank you. Very well spotted! We have incorporated the fix you suggested.

https://github.com/mitoNGS/MToolBox/commit/a8293cd1b647e3fa498db8151660d4a965b382a0

Best, Claudia