This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fastq to BAM

I'm new to Galaxy and bioinformatics tool.

I have Fastq data of chicken heavy and light chains and I want to do pca plot on them. I know I have to convert them to BAM file first but I don't know which tool to use - FastqtoSam or Bowtie2. One gave me unaligned BAM and another gave aligned BAM. Then, I used multiBAMsummary tool to see which file was correct but both BAM file gave me an error saying file '0.bam' does not have BAM or CRAM format.

Where did I go wrong?

bam fastq

If you want BAM files outputs you can use Rsubread package on R software or use bowtie2 to have SAM format witch you can transform to BAM format with Samtools. They are many tools for this kind of analysis, you can find them in literature. Best regards.

Ok I'll try it. Thank you!

Did you sort and index your aligned BAM file?

No, how do I do that?

By using samtools sort tool followed by samtools index in Galaxy interface.

Ok. I'll give it a try. Thank you!

I want to do pca plot on them

What are you trying to find out?

One gave me unaligned BAM and another gave aligned BAM.

That makes sense. Bowtie2 is an aligner, FastqToSam probably just takes the reads and sticks them in a SAM/BAM format. We can't say which one is right for you without knowing what your goal is. The unaligned one is likely only useful for compatibility with tools expecting a BAM file

Then, I used multiBAMsummary tool to see which file was correct but both BAM file gave me an error saying file '0.bam' does not have BAM or CRAM format

Can you post the exact command you used? What size are your input BAM files?

I have 2 treatment groups - control and probiotic for chicken heavy and light chain. I'm trying to look at the variability of sequences between those treatment group.

I used multiBamsummary under deep Tools. I just noticed the file size says 0 bytes. The run showed up green so I automatically assume that it worked.

1 answer

That means it did not run. You can align the fastq files using bowtie2:

bowtie2  -x index -1 R1.fastq -2 R2.fastq -S bowtie.sam

Then convert the sam to bam using samtools:

samtools view -bS bowtie.sam -o bowtie.bam

Then sort it:

samtools sort bowtie.bam -o bowtie.sorted.bam

You can index the .sorted.bam by using:

samtools index bowtie.sorted.bam

I have tried it and it worked! Thank you!

In short:

bowtie2 (options...) | samtools sort -o bowtie.bam
samtools index bowtie.bam

Log in to answer this question.