Entering edit mode
18 months ago
وفاء
•
0
I used samtools to convert Bam paired files to Fastq, and I'd like to see if the conversion was successful. I attempted to check the read names with the following commands:
comm -1 -2 bam_read_names.txt (paste fastq1_read_ids.txt fastq2_read_ids.txt | sort) > common_read_names.txt
However, the common_read_names.txt file is empty.
How do you tackle this problem and ensure that the conversion is correct? Is there another way to check?
paste fastq1_read_ids.txt fastq2_read_ids.txt is a tabular file with two column. Is it the same for bam_read_names.txt ?
At first, I would trust samtools to do the right thing but of course it doesn't hurt to double check. But I think the crux is what is in fastq1|2_reads_ids.txt and bam read_read_names.txt and how did you get them? The first thing I would do always is look at the files and also the fastq files using head or less. Likely the files are properly sorted already, then you will immediately see what's wrong. If they are not properly sorted you have to do that too. Because for this command to work both files need to be sorted in the same way.
comm
also has an option--check-order
that might help you there.