This is a test version of Biostars. For the public version, visit https://www.biostars.org.
An error when using ENCODE-Phantompeakqualtools

Dear All,

I am a newbie in ChIP-seq analysis and now I am trying to assess NSC/RSC values using "phantompeakqualtools", but unfortunately I got an error and cant find any similar posts for that. Would you please help me !

I used this command to determine strand cross-correlation peak:

Rscript /data/NGS/phantompeakqualtools/run_spp.R -c=ChIP-WT1-R2-BWA_sorted_unique.bam -savp -out=R2unique-phantom

and I got the following error:

awk: line 2: function and never defined
Error converting BAM to tagalign file: /tmp/RtmpbkYntW/ChIP-WT1-R2-BWA_sorted_unique.bam6f036a95b6e

I assumed that the error was due to the input file and tried the following command to first convert BAM to tagalign

samtools view -F 0x0204 -o - ChIP-WT1-R1_sorted_unique.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 > ChIP-WT1-R1_sorted_unique.tagAlign.gz

and again I got the following error;

awk: line 2: function and never define

So, now I know that the problem is due to awk. But I can't understand what it is exactly!

I would be happy to hear your comments.

Thanks in advance.

chip-seq r awk nsc rsc

What operating system are you using? I'm not sure the and() function exists in all variants of awk.

More like which awk :)

I never see and function in any awk versions, except user-defined functions in this case.

This is a difference between gawk and mawk, which also distinguishes between OS X and Linux (typically).

The operating system which I ma working is Linux 14.04. At the end, I found that I should install gawk and then it worked properly.

Thanks ..

0 answers

No answers yet.

Log in to answer this question.