I have converted a paired of fastq files to a bed file using the code below:
bowtie2 --end-to-end --very-sensitive --no-mixed --no-discordant --phred33 -I 10 -X 700 -p ${cores} -x ${ref} -1 ${fastQR1} -2 ${fastQR2} -S ${samFile} &> ${txtFile}
samtools view -bS -F 0x04 $proj/a.sam >$proj/a.bam
bedtools bamtobed -i $proj/a.bam -bedpe >$proj/a.bed
And now the head of my bed file look like below:
chr1 242251375 242251525 chr1 242251390 242251540 NS500442:247:HKWKNAFX2:1:11101:3060:1048 17 + -
chr9 41169424 41169574 chr9 41169494 41169644 NS500442:247:HKWKNAFX2:1:11101:14485:1058 1 + -
It has 10 columns, but I ahve no idea why there are duplicate chromosome location here and how can I iport this to R as GRange object. Any idea?