ncbi fasta files
1
0
Entering edit mode
3.0 years ago
bio90029 ▴ 10

I have been trying to download a fasta file from NCBI with the code below:

wget https://www.ncbi.nlm.nih.gov/nuccore/NG_049243.1?report=fasta

but what I get is all the html index. I have tried with efetch but as I do not have sudo right on the server to install it. Is there any suggestion to improve the command line so I can get a nice fasta format file.I have also tried with curl but I got the same html index. The above script seems to work with everyone except me.

sequence • 1.8k views
ADD COMMENT
0
Entering edit mode

Do you need to use an HTTP proxy to access the internet? If so, you'll need to set your $HTTP_PROXY and $HTTPS_PROXY environment variables appropriately: https://askubuntu.com/a/584150

ADD REPLY
0
Entering edit mode

Unluckily, I have not sudo right on this server as it is set up by work. I will have to ask for sudo right or them to set it up.

ADD REPLY
0
Entering edit mode

Try conda for installing Entrez Direct utilities https://anaconda.org/bioconda/entrez-direct which does not require root permissions.

I doubt this code above works for anyone as it is not the path to a file directly. This fasta is small enough for copy/pasting though.

ADD REPLY
0
Entering edit mode

Thanks. But as I stated I have sudo right so I cannot install anything on the server. Although, I will try it with my home computer.

ADD REPLY
1
Entering edit mode

It does not require any root permissions, though the answer of Pierre Lindenbaum below is the easiest way to go.

ADD REPLY
2
Entering edit mode
3.0 years ago

I have tried with efetch but as I do not have sudo right on the server to install it.

if you have wget, you can use the NCBI efetch service.

$ wget -q -O - "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=NG_049243.1&rettype=fasta"
>NG_049243.1 Acinetobacter baumannii C1AC9-24 blaKPC gene for carbapenem-hydrolyzing class A beta-lactamase KPC-10, complete CDS
ATGTCACTGTATCGCCGTCTAGTTCTGCTGTCTTGTCTCTCATGGCCGCTGGCTGGCTTTTCTGCCACCG
CGCTGACCAACCTCGTCGCGGAACCATTCGCTAAACTCGAACAGGACTTTGGCGGCTCCATCGGTGTGTA
CGCGATGGATACCGGCTCAGGCGCAACTGTAAGTTACCGCGCTGAGGAGCGCTTCCCACTGTGCAGCTCA
TTCAAGGGCTTTCTTGCTGCCGCTGTGCTGGCTCGCAGCCAGCAGCAGGCCGGCTTGCTGGACACACCCA
(...)
ADD COMMENT
0
Entering edit mode

Fantastic! it did work.Thanks a lot.

ADD REPLY

Login before adding your answer.

Traffic: 2394 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