Let's say I want to download the fasta sequence of the region chr1:100000..200000 from the UCSC browser. How do you do that? I can't find a button to 'export to fasta' in the UCSC genome browser. I think that the solution is to click on one of the tracks displayed, but I am not sure of which. If I go to the Tables section, I can't find a table with the fasta sequences among the many.
Use the DAS server:
There is no table with sequences. The sequences are in a file because that's a lot faster.
I think the question was mostly about how to get a single sequence and the answer to that is very simple: click View - DNA.
If you need to get the sequence from a script, use the UCSC utility twoBitToFa (see http://hgdownload.cse.ucsc.edu/admin/exe/) like this:
wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/twoBitToFa chmod a+x twoBitToFa twoBitToFa http://hgdownload.cse.ucsc.edu/gbdb/hg19/hg19.2bit test.fa -seq=chr21 -start=1 -end=10000
Yet another solution.
TogoWS's REST API now supports the UCSC Genome Database.
For example, http://togows.org/api/ucsc/hg38/chr1:12,345-12,500.fasta returns the reference genome sequence in the fasta format.
Please see further information at the "External API" section of http://togows.org/help/
The Genome Browser is for visualization.
To get data in many formats use the UCSC Table Browser then select the output format of your choice.
You may also need to select the right group and track to get the data you want.
Another solution is using Heng Li's sequence toolkit:
seqtk subseq Usage: seqtk subseq [options] <in.fa> <in.bed>|<name.list> Options: -t TAB delimited output -l INT sequence line length  Note: Use 'samtools faidx' if only a few regions are intended.
which can be downloaded from: https://github.com/lh3/seqtk , however, seqtk subseq does not consider the strand information, which has been implemented in bedtools getfasta
Tool: bedtools getfasta (aka fastaFromBed) Version: v2.23.0 Summary: Extract DNA sequences into a fasta file based on feature coordinates. Usage: bedtools getfasta [OPTIONS] -fi <fasta> -bed <bed/gff/vcf> -fo <fasta> Options: -fi Input FASTA file -bed BED/GFF/VCF file of ranges to extract from -fi -fo Output file (can be FASTA or TAB-delimited) -name Use the name field for the FASTA header -split given BED12 fmt., extract and concatenate the sequencesfrom the BED "blocks" (e.g., exons) -tab Write output in TAB delimited format. - Default is FASTA format. -s Force strandedness. If the feature occupies the antisense, strand, the sequence will be reverse complemented. - By default, strand information is ignored. -fullHeader Use full fasta header. - By default, only the word before the first space or tab is used.
I understand this is a very old post, but if it helps anyone who is searching for programmatic access directly using UCSC tools, I found the below link http://genomewiki.ucsc.edu/index.php/Programmatic_access_to_the_Genome_Browser
It has details on
1) How to download data from their MySQL database
2) Get Chromosome sequence for a range (using REST API, which was what I was looking for)
... and few such things including accessing a copy of current Genome browser image
Hope this helps!