131 | | # For sam files: |
132 | | grep -v "XS:i" | grep "AS:i" foo.sam >| foo_uniquely_mapped.sam |
133 | | # For bam files: |
134 | | samtools view -h foo.bam |grep -E -v "XS:i"|grep -E "@|AS:i" |samtools view -b - >| foo_uniquely_mapped.bam |
| 131 | # For sam/bam files generated by bowtie2: |
| 132 | grep -v "XS:i" | grep "AS:i" All.sam >| Uniquely_mapped.sam |
| 133 | samtools view -h All.bam | grep -E -v "XS:i" | grep -E "@|AS:i" | samtools view -b - >| Uniquely_mapped.bam |
| 134 | # For any bam files |
| 135 | samtools view -b -q 10 All_reads.bam > Uniquely_mapped.bam |