Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to fetch sequence from chromosome coordinates

    Hi all
    I have chromosome coordinates (e.g. 5233922 to 5235189 of chr18). how can I get the sequence corresponding to this region ?
    Like this I have huge file containing chr1 to chr21 and chr X and chrY. Is there any platform where I can give the coordinate file and that give me the desired nucleotide sequences ?
    Is there any difference between using hg18 human reference genome or hg19 for the same purpose. Because the experiment has used hg18 assembly to generate the coordinates (which they have given in supplementary material).

    Thanks in advance.
    KD

  • #2
    Originally posted by kumardeep View Post
    Hi all
    I have chromosome coordinates (e.g. 5233922 to 5235189 of chr18). how can I get the sequence corresponding to this region ?
    Like this I have huge file containing chr1 to chr21 and chr X and chrY. Is there any platform where I can give the coordinate file and that give me the desired nucleotide sequences ?
    Is there any difference between using hg18 human reference genome or hg19 for the same purpose. Because the experiment has used hg18 assembly to generate the coordinates (which they have given in supplementary material).

    Thanks in advance.
    KD
    Hello,

    you can use the faidx command of samtools.
    First you need to create an indexed version of your FASTA:

    samtools faidx genome.fa

    Then you can retrieve any region, using the syntax chromosome:start-stop

    samtools faidx genome.fa chr18:5233922-5235189

    Cheers,
    Marco

    Comment


    • #3
      Thanks Marloch...

      Comment


      • #4
        I am also trying to retrieve sequences from chromosome coordinates, but I have 50, not just one. I hope I don't have to run samtools 50 times.

        Anybody has an easy way doing this?

        I tried in R using system(), but there are some problems.
        if I run >system('samtools faidx genome.fa chr2:1000:2000'), it prints out the sequence I wanted in console, but if I put in a variable x<-"chr2:1000:2000", it only prints out "x", but no sequences. So how to get the system() to recognize a varialbe?

        Also, can't seems to get the output to a file.
        >system('samtools faidx genome.fa chr2:1000:2000 >out.txt') doesn't work

        thanks in advance.

        Comment


        • #5
          Originally posted by JQL View Post
          I am also trying to retrieve sequences from chromosome coordinates, but I have 50, not just one. I hope I don't have to run samtools 50 times.

          Anybody has an easy way doing this?

          I tried in R using system(), but there are some problems.
          if I run >system('samtools faidx genome.fa chr2:1000:2000'), it prints out the sequence I wanted in console, but if I put in a variable x<-"chr2:1000:2000", it only prints out "x", but no sequences. So how to get the system() to recognize a varialbe?

          Also, can't seems to get the output to a file.
          >system('samtools faidx genome.fa chr2:1000:2000 >out.txt') doesn't work

          thanks in advance.
          You can use the Biostring package I think. Check out this tutorial (end of page).

          Comment


          • #6
            it is an old post, I have an old post addressing this http://crazyhottommy.blogspot.com/20...inates-to.html

            Comment


            • #7
              UCSC version

              You can use a command like this:

              twoBitToFa http://hgdownload.cse.ucsc.edu/gbdb/hg19/hg19.2bit -bed=input.bed test.fa

              or for a single region:

              twoBitToFa http://hgdownload.cse.ucsc.edu/gbdb/hg19/hg19.2bit test.fa -seq=chr21 -start=1 -end=10000

              Requires the UCSC tool twoBitToFa, available from http://hgdownload.cse.ucsc.edu/admin/exe/

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM
              • seqadmin
                Strategies for Sequencing Challenging Samples
                by seqadmin


                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                03-22-2024, 06:39 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              25 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              29 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              25 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              52 views
              0 likes
              Last Post seqadmin  
              Working...
              X