Entering edit mode
6.5 years ago
star
▴
350
I have some ChIP-seq data with 36 bp read length and I have done aligning with bowtie2 with below cod:
bowtie2 --very-sensitive --score-min C,0,0 -p 8 -x Genome_Index input.fastq.gz -S output.sam
and then I have tried to extract only 1 exact match with below cod:
samtools view -hf 0x2 output.sam | grep -v "XS:i:" > unique_output.sam
but I do not know why I get unique_output.sam
without no data?, while the size of my output.sam
is 4.6 GB. I also tried below cod:
samtools view output.sam | grep -v "XS:i:" > unique_output.sam
and I got the unique_output.sam
file with 2.2 GB.
Hello,
as far as I know the 0x2 flag means "properly paired". Do you have paired-end reads?
fin swimmer
https://broadinstitute.github.io/picard/explain-flags.html
@h.mon, thanks ! So , use grep _v xs:i, would be enought to extract 1 match reads?
Dear Fin,
No in this case is single end, you are right! So I should not use 0x2 and just removing xi:s would be fin, right?