Please edit your question rather than putting this as an answer.
I have GenBank accession numbers and gene symbols from my Agilent microarray.
A_55_P2051983 FALSE NM_001001803 Spink7 serine peptidase inhibitor, Kazal type 7 (putative) Mus musculus serine peptidase inhibitor, Kazal type 7 (putative) (Spink7), mRNA [NM_001001803] GO:0005576|GO:0004867|GO:0030414 chr18:62753954-62753895 CAGTTTGTGGATCTGACTATATCACTTACGGGAATAAATGCAAGCTGTGTACAGAGATCT
I would like to convert all of these into one fasta file. Any advice would be appreciated.
Thanks,
Stephen
2 answers
awk -F ' ' '{printf(">"); for(i=1;i[?] result.fa
Edit:
cat yourlist.txt | cut -f 3 |\
while read L
do
A=`echo -n $L |cut -d ' ' -f 3`
curl -s "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=${A}&retmode=text&rettype=fasta"
done
Thank you. The script did convert my txt file to fasta format. But I don't think I was entirely clear. This is the output from your script:
A_55_P2051983 FALSE NM_001001803 Spink7 serine peptidase inhibitor, Kazal type 7 (putative) Mus musculus serine peptidase inhibitor, Kazal type 7 (putative) (Spink7), mRNA [NM_001001803] GO:0005576|GO:0004867|GO:0030414 chr18:62753954-62753895 CAGTTTGTGGATCTGACTATATCACTTACGGGAATAAATGCAAGCTGTGTACAGAGATCT
But this shows only a partial sequence. The entire sequence, from NCBI, is this
gi|254675241|ref|NM_001001803.2| Mus musculus serine peptidase inhibitor, Kazal type 7 (putative) (Spink7), mRNA ATGAAGCTTGTTGGTGGTCTCCTGCTGCTCTTCGCAGCAACCTATGTCTGCAACTGCTCTGAAGTTACTAGCCACCCTTCAGCAACAGTGGACTGTGACATATACAAGAAGTACCCAGTGGTGGCCATCCCTTGCCCCATTGTAAACATACCAGTTTGTGGATCTGACTATATCACTTACGGGAATAAATGCAAGCTGTGTACAGAGATCTTGAGAAGCAATGGAAAAATCCAGTTTCTTCATGAAGGGCACTGCTGA
So, is there any way to go from the partial sequence I have from my microarray data to a fasta file with the complete sequence? Hopefully this is clearer.
Thanks, Stephen
Log in to answer this question.
So you in fact want to get a fasta file with the full DNA sequence of the transcript or gene that the reporter sequence matches? (Pierre's answer was seemingly correct for the question in the way you posed it.) If that is what you want you have to specify if you want gene or transcript sequence and which transcript to take if there are multiple transcripts. You can get this information from e.g. biomart using a list of accession numbers.