An error when using ENCODE-Phantompeakqualtools
0
0
Entering edit mode
8.1 years ago
Z-F ▴ 20

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 • 2.6k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

More like which awk :)

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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 ..

ADD REPLY

Login before adding your answer.

Traffic: 2646 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6