Export reads from an alignment file
0
0
Entering edit mode
6.5 years ago
elena.syp • 0

Hi! I have annotated some clustered genes in a very fragmented genome assembly based on Illumina reads. I want to study their synteny (impossible in the assembly I have) and I have a lot of nanopore reads as well. I had aligned the nanopore reads to the Illumina annotated-genes using BWA and I have now an alignment file. I now want to get the COMPLETE SEQUENCE of the reads aligning to my reference (so I can make a local assembly of those reads and hopefully get the synteny) and NOT ONLY THE PART OF THE READS THAT ALIGN TO THE REFERENCE. Is it possible to do that? How can I do it? Thanks a lot!

nanopore mapping bwa samtools sam • 1.5k views
ADD COMMENT
0
Entering edit mode

samtools view | cut?? #oramimissingsomething ?

ADD REPLY
0
Entering edit mode

As per Pierre, you can just use samtools view -b -f 0x2 MyBAM.bam in order to extract just the reads that have aligned successfully to your genome (assuming paired-end). You can then use the cut command in combination in order to pull out information relating to read positions if you want to group them into specific loci prior to performing local assembly.

Another way to extract aligned reads over a defined genomic region is, for example:

samtools view -b -f 0x2 MyBAM.bam 5:135396277-135396306
ADD REPLY

Login before adding your answer.

Traffic: 2826 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6