Frequently Asked Questions

Despite the description of  examples in the documentation, several scenarios require a very specific use of CRAC. That is why we propose in this tutorial some additional filters (or wrapper) for adjusting certain problems.

How to use SAM CRAC format for Cufflinks software

In fact, Cufflinks needs XS field for splices but we do not know why.  Thus, we need to:

  1. add to the SAM file generated by CRAC the additional field, 
  2. remove 0N in CIGAR from CRAC SAM's file, otherwise cufflinks complains about it
  3. replace = and X in CIGAR from CRAC SAM's file by M 
  4. and SAM file must also be sorted.

awk -F'\t' 'BEGIN{OFS="\t"} $6 ~ /N/ {xs="XS:A:"; if (and($2, 16) > 0) {xs=xs"-"} else {xs=xs"+"}; $(NF+1)=xs} $6 ~ /[X=]/ {gsub(/[X=]/, "M", $6)}  $6 !~ /[A-Z]0N/{print}' file.sam | sort -k 3,3 -k 4,4n > file.cufflinks.sam