Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kumardeep
    Member
    • Apr 2012
    • 15

    #1

    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
  • marloch
    Junior Member
    • Jan 2009
    • 3

    #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

    • kumardeep
      Member
      • Apr 2012
      • 15

      #3
      Thanks Marloch...

      Comment

      • JQL
        Member
        • Apr 2011
        • 83

        #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

        • krespim
          Member
          • Jul 2012
          • 49

          #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

          • crazyhottommy
            Senior Member
            • Apr 2012
            • 187

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

            Comment

            • maximilianh
              Member
              • Oct 2009
              • 15

              #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

              • kinpict.com
                Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                by kinpict.com
                The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
                Today, 06:37 PM
              • SEQadmin2
                16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                by SEQadmin2





                NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
                10-30-2026, 06:46 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 11-12-2026, 07:59 AM
              0 responses
              27 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 11-05-2026, 09:25 AM
              0 responses
              35 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 11-03-2026, 11:54 AM
              2 responses
              56 views
              0 reactions
              Last Post kinpict.com  
              Started by SEQadmin2, 10-28-2026, 09:57 AM
              0 responses
              175 views
              0 reactions
              Last Post SEQadmin2  
              Working...