The IUPAC and IUBMB recommendation documents, which describe the one letter encodings for nucleotide and amino-acid sequences, can be found at:
- Nucleotides (1970): http://www.chem.qmul.ac.uk/iupac/misc/naabb.html#p3
- Nucleotide ambiguity codes (1984): http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html
- Amino-acids (1983): http://www.chem.qmul.ac.uk/iupac/AminoAcid/A2021.html
From these you will notice that the amino-acid code 'B' is reserved for "aspartic acid or asparagine" due to uncertain result of hydrolysis during Edman sequencing, and the amino-acid code 'U' is used for selenocysteine. You may notice that 'J' and 'O' are missing from the amino-acid nomenclature described in these documents, these have been subsequently assigned as:
- 'J': leucine or isoleucine, an uncertain result of mass-spec sequencing
- 'O': pyrrolysine
A convenient summary of the current amino-acid one letter code can be found at: http://pir.georgetown.edu/resid/faq.shtml#q01
At this point any sequence of characters from the English alphabet is a valid protein sequence. Unfortunately this also includes any valid DNA sequence, and most RNA sequences (excepting those containing pseudouridine).
While it is possible to say that a sequence is not a nucleotide sequence, without additional information it is not possible to definitively say that a sequence is not protein sequence. That said the proportion approach you suggest will work in the majority of cases (EMBOSS uses something similar to guess the sequence type). However there are always exceptions that cause trouble, so it is a good idea to provide users with some way of explicitly specifying the sequence type.
Count the frequency of A, T, G, and C !! :) If if sum is not equal to ~~ 1 then its not Nucleotide !!
I am not sure exactly what you mean - isn't that differentiating between a single nucleotide and a sequence - I am trying to differentiate between protein sequence and DNA sequence not a sequence and a nucleotide...
Yes, I understand that !! First you will count occurrence of A and then occurrence of T and then occurrence of G and then occurence of C !! and then get the complete length also ..
if occurence of A + occurence of T + occurence of C + occurence of A = complete length, then its Nucletide sequence .
Else start reading file from start and moment you will get any word apart from these A,T, G and C, then break it and print that its Amino acids !! As its highly impossible for to NOT getting any words apart from these 4 in amino acids for a length of say 1000 sequences !!