View Single Post
Old 10-05-2016, 01:42 AM   #5
Junior Member
Location: Asia

Join Date: Sep 2012
Posts: 7

Originally Posted by mthornton View Post

I would use this script

It uses SPP as well. It's convenient.
Dear All,

I am a newbie in ChIP-seq analysis and now I am trying to assess these 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.
zgene is offline   Reply With Quote