Hi Everyone,
I am trying to list the tags within my BAM file using following command:
samtools view input.bam | cut -f 12- | tr '\t' '\n' | cut -d ':' -f 1 | awk '{ if(!x[$1]++) { print }}'
But it's taking so long for larger BAMs to output the tag names. I have more than 30 BAMs for different WGS samples. Is there any way to optimize my command-line to run it faster?
I have cluster available and we use PBS as job scheduler software.
I want my command to run fast. please help!
Thanks!
for i in *.bam ; do echo "samtools view $i | cut -f 12- | tr '\t' '\n' | cut -d ':' -f 1 | awk '{ if(!x[$1]++) { print }} > $i.out'" | qsub ; done ;