0
我想重写一个for循环(这很好用)并将其作为并行运行,但我有各种各样的问题。这里是我的循环重写一个for循环与“并行”一起使用
function no_sam {
filename=$(basename "$file")
extension="${file##*.}"
if [ $extension = "sam" ];
then
filename="${filename%.*}"
feat_out=$filename.out
htseq-count -f $types -r "$pos" -m "$mode" -i "$attribute" -s "$strand" -t "$feature" -a "$qual" "$file" "$input_gff" > "$feat_out"
grep -v "_" "$feat_out" > temp && mv temp "$feat_out"
mv "$feat_out" "$counts_folder"
elif [ $extension = "bam" ];
then
filename="${filename%.*}"
feat_out=$filename.out
htseq-count -f $types -r "$pos" -m "$mode" -i "$attribute" -s "$strand" -t "$feature" -a "$qual" "$file" "$input_gff" > "$feat_out"
grep -v "_" "$feat_out" > temp && mv temp "$feat_out"
mv "$feat_out" "$counts_folder"
fi
}
for file in "${multi[@]}"; do
no_sam
done
当我更换了与GNU并行循环,我得到错误
"${multi[@]}" no_sam | parallel
testfile.sam: command not found
通过shellcheck.net和'bash -x'运行你的脚本。 – codeforester
我已经做了。这是我如何运行“并行”软件的问题。 – upendra
您是否解决了shellcheck报告的问题? – codeforester