text: user1082: 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 to search, it returns 26933249 SNPs, but the webpage seems to refuse me to download the information. 
  
  user298: 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. 
  
  
original_text: 1082: <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>
   298: <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.stack.imgur.com/BvgJG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/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>
  