Script to download fasta seqeuences for FGF1 to FGF12
2
0
Entering edit mode
4.8 years ago
Shicheng Guo ★ 9.5k

Hi All,

Who can share a script to download human gene fasta/sequences for FGF1, FGF2, FGF3, FGF4, FGF5, FGF6 and FGF7 at the same time?

Thanks.

human fasta • 999 views
ADD COMMENT
1
Entering edit mode

You can try using bedtools getfasta.

  1. First obtain coordinates of the gene (eg. FGF1 and genome version hg19).

    chr5 141971743 142077635 FGF1(GRCh37/hg19) (note: tab-separated)

  2. Run getfasta using fasta file hg19 version:

bedtools getfasta -fi hg19.fa -bed FGF1.bed -fo FGF1.fa

FGF1.fa will be your fasta sequence.

And you can do the same for other genes by making a shell script and it will extract all at the same time. Make a bed of file of all coordinates of the gene of your interest and run getfasta.

ADD REPLY
2
Entering edit mode
4.8 years ago

Why won't BioMart at ensembl do what you want?

ADD COMMENT
0
Entering edit mode

Thanks. any script to share?

ADD REPLY
0
Entering edit mode

Why didn't Biomart work for you?

ADD REPLY
2
Entering edit mode
4.8 years ago
GenoMax 146k

Using EntrezDirect. Following will get you only RefSeq entries (which is what I assume would be of interest).

$  esearch -db nuccore -query "FGF1 [GENE] AND Homo sapiens [ORGN]" | efetch -format docsum | xtract -pattern DocumentSummary -if SourceDb -contains refseq -element Caption | xargs -n 1 sh -c 'efetch -db nuccore -id "$0" -format fasta_cds_na'
ADD COMMENT

Login before adding your answer.

Traffic: 1285 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6