<blockquote>
  <p>If I have one file containing all the CDS from my reference species, can that be used in bwa-mem? </p>
</blockquote>

<p>That's fine, normal usage of bwa-mem entails giving it a fasta file with all chromosomes/contigs/transcript/etc. in an organism, so your usage is no different. How your custom "make an MSA" script handles that is unknown of course.</p>

CC BY-SA 4.0
2019-09-28T15:35:23.693Z
Yes unfortunately I need to figure out a new python script - I had tested it out with a small reference file containing about 10 CDS, but my final MSA was messed up it looked like it tried to merge all the CDS into one sequence. It made no sense at all. And my reference file contained a list of CDS so it was a list of 10 individual fasta sequences of diff lengths, not one fasta sequence concantenated. Maybe that was the problem? I am not sure how to make bwa-mem read each CDS line as its own reference sequence.
CuriousDude
CC BY-SA 4.0
2019-09-28T15:37:09.797Z
I am trying a new way out now where I assemble my reads against each chromosome from my ref species...but then I have no idea how to pull out all the individual protein-coding gene sequences. I am having trouble thinking of this differently since I have been running individual genes for the past year with no issue.
CuriousDude
CC BY-SA 4.0
2019-09-27T06:17:47.407Z
2019-09-27T06:17:47.407Z
Devon Ryan
<p>Normally, I use bwa-mem to map my fastq reads for a bunch of species using one protein-coding gene CDS from my reference species. This was fine when I had to try it for just a group of genes...I would obtain single CDS fastq files and use them as a reference.
However, we now want to obtain protein-coding sequences for ALL GENES in my exome datasets. If I have one file containing all the CDS from my reference species, can that be used in bwa-mem? The end of my custom script produces one multiple sequence alignment file when I ran it using one gene only...my concern is that bwa-mem will somehow replace certain CDS or would I just end up with over 20000+ MSAs?  Which is fine because I need them to be individual MSAs for each protein-coding gene.</p>

<p>I use a simple python script at the end to extract base information from the mpileup files generated to create my MSAs. </p>

<bwa>
How to map multiple CDS sequences to exome data using bwa mem?
# How to map multiple CDS sequences to exome data using bwa mem?

(Asked by: username_0 on 2019-09-26)

Normally, I use bwa-mem to map my fastq reads for a bunch of species using one protein-coding gene CDS from my reference species. This was fine when I had to try it for just a group of genes...I would obtain single CDS fastq files and use them as a reference.
However, we now want to obtain protein-coding sequences for ALL GENES in my exome datasets. If I have one file containing all the CDS from my reference species, can that be used in bwa-mem? The end of my custom script produces one multiple sequence alignment file when I ran it using one gene only...my concern is that bwa-mem will somehow replace certain CDS or would I just end up with over 20000+ MSAs? Which is fine because I need them to be individual MSAs for each protein-coding gene.

I use a simple python script at the end to extract base information from the mpileup files generated to create my MSAs.

**Tags:** bwa

---

## 1 answers

### Answer by username_1 on 2019-09-27. Score: 1

> If I have one file containing all the CDS from my reference species, can that be used in bwa-mem?

That's fine, normal usage of bwa-mem entails giving it a fasta file with all chromosomes/contigs/transcript/etc. in an organism, so your usage is no different. How your custom "make an MSA" script handles that is unknown of course.

> **Comments:**
> **username_0**: Yes unfortunately I need to figure out a new python script - I had tested it out with a small reference file containing about 10 CDS, but my final MSA was messed up it looked like it tried to merge all the CDS into one sequence. It made no sense at all. And my reference file contained a list of CDS so it was a list of 10 individual fasta sequences of diff lengths, not one fasta sequence concantenated. Maybe that was the problem? I am not sure how to make bwa-mem read each CDS line as its own reference sequence.  
> **username_0**: I am trying a new way out now where I assemble my reads against each chromosome from my ref species...but then I have no idea how to pull out all the individual protein-coding gene sequences. I am having trouble thinking of this differently since I have been running individual genes for the past year with no issue.  

---

