<p>Hello, </p>

<p>I have a problem using <a href='http://cran.r-project.org/web/packages/ExomeDepth/index.html?utm_source=twitterfeed&amp;utm_medium=twitter'>ExomeDepth</a> with a referenceFASTA file. I analysed app. 500 target genes (&gt;7000 Exons, hg19) and without including a FASTA file and the GC content everything worked fine.</p>

<p>As GC content influencing amplification, coverage and CNV detection, I want to include this factor. Therefore I tried several things to get appropiate FASTA sequences.</p>

<ol>
<li><p>BioMart </p>

<p><code>mart &lt;- useMart("ensembl", dataset="hsapiens_gene_ensembl")
  FASTA  &lt;- getSequence(chromosom,start,stop,type="hgnc_symbol",seqType="gene_exon", mart = mart)</code></p></li>
</ol>

<p>Error:</p>

<pre><code>  `Reference fasta file provided so exomeDepth will compute the GC content in each window
   Error in (function (classes, fdef, mtable)  : 
   unable to find an inherited method for function ‘scanFa’ for signature ‘"data.frame", "GRanges"’`
</code></pre>

<ol>
<li><p>BSgenome</p>

<p><code>FASTA&lt;-getSeq(BSgenome.Hsapiens.UCSC.hg19,chromosom,start,stop)</code>                                                             </p>

<p><code>show(FASTA)</code></p>

<p><code>A DNAStringSet instance of length 10 width seq
[1]   845 GTTGAAAAGTGATCAGGTTCATTTTATTGACTACACAGAAGCAATTCCATTT...GAGGAGGCAGATCACGGCGAAGACAATGAAGCTGTACGGGCCGAGGCCCTC
[2]   129 CCTGGATGAACGGGAAGATCAAGCCCACGGTGAAGTTGGAGAGCCAGTGCAC...GCCGAGAGGACTGCAGGAAGATCTCAGTGATGAGCAGCGCGGGTATGGGAC
[3]    77 CTGGGCCCGAGGGCATGTCCTATGACGTAGGAGATGACACAGACGATGCTGATGTATGGCATCCAGGACACTGTGTC
[4]   103 CCTGCAGTGCCAGAGCTGCAGTGAGCACGCAGCAGGCTATGAGGCAGATGGAGAAGCCCAGCAGCAGCAGCAGCCTCCGACCCAGGAGCTCCACCACGAACAC
[5]   112 CGGCGCAGAAGGTCATGACCACGTTCACGGCCCCGGTGCCGGCCGTCACGTA...CTCCTCCGGCACGCCGGCGCTCAGGTAGATCTGGTCCGCGTAGTAGTAGAT</code></p></li>
</ol>

<p>Error:</p>

<pre><code>Reference fasta file provided so exomeDepth will compute the GC content in each window
Error in (function (classes, fdef, mtable)  : unable to find an inherited method for function ‘scanFa’ for signature ‘"DNAStringSet", "GRanges"’
</code></pre>

<p>3. Downloading human_g1k_v37.fasta.gz</p>

<p>Chromsome, Start &amp; Stop including only the 7000 exon locations.
With method 1 and 2, I was able to get target sequences, but the counting (getbamcounts) didn't work, different errors occur, warning something is wrong with the FASTA file. I think there are some file formatting issues.</p>

<p><code>my.counts&lt;- getBamCount(data.frame(Chromsome, Start,Stop),
                           bam.files = bam.files,
                           include.chr = F ,
                           referenceFasta =FASTA)</code></p>

<p>I dindn't tried the  human_g1k_v37.fasta.gz so far, because I don't know how to load it in R. <br />
Do you have an idea how to transform the files that they work or how to load the whole genome FASTA File?</p>

<p>The reference FASTA file should be the same as that used for your mapping step, so you should have it already.  </p>
