Hi Joachim,
Thanks for contacting the UCSC Genome Browser support team. I'll go through some basic troubleshooting below,
listing details that you may already be familiar with - but others may search for this issue in the future, so I'll be specific :)
From your command line, can you just type "twoBitToFa" (note the case sensitivity) and press enter? If you run the name
of the utility on the command-line with no arguments, you should be able to see the usage statement as such:
$twoBitToFa
twoBitToFa - Convert all or part of .2bit file to fasta
usage:
twoBitToFa input.2bit output.fa
options:
-seq=name Restrict this to just one sequence.
-start=X Start at given position in sequence (zero-based).
-end=X End at given position in sequence (non-inclusive).
-seqList=file File containing list of the desired sequence names
in the format seqSpec[:start-end], e.g. chr1 or chr1:0-189
where coordinates are half-open zero-based, i.e. [start,end).
-noMask Convert sequence to all upper case.
-bpt=index.bpt Use bpt index instead of built-in one.
-bed=input.bed Grab sequences specified by input.bed. Will exclude introns.
-bedPos With -bed, use chrom:start-end as the fasta ID in output.fa.
-udcDir=/dir/to/cache Place to put cache for remote bigBed/bigWigs.
Sequence and range may also be specified as part of the input
file name using the syntax:
/path/input.2bit:name
or
/path/input.2bit:name
or
/path/input.2bit:name:start-end
If you are able to run the usage statement, then this means the permissions and path is working for you.
If the above test doesn't work, try doing a "cd" into the directory where your utility is. Make sure that you
have executable permissions by typing the following command:
$chmod +x <filename>
It's possible that the directory in which your utility resides is not listed in your $PATH. Once you are in the
directory where the utility resides, type the following (note the "dot slash") to see if you can get the usage statement.
$ ./twoBitToFa
Note that you can either add the location of the utility to your bash PATH environment variable,
or you can specify the path when you run it from a different directory.
One other thing to check is that you are using the correct utility version by typing "uname -a"
on the command line and pressing enter:
For example,
$ uname -a
Linux hgwdev 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Then make sure you have selected the correct utility version, starting here:
Here is an example usage statement:
twoBitToFa input.2bit output.fa
For example, you can download the hg38 2.bit file here:
With a command such as this (note the 'dot' at the end to put the file in your current directory):
rsync -avzP rsync://hgdownload.cse.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit .
You can now try one of the following commands:
If you can get the usage statement by simply typing/entering the utility (without the preceding 'dot slash'), try this:
twoBitToFa hg38.2bit hg38.output.fa
Or, if you need to specify where your utility is, try this (from the directory where your 2bit and utility both reside):
./twoBitToFa hg38.2bit hg38.output.fa
If on the other hand, you are trying to make a 2bit from a fasta file, you will need to use this utility instead: faToTwoBit.
faToTwoBit
Command usage:
faToTwoBit in.fa [in2.fa in3.fa ...] out.2bit
Example:
faToTwoBit in.fa hg38.fa hg38.outputFromFasta.2bit
If these steps still do not assist in attaining your goal, please respond to this forum with the following details:
1. What is the exact command you are using?
2. Can you provide information regarding the input files you are using?