<p>You just searched for <code>X[Chromosome]</code>, you didn't specify a species. Presumably, your dataset comes from a specific species, so you should limit your search to that species. For instance, for human, you can search dbSNP for <a href="https://www.ncbi.nlm.nih.gov/snp/?term=X%5BChromosome%5D%20human%5Borganism%5D" rel="nofollow noreferrer"><code>X[Chromosome] human[organism]</code></a>. Then, click on the <code>send to</code> link at the top left and download the data: </p>

<p><a href="https://i.sstatic.net/BvgJG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BvgJG.png" alt="dbSNP screenshot"></a></p>

<p>This is veeeeeery slow, however. I suggest that you instead download the data for chrX from dbSNP's FTP site (this assumes your species of interest is human): <a href="ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/chr_rpts/chr_X.txt.gz" rel="nofollow noreferrer">ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/chr_rpts/chr_X.txt.gz</a></p>

<p>Once you have this file, you can use it to filter your dataset:</p>

<ol>
<li><p>Collect all rsIDs from the file:</p>

<pre><code>zcat chr_X.txt.gz | awk '/^[0-9]/{print "rs"$1}' &gt; chrX.rsIDs
</code></pre></li>
<li><p>Filter your dataset.</p>

<p>You haven't shown the format of your dataset, so if it is just a list of rsIDs like this:</p>

<pre><code>$ cat dataset
rs77669712
rs199706910
rs2799940 
rs12205639
rs10958205
rs200778574
</code></pre>

<p>You can remove any that are on chrX with:</p>

<pre><code>$ grep -vxFf chrX.rsIDs dataset 
rs77669712
rs199706910
rs12205639
rs10958205
rs200778574
</code></pre>

<p>That will print all rsIDs from the text file <code>dataset</code> that are not also in the text file <code>chrX.rsIDs</code>. Note the <code>-x</code> option for <code>grep</code> which tells it to only consider matches that cover the entire line. This ensures that <code>rs1234</code> is not removed when you're looking for <code>rs123</code>. </p></li>
</ol>

CC BY-SA 3.0
2018-01-12T10:25:10.107Z
2018-01-14T11:35:57.607Z
2018-01-14T11:35:57.607Z
terdon
<p>Where can I find a list of SNP rs IDs that belong to the X chromosome? </p>

<p>I'm trying to exclude the SNPs on X-chromosome in a data set, but I don't know where these SNPs come from. </p>

<p>I tried to use <a href="https://www.ncbi.nlm.nih.gov/snp?term=X%5BChromosome%5D" rel="nofollow noreferrer">dbSNP</a> to search, it returns 26933249 SNPs, but the webpage seems to refuse me to download the information. </p>

CC BY-SA 3.0
2018-01-12T05:49:32.580Z
Have you tried the send to option in the top right corner, just below the search bar?
arup
CC BY-SA 3.0
2018-01-12T09:16:35.363Z
In what species? Your search didn't specify a species, are you really interested in rsIDs from *any* species?
terdon
<snp><phylogenetics>
Where can I find a list of SNP rs IDs that belong to the X chromosome?
# Where can I find a list of SNP rs IDs that belong to the X chromosome?

(Asked by: username_0 on 2018-01-12)

Where can I find a list of SNP rs IDs that belong to the X chromosome?

I'm trying to exclude the SNPs on X-chromosome in a data set, but I don't know where these SNPs come from.

I tried to use [dbSNP](https://www.ncbi.nlm.nih.gov/snp?term=X%5BChromosome%5D) to search, it returns 26933249 SNPs, but the webpage seems to refuse me to download the information.

**Tags:** snp, phylogenetics
> **Comments:**
> **username_1**: Have you tried the send to option in the top right corner, just below the search bar?  
> **username_2**: In what species? Your search didn't specify a species, are you really interested in rsIDs from *any* species?  

---

## 1 answers

### Answer by username_2 on 2018-01-12. Score: 6 | Accepted answer

You just searched for X[Chromosome], you didn't specify a species. Presumably, your dataset comes from a specific species, so you should limit your search to that species. For instance, for human, you can search dbSNP for X[Chromosome] human[organism]. Then, click on the send to link at the top left and download the data: 

This is veeeeeery slow, however. I suggest that you instead download the data for chrX from dbSNP's FTP site (this assumes your species of interest is human): ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/chr_rpts/chr_X.txt.gz
Once you have this file, you can use it to filter your dataset:

Collect all rsIDs from the file:
zcat chr_X.txt.gz | awk '/^[0-9]/{print "rs"$1}' > chrX.rsIDs

Filter your dataset.
You haven't shown the format of your dataset, so if it is just a list of rsIDs like this:
$ cat dataset
rs77669712
rs199706910
rs2799940 
rs12205639
rs10958205
rs200778574

You can remove any that are on chrX with:
$ grep -vxFf chrX.rsIDs dataset 
rs77669712
rs199706910
rs12205639
rs10958205
rs200778574

That will print all rsIDs from the text file dataset that are not also in the text file chrX.rsIDs. Note the -x option for grep which tells it to only consider matches that cover the entire line. This ensures that rs1234 is not removed when you're looking for rs123.


---

