Extract unmapped sequenced from a sam file output from minimap2
1
0
Entering edit mode
3.8 years ago
ja569116 • 0

Hi, I am interested in using PSMC to run a historic population size analysis and I ran into a problem. I assembled the genome of my species using a reference, and got the consensus for PSMC, but I forgot to separate autosomes from X and Y chromosomes. Including those in PSMC biased the results.

I have 92 scaffolds in my assembly, and I have merged the X and Y mouse chromosomes to then get only the autosomes. I used minimap2 to map my scaffolds to the merged file, but I do not know what else to do. I posted a question in the minimap2 github forum for help to split those, and got the useless/stupid response: "You can write a python/perl script to do that.". Well, I do not know perl nor python for doing that.

How can I get the unmapped scaffolds from the sam file output from minimap2?

Thanks;

get unmapped reads from sam file • 1.4k views
ADD COMMENT
0
Entering edit mode

Your post is unclear since you are referring to getting unmapped sequences in title but then are referring to getting only scaffolds mapped to autosomes in body of the question.

For the latter you can take a look at @Pierre's answer here: A: Extract ONLY chromosomes 1-22 from bam file - removing extraneous chr annotation

ADD REPLY
0
Entering edit mode
3.8 years ago
JC 13k

you can use samtools to extract the unmaped reads:

samtools fasta -f 4 <align.sam>
ADD COMMENT

Login before adding your answer.

Traffic: 2708 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