Hi All,
My research need to extract sequence from multiple position in sorted bam files.
I have the bam files sorted. I would like to extract and keep sequence from multiple positions according to chromosomal coordination, such as a bed file. I want a new bam/sam/fastq/fasta files keep the reads' name but only keep those sequence and discard sequence outside of the coordination.
For example
reference:
TATCCGA
positions:
0123456
sorted reads:
1. ATCCGA
2. ACCCGT
3. ATCCGT
4.TATCCGA
The positions I interest in is 2 and 6
the reference in position 2 and 6 is T and A
The new sequence after extraction:
1. TA
2. CT
3. TT
4. TA
I have tried intersectbed and cat samtools view. May be I miss some tricks, these attemps only give the whole sequence of reads cover those positions.
Please help.
My research need to extract sequence from multiple position in sorted bam files.
I have the bam files sorted. I would like to extract and keep sequence from multiple positions according to chromosomal coordination, such as a bed file. I want a new bam/sam/fastq/fasta files keep the reads' name but only keep those sequence and discard sequence outside of the coordination.
For example
reference:
TATCCGA
positions:
0123456
sorted reads:
1. ATCCGA
2. ACCCGT
3. ATCCGT
4.TATCCGA
The positions I interest in is 2 and 6
the reference in position 2 and 6 is T and A
The new sequence after extraction:
1. TA
2. CT
3. TT
4. TA
I have tried intersectbed and cat samtools view. May be I miss some tricks, these attemps only give the whole sequence of reads cover those positions.
Please help.