kundajelab / phantompeakqualtools

This package computes informative enrichment and quality measures for ChIP-seq/DNase-seq/FAIRE-seq/MNase-seq data. It can also be used to obtain robust estimates of the predominant fragment length or characteristic tag shift values in these assays.
BSD 3-Clause "New" or "Revised" License
55 stars 17 forks source link

awk: line 2: function and never defined #21

Closed RRebo closed 2 years ago

RRebo commented 2 years ago

Hello, The conversion from BAM to tagAlign is not working for me. It gives me the following error: awk: line 2: function and never defined. Any ideas? I'm sure I'm just forgetting something in the command line...

samtools view -F 0x0204 -o - CNVR192.R1.filtered01.bam | awk 'BEGIN{OFS="\t"}{if (and($2,16) > 0) {print $3,($4-1),($4-1+length($10)),"N","1000","-"} else {print $3,($4-1),($4-1+length($10)),"N","1000","+"} }' | gzip -c > CNVR192.tagAlign.gz

Thanks. Rita

RRebo commented 2 years ago

Solved this by using gawk instead of awk. Rita