Here is how the data files contained in this package were produced:

1) Choose a <DOWNLOAD_DIR> dir e.g.
     ~/BSgenome_srcdata/BSgenome.Cfamiliaris.UCSC.canFam2/
   and create 2 subdirs in it: <DOWNLOAD_DIR>/seqs/ and <DOWNLOAD_DIR>/masks/

2) Download the big sequence file to the <DOWNLOAD_DIR>/seqs/ dir:

     ftp://hgdownload.cse.ucsc.edu/goldenPath/canFam2/bigZips/
       chromFa.tar.gz (744M)

   and extract it:

     cd <DOWNLOAD_DIR>/seqs/
     tar zxvf chromFa.tar.gz

   and move the *.fa files one level up:

     mv */*.fa . -i

3) Download the masks files to the <DOWNLOAD_DIR>/masks/ dir:

     cd <DOWNLOAD_DIR>/masks/

     ftp://hgdownload.cse.ucsc.edu/goldenPath/canFam2/database/
       ftp> prompt
       ftp> mget chr*_gap.txt.gz

     wget http://hgdownload.cse.ucsc.edu/goldenPath/canFam2/bigZips/chromOut.tar.gz
     wget http://hgdownload.cse.ucsc.edu/goldenPath/canFam2/bigZips/chromTrf.tar.gz

   then extract them:

     for file in chr*_gap.txt.gz; do gunzip $file ; done
     tar zxvf chromOut.tar.gz
     tar zxvf chromTrf.tar.gz

   and move the *.out and *.bed files one level up:

     mv */*.out */*.bed . -i

4) Install the BSgenome.Cfamiliaris.UCSC.canFam2 package (contains no data yet):

     R CMD INSTALL BSgenome.Cfamiliaris.UCSC.canFam2

5) R commands:

     library(BSgenome.Cfamiliaris.UCSC.canFam2)
     download_dir <- "<DOWNLOAD_DIR>"
     extdata_dir <- "<EXTDATA_DIR>"
     data_dir <- "<DATA_DIR>"
     system.time({
       srcdir <- file.path(download_dir, "seqs")
       forgeSeqFiles(srcdir, extdata_dir, seqnames(Cfamiliaris),
                     prefix="", suffix=".fa")
       forgeSeqFiles(srcdir, extdata_dir, mseqnames(Cfamiliaris),
                     prefix="", suffix=".fa", single.seq=FALSE)
       srcdir <- file.path(download_dir, "masks")
       forgeMaskFiles(srcdir, data_dir, seqnames(Cfamiliaris), extdata_dir,
                      3, "gap", prefix="", suffix="_gap.txt")
     })

