Question: Getting Sequence Based On Chromosome No And Coordinates From Whole Genome Fasta File
2
gravatar for Anurag
7.2 years ago by
Anurag20
Belgium
Anurag20 wrote:

I am having chromosome no or fasta header and coordinates and thier orientation:for example

Chr:start:end:strand
chr8:1100023:1100050:+

(this list is quite long say about 15000 coordinates)

and whole genome sequence in fasta format in other file, for example:

>(fasta)chr8
sequence.

Is there any tool or program or utility available to extract the sequences on the basis of coordinates from genome sequence file.

Any help will be highly appreciated.

Thanks in advance.

sequence coordinates tool • 9.9k views
ADD COMMENTlink modified 7 months ago by Biostar ♦♦ 20 • written 7.2 years ago by Anurag20
11
gravatar for Chris Miller
7.2 years ago by
Chris Miller20k
Washington University in St. Louis, MO
Chris Miller20k wrote:

Samtools can do this.

#First, index your fasta file (only have to do this once)
samtools faidx reference.fa

#then extract the sequences you want
samtools faidx ref.fasta 1:1234-9876
ADD COMMENTlink written 7.2 years ago by Chris Miller20k
3
gravatar for Eric Fournier
7.2 years ago by
Eric Fournier1.4k
Quebec, Canada
Eric Fournier1.4k wrote:

You could also convert your coordinates into the standard BED format then use BEDtools' getfasta command to extract sequences.

sed -e 's/:/\t/ig' Your_coordinate_file > Coordinates.bed
bedtools getfasta -fi Your_fasta_File.fa -bed Coordinates.bed -fo Output_Sequences.fa
ADD COMMENTlink written 7.2 years ago by Eric Fournier1.4k
1
gravatar for Ido Tamir
7.2 years ago by
Ido Tamir5.0k
Austria
Ido Tamir5.0k wrote:

look at extractseq from emboss

you could do something like (not tested) in bash:

  extractseq chr8.fasta -reg $(awk 'BEGIN{FS=":" ; ORS=","}{print $2 ".." $3 }' inputfile) stdout -separate
ADD COMMENTlink written 7.2 years ago by Ido Tamir5.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1689 users visited in the last hour