Using BigBedToBed to Search for SNPs

Skip to first unread message

David, Serena S

unread,
Sep 27, 2023, 12:26:14 PM9/27/23
to gen...@soe.ucsc.edu

Dear UCSC,

 

I had a question about what I should do in the case of a bigBedToBed executable file not running as well as a question about how I can feed in some sort of file into the bigBedToBed syntax containing information on chromosome number and position to see if there are recognized SNPs at that location.

 

For the first question, I tried using bigBedToBed to look at certain regions of chromosomes that might have various SNPs since you suggested not to download the whole file of SNPs across the genome due to the huge size and the risk it might truncate.  I was able to click on the MacOS button and find the bigBedToBed file, download that, and turn the file into an executable as stated below…  

 

http://hgdownload.soe.ucsc.edu/downloads.html#utilities_downloads

 

A screenshot of a computer

Description automatically generated

 

Here is an image of the executable file on my Desktop:

 

A close up of a black square

Description automatically generated

 

However, when I went to run the following command to test it out, the error message said that the command was not found…

 

https://genome.ucsc.edu/FAQ/FAQdownloads.html#snp

 

Image

 

As for the second question, based on the above line of code is there a way to write it so that I can use a .txt file or a related file to search for multiple chromosome locations using the address in the code?  I have a .txt file already that has chromosome number in one column and position in the other.  I just want to check the database to see if these entries are SNPs or something other than a SNP.

 

Thanks,

Serena

 

Ph.D. Graduate Student

UMass Chan Medical School

Jairo Navarro Gonzalez

unread,
Sep 27, 2023, 3:58:30 PM9/27/23
to David, Serena S, gen...@soe.ucsc.edu

Hello,

Thank you for using the UCSC Genome Browser and sending your inquiry.

Your problem is that the bigBedToBed utility is not defined in your PATH variable, so your system cannot find the program. If the directory containing the bigBedToBed utility is not defined inside of your PATH variable, you will have to specify the location of the tool before your system can run the program. You can learn more about the PATH variable for your Mac on the following StackOverflow post:

https://stackoverflow.com/questions/22465332/setting-path-environment-variable-in-osx-permanently

If your current working directory contains the bigBedToBed utility, then you can execute the utility by running the command with "./" appended to the name:

./bigBedToBed

If the bigBedToBed utility is in a different directory, you must use the full path to the directory containing the bigBedToBed program.

For your second question, you must create a script to iterate through your file and parse the chromosome, start, and end values from your file. For example, the following bash command will iterate through a file named "coordinates.txt" and run the bigBedToBed command:

while IFS=$'\t' read -r chr start end; do ./bigBedToBed http://hgdownload.soe.ucsc.edu/gbdb/hg38/snp/dbSnp153.bb -chrom=$chr -start=$start -end=$end stdout; done < coordinates.txt
chr1    82133    82154    rs201023701    AAAAAAAAAAAAAAAAAAAAA    11    AAAAAA,AAAAAAAAA,AAAAAAAAAA,AAAAAAAAAAA,AAAAAAAAAAAA,AAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAAAAA,AAAAAAAAAAAAAAAAAAAAAA,    21    12    0.0501198,-inf,-inf,-inf,-inf,-inf,-inf,-inf,-inf,-inf,-inf,-inf,    AAAAAAAAAAAAAAAAAAA,,,,,,,,,,,,    AAAAAAAAAAAAAAAAAAAAA,,,,,,,,,,,,    delins    refIsMinor,commonSome,commonAll,overlapDiffClass,overlapSameClass,    43521217499    195
chr1    82151    82157    rs1161141222    AAAGAA    1    AA,    2    0                delins    rareSome,rareAll,overlapSameClass,overlapDiffClass,    7229094578    36
chr1    82153    82154    rs4477212    A    1    G,    0    0                snv    rareSome,rareAll,overlapDiffClass,    45808887814    54
chr1    82153    82156    rs1338301382    AGA    1    A,    1    0                delins    rareSome,rareAll,overlapSameClass,overlapDiffClass,    23885588098    43

The command above assumes that the bigBedToBed utility and coordinates.txt are in the same working directory. If you require help creating scripts for your research, you may be interested in posting your question to other bioinformatic forums, such as BioStars (https://www.biostars.org/).

I hope this is helpful. If you have any further questions, please reply to gen...@soe.ucsc.edu.
All messages sent to that address are archived on a publicly accessible Google Groups forum.
If your question includes sensitive data, you may send it instead to genom...@soe.ucsc.edu.

Jairo Navarro
UCSC Genome Browser


--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Public Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome+un...@soe.ucsc.edu.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome/MN2PR10MB422205851E94D140D7638C6CDAC2A%40MN2PR10MB4222.namprd10.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages