Issue with reverting bam file back to fastq files
0
0
Entering edit mode
5.7 years ago

Hi,

I have some old bam files that I don't have the original fastq files for. I tried using picard Samtofastq but I am having an issues when I realign the reads. I have been using picard to revert the old bam files back to fastq files, bwa to align the reads, and picard to sort and deduplicate. I used samtools flagstat to check out what was going on with my new bam files and this is what I got

473763117 + 0 in total (QC-passed reads + QC-failed reads)
1618429 + 0 secondary
0 + 0 supplementary
24690025 + 0 duplicates
473247331 + 0 mapped (99.89% : N/A)
472144688 + 0 paired in sequencing
236072344 + 0 read1
236072344 + 0 read2
466910892 + 0 properly paired (98.89% : N/A)
471430496 + 0 with itself and mate mapped
198406 + 0 singletons (0.04% : N/A)
3805718 + 0 with mate mapped to a different chr
2458472 + 0 with mate mapped to a different chr (mapQ>=5)

I have checked out my files and it doesn't look like it is an issue with bwa or picard sort/deduplicate. The only thing I can think of is that there is some issue with picard samtofastq

This is the command I use

java -jar picard.jar SamToFastq I=C01767.bam FASTQ=C01767.R1.fastq SECOND_END_FASTQ=C01767.R2.fastq

Am I doing something wrong here?

I know GATK has a way to do this, but their method only give you one files here. I kind of want both of the fastq files

next-gen assembly genome alignment • 2.3k views
ADD COMMENT
1
Entering edit mode

Never used picard to convert bam to fastq. For paired end, I use bedtools. Did you sort the bam by name before conversion?

ADD REPLY
0
Entering edit mode

I did not sort the bam files by name before conversion. What does that do?

ADD REPLY
1
Entering edit mode

That brings paired-end reads (R1/R2) next to each other in the alignment file.

ADD REPLY
1
Entering edit mode

Why not use samtools fastq? (equivalent to samtools bam2fq).

ADD REPLY
0
Entering edit mode

I can give it a try. Hopefully that will help

ADD REPLY
1
Entering edit mode

What is the problem? Your alignment stats seems fine to me.

ADD REPLY
0
Entering edit mode

Maybe I missed it, but what's wrong?

ADD REPLY
0
Entering edit mode

When I use samtools mpileup, there are no variants being called. All the other samples have variants being called except the samples that were originally old bam files.

ADD REPLY
2
Entering edit mode

What is the exact command you're using. samtools mpileup doesn't directly call variants any more, bcftools call does.

ADD REPLY
0
Entering edit mode

I think that this is important information you should mention in your initial question, rather than to make us guess what the question is actually about.

ADD REPLY
0
Entering edit mode

Hello williamsbrian5064,

you needn't reply to each comment with the same text. Everyone who is participating in this thread gets noticed if there is a new post. So we decided to delete your duplicate posts to keep the focus on your problem.

fin swimmer

ADD REPLY
0
Entering edit mode

Thanks for doing that finswimmer! I apologize for that. I didn't realize that everyone got a notification.

Sorry that I didn't mention my initial question. This is the command that I am putting in. Some of the tags are a bit out of data. I mean samtools mpileup works fine with the other 30 samples, so I don't know if it is a samtools mpileup vs bcftools call issue?

samtools mpileup --redo-BAQ --min-BQ 30 --per-sample-mF -C 50 --output-tags DP,DV,DPR,INFO/DPR,DP4,SP -r X:1-126427096 -u -f inputfasta.fa --BCF input.bam > output.vcf
ADD REPLY
0
Entering edit mode

It would be helpful to edit the original question and add this information there. This thread has already got somewhat out of hand.

ADD REPLY
0
Entering edit mode

Your flagstats looks fine to ne. What do you think is wrong?

fin swimmer

ADD REPLY

Login before adding your answer.

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