This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is it possible to convert NC_ to NP_ for RefSeq ?

Hello,

As the title says, is it possible to obtain all NP_ given an NC_ accession number for RefSeq ? For example, if we have, NC_000014.9 is it possible to obtain all NP_ ?

Thank you !

refseq

1 answer

You can accomplish that via entrez direct with:

esearch -db nuccore -query NC_000014 | elink -target protein | efetch -format acc > ids.txt

then

head ids.txt

prints:

NP_001095924.1
NP_891989.2
NP_065972.3
NP_777636.2
NP_065099.3
NP_001035365.1
NP_776249.1
NP_068814.2
NP_001428.1
NP_057270.1

Thank you !! Is it possible to pass a text file ? I have a very big list.

use gnu parallel to automate tasks, for example

save the first ten proteins in a file

cat ids.txt | head  | parallel -j 1 efetch -db protein -format fasta -id {} > prots.fa

You can use epost for this. Say you have an input.txt file with the NC accessions, one per line, you can do as follows:

epost -db nuccore -input `input.txt` -format acc | elink -target protein | efetch -format acc > ids.txt

Thank you both for your answers !

Log in to answer this question.