Entering edit mode
2.6 years ago
nonaddldy ▴ 10
I used the bam file into UCSC Genome Browser, then I want to assembly these reads into the sequence at chromosome level, what should I do?
I mean how to extract the reads according to the nucleotide order of GRCh38 reference sequence
it's not clear to me.
A BAM file typically contains the genome location where individual (short) reads have aligned to. This seems to have been successful in your case as the snapshot shows.
What exactly is it that you're after? Do you simply want a text file with the ACGTs that make up, say, chromosome 1? That would be the reference sequence, i.e. the FASTA file that you used to generate the BAM file in the first place.
I want to assembly an individual human chromosome Y rather than reference sequence, so I should sort the reads and output the sequence according the order of reference human Y, while the reads in the bam file are in disorder, thus, my question is how sort the reads aligned to the chromosome Y by the nucleotide order.
You can use
samtools sort -o sorted.bam input.bamon your aligned BAM. Samtools does co-ordinate sort by default.
Thanks a lot