The difference between sam files
0
0
Entering edit mode
7.4 years ago

Hi all! I want to compare the result of alignment of reads that has the same name in two .sam files, especially the difference in CIGAR flags.

Is there any fast way to implement?

alignment sequencing samtools sam • 2.9k views
ADD COMMENT
1
Entering edit mode

You should try to explaing better what you wan't to do. CompareSAMs and CompareMetrics might be helpful. If you want more help, edit the question and explain better what you wanna do.

ADD REPLY
0
Entering edit mode

Thanks for your answer. To be more specific,first,I have an fastq file and I align it to the reference genome and get 1.sam, then I deal with some of the reads in the fastq file and align it to the reference genome again and get 2.sam, and now I want to compare the CIGAR flags of the reads with the same name between 1.sam and 2.sam to know the effect of alignment of my change in the fastq file.

ADD REPLY
0
Entering edit mode

Are you expecting there to be differences? Due to different options used during alignments (assuming everything else is identical)?

ADD REPLY
0
Entering edit mode

more simply.

I want to know how to extract the CIGAR flags of the same readID from two different sam files. Thanks.

ADD REPLY
0
Entering edit mode

do you know how to code in python?

P.D: Edit the original answer, this will allow others to search the question

ADD REPLY
0
Entering edit mode

I know how to simply achieve this but I want to find a fast way because the sam file can be huge.

ADD REPLY
0
Entering edit mode

You can achieve speed by sorting the bam files by query name, then, you can loop trough both files

ADD REPLY
0
Entering edit mode

And you still have not told us why you want to do this ..

ADD REPLY

Login before adding your answer.

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