Hi everyone,
What I have:
A bam file with 10kb MP reads mapped back to an in house reference genome assembled in Allpaths-LG. Going to be used for visual inspection in IGV and Geneious to evaluate a possible scaffold break up suggested by linkage map.
What I want:
To extract a new bam file that contains the mapped reads for only one of the scaffolds in my reference genome.
Problem:
samtools view -b mybamfile.bam 'scaffold000046' > scf000046.bam
The resulting file lists all the original scaffolds in the header, like this:
@SQ SN:scaffold_0 LN:21965366
@SQ SN:scaffold_1 LN:18670197
@SQ SN:scaffold_2 LN:16657575
@SQ SN:scaffold_3 LN:15264954
@SQ SN:scaffold_4 LN:14680565
...
I may have misunderstood the output of the above command, but I expected to find only the target scaffold in the new bam-file header.
Any help would be much appreciated. Feel free to direct me if the solution for my problem has already been posted elsewhere. However, have not succeeded in finding one.
Best,
Tore
What I have:
A bam file with 10kb MP reads mapped back to an in house reference genome assembled in Allpaths-LG. Going to be used for visual inspection in IGV and Geneious to evaluate a possible scaffold break up suggested by linkage map.
What I want:
To extract a new bam file that contains the mapped reads for only one of the scaffolds in my reference genome.
Problem:
samtools view -b mybamfile.bam 'scaffold000046' > scf000046.bam
The resulting file lists all the original scaffolds in the header, like this:
@SQ SN:scaffold_0 LN:21965366
@SQ SN:scaffold_1 LN:18670197
@SQ SN:scaffold_2 LN:16657575
@SQ SN:scaffold_3 LN:15264954
@SQ SN:scaffold_4 LN:14680565
...
I may have misunderstood the output of the above command, but I expected to find only the target scaffold in the new bam-file header.
Any help would be much appreciated. Feel free to direct me if the solution for my problem has already been posted elsewhere. However, have not succeeded in finding one.
Best,
Tore
Comment