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

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

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

     ftp://hgdownload.cse.ucsc.edu/goldenPath/dm3/bigZips/
       chromFa.tar.gz (50M)
       upstream1000.fa.gz (4.1M)
       upstream2000.fa.gz (7.6M)
       upstream5000.fa.gz (18MB)

   and extract them:

     cd <DOWNLOAD_DIR>/seqs/
     for file in *.gz ; do gunzip $file ; done
     for file in *.tar ; do tar xvf $file ; done

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

     cd <DOWNLOAD_DIR>/masks/

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

     wget http://hgdownload.cse.ucsc.edu/goldenPath/dm3/bigZips/chromOut.tar.gz
     wget http://hgdownload.cse.ucsc.edu/goldenPath/dm3/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 *.fa.out and *.bed files one level up:

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

4) Install the BSgenome.Dmelanogaster.UCSC.dm3 package (contains no data yet):

     R CMD INSTALL BSgenome.Dmelanogaster.UCSC.dm3

5) R commands:

     library(BSgenome.Dmelanogaster.UCSC.dm3)
     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(Dmelanogaster),
                     prefix="", suffix=".fa")
       forgeSeqFiles(srcdir, extdata_dir, mseqnames(Dmelanogaster),
                     prefix="", suffix=".fa", single.seq=FALSE)
       srcdir <- file.path(download_dir, "masks")
       forgeMaskFiles(srcdir, data_dir, seqnames(Dmelanogaster), extdata_dir,
                      3, "gap", prefix="", suffix="_gap.txt")
     })

