Thank you. This strategy worked.
• 0 views
•
link
Hello,
I am trying to extract long reads from the Blasr .sam output. However, I want to collect the entire raw reads that produced alignments, and not just the aligned segments.
Is there an easy way to do this?
Here is the blasr command I am using:
blasr <reads.fasta> <reference.fasta> -noSplitSubreads -clipping none -sam -out output.sam
I'd assume that the .bam does not have that information. You'd have to get the read ids and get them from the fastq. Something like the following could work. That's what I used to do to extract paired-end reads (in that case the bam needs to be sorted by name).
grep -A3 -F -f <(samtools view <bamfile> | cut -f 1) <source-fastq> | grep -v "\-\-" > <extracted-reads-fastq>
Log in to answer this question.
Grab the read ID's from your SAM file and then pull them out of the original fastq by using
filterbyname.shfrom BBMap.