I have multiple gff files that I want to edit the start and end by 5 bp in batch. I found a relevant answer here for single file, but I could not add comment there. The awk line works for my files if processing only one file, but when I try to do the same thing in batch, it returns syntax error. How should I do it with parallel?
> ls ./*ratio.gff.gz | parallel "zcat {} | head | awk -F'\t' -v OFS='\t' '/^[^#]/{$5-=5}{$4+=5}1' "
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
awk: line 1: syntax error at or near -=
awk: line 1: syntax error at or near +=
> zcat xxxx_ratio.gff.gz | head | awk -F'\t' -v OFS='\t' '/^[^#]/{$5-=5}{$4+=5}1'
##gff-version 3 5
# biweight_mean=-0.22621330627900907 5
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5136 5179 0.60 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005131;count=2
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5181 5229 0.65 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005176;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5241 5287 0.41 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005236;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5286 5327 0.09 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005281;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5406 5452 0.92 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005401;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5466 5519 0.98 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005461;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5506 5559 0.26 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005501;count=1
chr2L NimbleScan 31945102:MA_larvae_Exp1/MA_larvae_Ctrl1:BLOCK1 5576 5628 0.41 . . seq_id=chr2L:1-23011544;probe_id=CHR02LFS000005571;count=1
Thank you!
ls | command
, that is asking for trouble. To be fair, it isn't causing issues here, but it is still a bad habit. $\endgroup$