Is there a tool which allows me to transform information in the form (chromosome number, start index, end index) to sequence information? For example, something like (6, 43770819, 43770841) should yield GACCCCCTCCACCCCGCCTCCGG as this is the relevant bases on the 6th chromosome.

A command line executable is preferred, although a web-based service is also fine. Thanks a bunch in advance.

  • 1
    $\begingroup$ I think this should be possible with Biomart. $\endgroup$
    – Chris
    Mar 1, 2016 at 14:20

1 Answer 1


You can write a small script to do that. Basically you just have to print a string from position-x to position-y. Explaining how to do that is not really on-topic here.

From available tools you can use getfasta from the bedtools package. This requires a BED file, or a GTF file as an input. The three column format as in your question will also work but usually the orientation (+/-) is also important to fetch the right sequence; otherwise all sequences would be fetched from the + strand only. GTF format is a bit different: the three columns in your question would be the first fourth and fifth column in the GTF. Seventh column holds the orientation.

bedtools getfasta [OPTIONS] -fi <input FASTA> -bed <BED/GFF/VCF> -fo <output FASTA>


getFastaFromBed [OPTIONS] -fi <input FASTA> -bed <BED/GFF/VCF> -fo <output FASTA>

There is another one called gffread which comes with the tophat package.

gffread takes a GTF/GFF file as an input and gives you a fasta file of sequences corresponding to the positions listed in the GTF file. The third column (feature) should be exon or transcript as this tool was actually designed to extract transcript sequences.

gffread -w transcripts.fa -g /path/to/genome.fa transcripts.gtf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .