Hi Alex,
Along the lines in this post, I was wondering if you would consider adding the option to STAR execution to restrict the SAM/BAM output to only the primary read (for both unique and multimappers), rather than having to pipe to samtools to do this. I would be great to be able to restrict output in this way and still take advantage of your new options to output in sorted BAM format.
Also rather than use your custom script, is there an option in STAR to restrict the SJ.tab.out file based on the SAM/BAM alignments, now that you have included the option to output as sorted BAM? I know that there is an option for the reverse, to restrict the SAM/BAM based on SJ.tab.out, but I don't think I saw the reverse. Not sure if it would even be possible, but thought I'd ask. Reason being is that we have some junctions that are many (80-90) but all are from multimappers. We have been focusing on just uniquely mapped reads, so as to reduce false positives, but in doing so we are throwing out some true junctions. We could re-capture some of those junctions that we are throwing out right now using this method in the post to output only the primary alignment from a read, then run your awk script to adjust the SJ.tab.out file based on the SAM file.
Wonderful tool and many thanks,
Craig